Template
Feat(site): miniature de la première image du paquet dans le menu déroulant
This commit is contained in:
1 parent
8a7e83cd01
commit
6adebf4c97
2 files changed
+29
-3
No files matched your search
@@ -87,6 +87,26 @@
|
||||
transition: background 120ms ease, color 120ms ease;
|
||||
}
|
||||
|
||||
/* Item avec miniature (première image du paquet) */
|
||||
.nav-dropdown-item.has-thumb {
|
||||
grid-template-columns: auto 1fr;
|
||||
align-items: center;
|
||||
gap: 0.55rem;
|
||||
}
|
||||
.nav-dropdown-thumb {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
border: 1px solid var(--border);
|
||||
display: block;
|
||||
}
|
||||
.nav-dropdown-text {
|
||||
display: grid;
|
||||
gap: 0.15rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.nav-dropdown-item:hover,
|
||||
.nav-dropdown-item:focus-visible {
|
||||
background: var(--accent-bg);
|
||||
|
||||
@@ -173,9 +173,15 @@ function fws_site_active(string $route, string $prefix): string
|
||||
<p class="nav-dropdown-error">Aucun paquet pour le moment.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($packages as $i => $pkg): ?>
|
||||
<a class="nav-dropdown-item" href="/?p/paquets/<?= max($i + 1, (int) $pkg['dbId']) ?>/">
|
||||
<strong><?= e($pkg['name']) ?><?php if (!empty($pkg['latest']['name'])): ?><span class="nav-dropdown-version"><?= e($pkg['latest']['name']) ?></span><?php endif; ?></strong>
|
||||
<small><?= e($pkg['tagline'] ?? '') ?></small>
|
||||
<?php $navThumb = (string) ($pkg['screens'][0]['src'] ?? ''); ?>
|
||||
<a class="nav-dropdown-item<?= $navThumb !== '' ? ' has-thumb' : '' ?>" href="/?p/paquets/<?= max($i + 1, (int) $pkg['dbId']) ?>/">
|
||||
<?php if ($navThumb !== ''): ?>
|
||||
<img class="nav-dropdown-thumb" src="<?= e($navThumb) ?>" alt="" loading="lazy" width="30" height="30">
|
||||
<?php endif; ?>
|
||||
<span class="nav-dropdown-text">
|
||||
<strong><?= e($pkg['name']) ?><?php if (!empty($pkg['latest']['name'])): ?><span class="nav-dropdown-version"><?= e($pkg['latest']['name']) ?></span><?php endif; ?></strong>
|
||||
<small><?= e($pkg['tagline'] ?? '') ?></small>
|
||||
</span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in new issue
Block a user