added admin.js for javascript refractoring of moderation portal

This commit is contained in:
2026-04-30 15:57:38 +02:00
parent e1cf6f21f5
commit b4ee8fa6e0
3 changed files with 2 additions and 6 deletions

View File

@@ -10,8 +10,6 @@ require_once __DIR__ . '/api/auth.php';
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// Loads Municipality Configuration // Loads Municipality Configuration
// ToDo's: Dynamic Loading via URL Slug once multi-tenant Routing
// is implemented. Hardcoded Slug for now.
// ----------------------------------------------------------------- // -----------------------------------------------------------------
$pdo = get_db(); $pdo = get_db();
$stmt = $pdo->prepare("SELECT * FROM municipalities WHERE slug = :slug"); $stmt = $pdo->prepare("SELECT * FROM municipalities WHERE slug = :slug");
@@ -394,7 +392,7 @@ $news_items = $stmt->fetchAll();
<!-- Municipality Configuration passed to JavaScript --> <!-- Municipality Configuration passed to JavaScript -->
<!-- ============================================================= --> <!-- ============================================================= -->
<script> <script>
// Municipality Configuration from Database — used by app.js // Municipality Configuration from Database
const MUNICIPALITY = { const MUNICIPALITY = {
id: <?= $municipality['municipality_id'] ?>, id: <?= $municipality['municipality_id'] ?>,
name: "<?= htmlspecialchars($municipality['name'], ENT_QUOTES) ?>", name: "<?= htmlspecialchars($municipality['name'], ENT_QUOTES) ?>",

0
public/js/admin.js Normal file
View File

View File

@@ -3,9 +3,7 @@
// Initializes Leaflet Map, loads Contributions from the API, // Initializes Leaflet Map, loads Contributions from the API,
// handles CRUD Workflow, and manages all UI Interactions. // handles CRUD Workflow, and manages all UI Interactions.
// //
// Depends on: MUNICIPALITY Object set in Main Page, Leaflet, Geoman, // Depends on: MUNICIPALITY Object set in Citizen Portal
// Sidebar, Geocoder, PolylineMeasure, Fullscreen,
// and SweetAlert2 Plugins.
// ===================================================================== // =====================================================================