mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Fix admin CSS not loading and quirks mode issues
Fixed multiple issues in admin panel: 1. CSS path: modern-normalize.css → modern-normalize.min.css (File is actually named .min.css) 2. Icon path: assets/icon.svg → /assets/admin_favicon.svg (Was relative, now absolute; correct filename) 3. Navigation: /admin/list.php → /admin/ (list.php was renamed to index.php) 4. Short PHP tags: <? → <?php (Better compatibility, some servers don't enable short_open_tag) 5. Quirks mode warning was due to CSS not loading, not DOCTYPE (DOCTYPE was already present) Files modified: - public/admin/inc/head.php (main fixes) - public/admin/index.php (short tags) - public/admin/add.php (short tags) - public/admin/import.php (short tags) Need to redeploy for production: just deploy
This commit is contained in:
57
public/index.php
Normal file
57
public/index.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// Load configuration
|
||||
require_once __DIR__ . '/../config/bootstrap.php';
|
||||
require_once APP_ROOT . '/lib/Database.php';
|
||||
|
||||
$pageTitle = "Liste des TFE";
|
||||
$page = isset($_GET["page"]) ? intval($_GET["page"]) : 1;
|
||||
$itemsPerPage = 10;
|
||||
|
||||
try {
|
||||
$db = Database::getInstance();
|
||||
$offset = ($page - 1) * $itemsPerPage;
|
||||
$itemsToLoad = $db->getPublishedTheses($itemsPerPage, $offset);
|
||||
$totalItems = $db->countPublishedTheses();
|
||||
$totalPages = ceil($totalItems / $itemsPerPage);
|
||||
} catch (Exception $e) {
|
||||
error_log("Error loading theses: " . $e->getMessage());
|
||||
$itemsToLoad = [];
|
||||
$totalPages = 0;
|
||||
}
|
||||
|
||||
include APP_ROOT . '/includes/header.php';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<?php foreach ($itemsToLoad as $item): ?>
|
||||
<a href="memoire.php?id=<?= $item["id"] ?>" class="card-link">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<h2 class="title"><?= htmlspecialchars($item["title"]) ?></h2>
|
||||
<p class="authors"><?= htmlspecialchars($item["authors"]) ?></p>
|
||||
<p class="year"><?= htmlspecialchars($item["year"]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if (empty($itemsToLoad)): ?>
|
||||
<p>Aucun mémoire trouvé.</p>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<?php if ($totalPages > 1): ?>
|
||||
<nav class="pagination">
|
||||
<?php if ($page > 1): ?>
|
||||
<a href="?page=<?= $page - 1 ?>" class="pagination-previous">Précédent</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($page < $totalPages): ?>
|
||||
<a href="?page=<?= $page + 1 ?>" class="pagination-next">Suivant</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="pagination-info">Page <?= $page ?> sur <?= $totalPages ?></span>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php include APP_ROOT . '/includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user