dynamic categories in contribution modal dropdown
This commit is contained in:
@@ -276,13 +276,7 @@ if (!$municipality) {
|
||||
<label for="create-category">Kategorie</label>
|
||||
<select id="create-category" class="form-input">
|
||||
<option value="">— Bitte wählen —</option>
|
||||
<option value="mobility">🚲 Mobilität</option>
|
||||
<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>
|
||||
<!-- Categories populated dynamically -->
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -895,11 +895,26 @@ function escapeHtml(text) {
|
||||
// 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();
|
||||
|
||||
// Load Contributions from API
|
||||
// Loads Contributions from API
|
||||
loadContributions();
|
||||
|
||||
// Show Welcome Modal on first Visit
|
||||
// Shows Welcome Modal on first Visit
|
||||
checkWelcomeModal();
|
||||
Reference in New Issue
Block a user