dynamic categories in contribution modal dropdown
This commit is contained in:
@@ -276,13 +276,7 @@ if (!$municipality) {
|
|||||||
<label for="create-category">Kategorie</label>
|
<label for="create-category">Kategorie</label>
|
||||||
<select id="create-category" class="form-input">
|
<select id="create-category" class="form-input">
|
||||||
<option value="">— Bitte wählen —</option>
|
<option value="">— Bitte wählen —</option>
|
||||||
<option value="mobility">🚲 Mobilität</option>
|
<!-- Categories populated dynamically -->
|
||||||
<option value="building">🏗️ Bauen</option>
|
|
||||||
<option value="energy">⚡ Energie</option>
|
|
||||||
<option value="environment">🌳 Umwelt</option>
|
|
||||||
<option value="industry">🏭 Industrie</option>
|
|
||||||
<option value="consumption">🛒 Konsum</option>
|
|
||||||
<option value="other">📌 Sonstiges</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -895,11 +895,26 @@ function escapeHtml(text) {
|
|||||||
// Block 16: Application Startup
|
// Block 16: Application Startup
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
|
|
||||||
// Initialize Category Filter in Sidebar
|
// Populates Category Dropdown in Create Modal from Categories Object
|
||||||
|
function buildCategoryDropdown() {
|
||||||
|
var select = document.getElementById('create-category');
|
||||||
|
for (var key in CATEGORIES) {
|
||||||
|
var cat = CATEGORIES[key];
|
||||||
|
var option = document.createElement('option');
|
||||||
|
option.value = key;
|
||||||
|
option.textContent = cat.icon + ' ' + cat.label;
|
||||||
|
select.appendChild(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Populates Category Dropdown
|
||||||
|
buildCategoryDropdown();
|
||||||
|
|
||||||
|
// Initializes Category Filter in Sidebar
|
||||||
buildCategoryFilter();
|
buildCategoryFilter();
|
||||||
|
|
||||||
// Load Contributions from API
|
// Loads Contributions from API
|
||||||
loadContributions();
|
loadContributions();
|
||||||
|
|
||||||
// Show Welcome Modal on first Visit
|
// Shows Welcome Modal on first Visit
|
||||||
checkWelcomeModal();
|
checkWelcomeModal();
|
||||||
Reference in New Issue
Block a user