mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
style: normalize headers, overtype editor rounded corners, remove duplicate cover preview, thesis-add-header grid layout, subtitle below header with top gradient
This commit is contained in:
@@ -30,32 +30,19 @@ $adminMode = $adminMode ?? false;
|
||||
<fieldset class="licence-explanation">
|
||||
<legend>Degrés d'ouverture et licences</legend>
|
||||
|
||||
<!-- Généralités -->
|
||||
<div class="licence-generalites">
|
||||
<h3>Généralités</h3>
|
||||
<?php if ($generalitiesHtml): ?>
|
||||
<div class="form-help-editable"><?= $generalitiesHtml ?></div>
|
||||
<?php else: ?>
|
||||
<ul>
|
||||
<li>L'auteur·ice peut décider entre trois degrés de partage de son travail : <strong>libre</strong>, <strong>interne</strong>, <strong>interdit</strong>.</li>
|
||||
<li>L'auteur·ice peut, à tout moment, décider de <strong>restreindre</strong> le degré d'accès à son travail. Il ne peut néanmoins pas l'ouvrir davantage.</li>
|
||||
<li>Le choix effectué dans ce formulaire sera d'application <strong>une semaine après la soutenance orale</strong> de l'auteur·ice. Celui-ci peut donc décider de restreindre ce choix avant sa publication (mais pas l'ouvrir).</li>
|
||||
<li>L'erg se réserve le droit de restreindre le degré d'ouverture du TFE – ce en accord avec le règlement.</li>
|
||||
<li>Dans tous les cas, l'auteur·ice garde les droits d'auteurs, de diffusion, d'utilisation, etc. de son travail – sauf si la licence choisie restreindrait ses droits.</li>
|
||||
<li>La diffusion « xamxam » est indépendante de la diffusion à la BAIU.</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Degré d'ouverture -->
|
||||
<div class="licence-choice">
|
||||
<h3>J'autorise l'erg à archiver mon TFE de la manière suivante :</h3>
|
||||
<p class="licence-prompt">J'autorise l'erg à archiver mon TFE de la manière suivante :</p>
|
||||
<?php $selectedAccess = $formData['access_type_id'] ?? (string)$defaultAccessTypeId; ?>
|
||||
|
||||
<?php if ($libreEnabled): ?>
|
||||
<div class="licence-degree">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="radio" name="access_type_id" value="1"
|
||||
hx-post="<?= $adminMode ? '/admin/licence-fragment.php' : '/partage/licence-fragment' ?>"
|
||||
hx-target=".licence-license-choice"
|
||||
hx-swap="outerHTML"
|
||||
hx-include="closest fieldset"
|
||||
<?= $selectedAccess === '1' ? 'checked' : '' ?> <?= $adminMode ? '' : 'required' ?>>
|
||||
<strong>🔓 Libre</strong> — Mon TFE est en libre accès à tout le monde sur la plateforme des TFE ainsi que dans la bibliothèque de l'erg.
|
||||
</label>
|
||||
@@ -66,6 +53,10 @@ $adminMode = $adminMode ?? false;
|
||||
<div class="licence-degree">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="radio" name="access_type_id" value="2"
|
||||
hx-post="<?= $adminMode ? '/admin/licence-fragment.php' : '/partage/licence-fragment' ?>"
|
||||
hx-target=".licence-license-choice"
|
||||
hx-swap="outerHTML"
|
||||
hx-include="closest fieldset"
|
||||
<?= $selectedAccess === '2' ? 'checked' : '' ?> <?= $adminMode ? '' : 'required' ?>>
|
||||
<strong>🔒 Interne</strong> — Mon TFE n'est accessible que sur place en physique. Une note descriptive est disponible sur le site.
|
||||
</label>
|
||||
@@ -76,6 +67,10 @@ $adminMode = $adminMode ?? false;
|
||||
<div class="licence-degree">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="radio" name="access_type_id" value="3"
|
||||
hx-post="<?= $adminMode ? '/admin/licence-fragment.php' : '/partage/licence-fragment' ?>"
|
||||
hx-target=".licence-license-choice"
|
||||
hx-swap="outerHTML"
|
||||
hx-include="closest fieldset"
|
||||
<?= $selectedAccess === '3' ? 'checked' : '' ?> <?= $adminMode ? '' : 'required' ?>>
|
||||
<strong>🚫 Interdit</strong> — Mon TFE n'est pas disponible en physique ni sur le site. Une note descriptive est disponible sur le site.
|
||||
</label>
|
||||
@@ -84,29 +79,11 @@ $adminMode = $adminMode ?? false;
|
||||
<p class="licence-note"><em>L'auteur·ice peut, à tout moment, décider de restreindre son propre choix. Iel ne peut par contre pas l'ouvrir.</em></p>
|
||||
</div>
|
||||
|
||||
<!-- Licence -->
|
||||
<div class="licence-license-choice">
|
||||
<h3>Licence du TFE</h3>
|
||||
<?php
|
||||
$name = 'license_id'; $label = 'Licence :'; $options = $licenseTypes;
|
||||
$selected = $formData['license_id'] ?? ''; $placeholder = '— Sélectionner —'; $required = !$adminMode;
|
||||
include APP_ROOT . '/templates/partials/form/select-field.php';
|
||||
?>
|
||||
|
||||
<?php
|
||||
$name = 'license_custom'; $label = 'Ou précisez une autre licence :';
|
||||
$value = htmlspecialchars($formData['license_custom'] ?? '');
|
||||
$hint = 'Ex: CC BY-NC 4.0, Tous droits réservés...';
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
|
||||
<div class="admin-form-group">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="checkbox" name="cc2r" value="1"
|
||||
<?= !empty($formData['cc2r']) ? 'checked' : '' ?>>
|
||||
J'accepte les Conditions Collectives de Réutilisation (CC2r)
|
||||
</label>
|
||||
<small><a href="https://cc2r.net/" target="_blank" rel="noopener">En savoir plus sur la CC2r ↗</a></small>
|
||||
</div>
|
||||
<!-- Licence — swapped via htmx when radio changes -->
|
||||
<div class="licence-license-choice"
|
||||
hx-post="<?= $adminMode ? '/admin/licence-fragment.php' : '/partage/licence-fragment' ?>"
|
||||
hx-trigger="load"
|
||||
hx-include="closest fieldset"
|
||||
hx-swap="outerHTML">
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*
|
||||
* Variables consumed:
|
||||
* string $helpContent — raw Markdown string from the DB (may be empty).
|
||||
* string $helpKey — block key, used as element id.
|
||||
*
|
||||
* Outputs nothing when $helpContent is empty or whitespace-only.
|
||||
* Parsedown must already be autoloaded (it is, via bootstrap → APP_ROOT/src/).
|
||||
@@ -19,7 +20,7 @@ $pd = new Parsedown();
|
||||
$pd->setSafeMode(true);
|
||||
$html = $pd->text($helpContent);
|
||||
?>
|
||||
<div class="form-help-block">
|
||||
<div class="student-help-block" id="help-<?= htmlspecialchars($helpKey ?? 'unknown') ?>">
|
||||
<?= $html ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -102,6 +102,7 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
<?php if ($showIntroHelp && isset($helpFn)): ?>
|
||||
<?php
|
||||
$helpContent = $helpFn("partage_intro");
|
||||
$helpKey = 'partage_intro';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
?>
|
||||
<?php endif; ?>
|
||||
@@ -146,6 +147,7 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_tfe_info");
|
||||
$helpKey = 'fieldset_tfe_info';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
include APP_ROOT . "/templates/partials/form/fieldset-tfe-info.php";
|
||||
@@ -170,6 +172,13 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- ═══════════════════ Langue(s) ═══════════════════ -->
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_languages");
|
||||
$helpKey = 'fieldset_languages';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
?>
|
||||
<fieldset id="languages-fieldset">
|
||||
<legend>Langue(s)</legend>
|
||||
<?php
|
||||
@@ -205,6 +214,13 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
</fieldset>
|
||||
|
||||
<!-- ═══════════════════ Mots-clés ═══════════════════ -->
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_keywords");
|
||||
$helpKey = 'fieldset_keywords';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
?>
|
||||
<fieldset>
|
||||
<legend>Mots-clés</legend>
|
||||
<?php
|
||||
@@ -219,13 +235,20 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
</fieldset>
|
||||
|
||||
<!-- ═══════════════════ Cadre académique ═══════════════════ -->
|
||||
<?php include APP_ROOT .
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_academic");
|
||||
$helpKey = 'fieldset_academic';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
include APP_ROOT .
|
||||
"/templates/partials/form/fieldset-academic.php"; ?>
|
||||
|
||||
<!-- ═══════════════════ Composition du jury ═══════════════════ -->
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_jury");
|
||||
$helpKey = 'fieldset_jury';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
require APP_ROOT . "/templates/partials/form/jury-fieldset.php";
|
||||
@@ -238,6 +261,7 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
// Synthesise POST-like data so fichiers-fragment.php can render the initial state.
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_files");
|
||||
$helpKey = 'fieldset_files';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
// Temporarily populate $_POST so the fragment can read formats/website/annexes values.
|
||||
@@ -260,6 +284,8 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
$_POST['website_url'] = $existingWebsiteUrl;
|
||||
$_POST['website_label'] = $existingWebsiteLabel;
|
||||
$_POST['admin_mode'] = $adminMode ? '1' : '0';
|
||||
$_POST['edit_mode'] = '1';
|
||||
$_POST['_cover'] = $currentCover['file_path'] ?? null;
|
||||
$_POST['has_annexes'] = $formData['has_annexes'] ?? null;
|
||||
include APP_ROOT . '/public/partage/fichiers-fragment.php';
|
||||
$_POST = $_savedPost;
|
||||
@@ -268,29 +294,6 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
|
||||
<!-- Edit-only: existing files management -->
|
||||
<div id="edit-existing-files-block">
|
||||
<!-- Cover image -->
|
||||
<div class="admin-form-group">
|
||||
<label>Image de couverture :</label>
|
||||
<div class="admin-file-input">
|
||||
<?php if (!empty($currentCover)): ?>
|
||||
<div class="admin-banner-preview">
|
||||
<img src="/media?path=<?= urlencode(
|
||||
$currentCover["file_path"],
|
||||
) ?>"
|
||||
alt="Couverture actuelle" style="max-height:180px;">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="checkbox" name="remove_cover" value="1"> Supprimer la couverture
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<input type="file" id="couverture" name="couverture" accept="image/jpeg,image/png,image/webp" data-preview="fp-couverture">
|
||||
<div id="fp-couverture" class="file-preview-list" aria-live="polite"></div>
|
||||
<small><?= empty($currentCover)
|
||||
? "JPG, PNG ou WEBP. Format 4:3 recommandé. Max 20 MB."
|
||||
: "Laisser vide pour conserver la couverture actuelle. JPG, PNG ou WEBP. Max 20 MB." ?></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Existing thesis files — sortable, with labels -->
|
||||
<?php $thesisFilesList = array_values(
|
||||
array_filter(
|
||||
@@ -398,13 +401,20 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- ═══════════════════ Métadonnées complémentaires ═══════════════════ -->
|
||||
<?php include APP_ROOT .
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_metadata");
|
||||
$helpKey = 'fieldset_metadata';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
include APP_ROOT .
|
||||
"/templates/partials/form/fieldset-metadata.php"; ?>
|
||||
|
||||
<!-- ═══════════════════ Degrés d'ouverture et licences ═══════════════════ -->
|
||||
<?php
|
||||
if ($mode === "partage" && isset($helpFn)) {
|
||||
$helpContent = $helpFn("fieldset_access");
|
||||
$helpKey = 'fieldset_access';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
}
|
||||
include APP_ROOT .
|
||||
@@ -509,6 +519,7 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
|
||||
<?php if ($mode === "partage" && isset($helpFn)): ?>
|
||||
<?php
|
||||
$helpContent = $helpFn("fieldset_email");
|
||||
$helpKey = 'fieldset_email';
|
||||
include APP_ROOT . "/templates/partials/form/form-help-block.php";
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user