mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
Refactor admin panel and add migration documentation
- Add comprehensive migration guides (DEPLOYMENT_MIGRATION.md, DIRECTORY_STRUCTURE.md, MIGRATION_CHECKLIST.md) - Refactor admin panel: split add.php, create reusable header/footer - Update styles: admin.css, common.css, main.css - Improve public pages: index.php, memoire.php - Reorganize database documentation into database/docs/ - Update .gitignore and justfile This prepares for migration to public/ directory structure
This commit is contained in:
125
index.php
125
index.php
@@ -3,6 +3,8 @@ ini_set("display_errors", 0);
|
||||
ini_set("log_errors", 1);
|
||||
ini_set("error_log", "error.log");
|
||||
|
||||
$pageTitle = "Liste des TFE";
|
||||
|
||||
require_once __DIR__ . "/lib/Database.php";
|
||||
|
||||
$page = isset($_GET["page"]) ? intval($_GET["page"]) : 1;
|
||||
@@ -20,76 +22,65 @@ try {
|
||||
$totalPages = 0;
|
||||
}
|
||||
|
||||
include "inc/header.php";
|
||||
?>
|
||||
<main>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="columns is-multiline">
|
||||
include "inc/header.php"; ?>
|
||||
|
||||
<?php foreach ($itemsToLoad as $item): ?>
|
||||
<div class="column is-one-fifth">
|
||||
<a href="memoire.php?id=<?= $item["id"] ?>" class="card-link">
|
||||
<main>
|
||||
<?php foreach ($itemsToLoad as $item): ?>
|
||||
<a href="memoire.php?id=<?= $item["id"] ?>" class="card-link">
|
||||
<div class="card">
|
||||
<?php
|
||||
// Get cover image from thesis_files if available
|
||||
$coverImage = null;
|
||||
if (!empty($item["id"])) {
|
||||
$files = $db->getThesisFiles($item["id"]);
|
||||
foreach ($files as $file) {
|
||||
$ext = strtolower(
|
||||
pathinfo($file["file_path"], PATHINFO_EXTENSION),
|
||||
);
|
||||
if (
|
||||
in_array($ext, ["jpg", "jpeg", "png", "gif"]) &&
|
||||
$file["file_type"] === "main"
|
||||
) {
|
||||
$coverImage = $file["file_path"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($coverImage): ?>
|
||||
<div class="card-image">
|
||||
<figure class="image ">
|
||||
<img src="<?= htmlspecialchars(
|
||||
$coverImage,
|
||||
) ?>" alt="Image preview">
|
||||
</figure>
|
||||
<?php
|
||||
// Get cover image from thesis_files if available
|
||||
$coverImage = null;
|
||||
if (!empty($item["id"])) {
|
||||
$files = $db->getThesisFiles($item["id"]);
|
||||
foreach ($files as $file) {
|
||||
$ext = strtolower(
|
||||
pathinfo($file["file_path"], PATHINFO_EXTENSION),
|
||||
);
|
||||
if (
|
||||
in_array($ext, ["jpg", "jpeg", "png", "gif"]) &&
|
||||
$file["file_type"] === "main"
|
||||
) {
|
||||
$coverImage = $file["file_path"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($coverImage): ?>
|
||||
<div class="card-image">
|
||||
<figure class="image ">
|
||||
<img src="<?= htmlspecialchars(
|
||||
$coverImage,
|
||||
) ?>" alt="Image preview">
|
||||
</figure>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card-content">
|
||||
<h4 class="title is-4">
|
||||
<?= htmlspecialchars($item["title"]) ?>
|
||||
</h4>
|
||||
<h2 class="subtitle">
|
||||
<?= htmlspecialchars($item["authors"] ?? "Auteur inconnu") ?>
|
||||
</h2>
|
||||
<h3 class="tag title is-6 is-link is-light">
|
||||
<?= htmlspecialchars($item["year"]) ?>
|
||||
</h3>
|
||||
<p class="block content">
|
||||
<?php
|
||||
$excerpt_length = 150;
|
||||
$synopsis = $item["synopsis"] ?? "";
|
||||
$description_excerpt =
|
||||
strlen($synopsis) > $excerpt_length
|
||||
? substr($synopsis, 0, $excerpt_length) . "..."
|
||||
: $synopsis;
|
||||
?>
|
||||
<?= htmlspecialchars($description_excerpt) ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card-content">
|
||||
<h4 class="title is-4">
|
||||
<?= htmlspecialchars($item["title"]) ?>
|
||||
</h4>
|
||||
<h2 class="subtitle">
|
||||
<?= htmlspecialchars($item["authors"] ?? "Auteur inconnu") ?>
|
||||
</h2>
|
||||
<h3 class="tag title is-6 is-link is-light">
|
||||
<?= htmlspecialchars($item["year"]) ?>
|
||||
</h3>
|
||||
<p class="block content">
|
||||
<?php
|
||||
$excerpt_length = 150;
|
||||
$synopsis = $item["synopsis"] ?? "";
|
||||
$description_excerpt =
|
||||
strlen($synopsis) > $excerpt_length
|
||||
? substr($synopsis, 0, $excerpt_length) . "..."
|
||||
: $synopsis;
|
||||
?>
|
||||
<?= htmlspecialchars($description_excerpt) ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</main>
|
||||
<?php include "inc/footer.php";
|
||||
?>
|
||||
<?php include "inc/footer.php"; ?>
|
||||
Reference in New Issue
Block a user