Migrate all <img>-based icons to inline SVG via PHP helper

Replace every <img src="/assets/icons/..."> with <?= icon('name') ?>
across 26 template files. The PHP helper inlines the SVG markup into the
DOM so CSS color cascades naturally through fill="currentColor".

- Add src/icon.php helper: reads SVG file, sets width/height to 1em,
  injects aria-hidden, supports optional CSS class
- Fix 12 icon SVGs that had hardcoded fill="#000000" or missing fill attr
- Replace search.svg with Phosphor fill-based magnifying glass
- Add explicit SVG sizes for admin header nav icons (16px/20px)
- Scope public search icon CSS to form[role=search]:not(.header-search-form)
  to avoid breaking admin header layout; change stroke to fill
- Remove <img> filter: brightness(0) invert(1) hacks from admin.css
This commit is contained in:
Pontoporeia
2026-06-21 17:23:37 +02:00
parent b1774e6e97
commit dfde88eaa5
42 changed files with 166 additions and 108 deletions

View File

@@ -45,7 +45,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
<div id="tmp-cleanup-stats-wrapper">
<details class="n-section" open>
<summary>
<img src="/assets/icons/paint-brush-household.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('paint-brush-household') ?>
Fichiers temporaires
</summary>
<p style="margin:0;color:var(--accent-green)">✓ Aucun fichier temporaire.</p>
@@ -56,13 +56,13 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
<div id="tmp-cleanup-stats-wrapper">
<details class="n-section" open>
<summary>
<img src="/assets/icons/paint-brush-household.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('paint-brush-household') ?>
Fichiers temporaires <span class="n-meta"><?= htmlspecialchars($summaryMeta) ?></span>
</summary>
<?php if ($fpStale > 0): ?>
<p class="n-heading">
<img src="/assets/icons/paint-brush-household.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('paint-brush-household') ?>
Téléversements abandonnés
</p>
<table class="n-table">
@@ -80,7 +80,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
hx-target="#tmp-cleanup-stats-wrapper"
hx-swap="outerHTML"
hx-indicator="#tmp-cleanup-stats-wrapper">
<img src="/assets/icons/trash.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('trash') ?>
Supprimer
</button>
</td>
@@ -92,7 +92,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
<?php if ($trStale > 0): ?>
<p class="n-heading">
<img src="/assets/icons/trash.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('trash') ?>
Corbeille
</p>
<table class="n-table">
@@ -110,7 +110,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
hx-target="#tmp-cleanup-stats-wrapper"
hx-swap="outerHTML"
hx-indicator="#tmp-cleanup-stats-wrapper">
<img src="/assets/icons/trash.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('trash') ?>
Supprimer
</button>
</td>

View File

@@ -20,7 +20,7 @@ if (!($d['configured'] ?? false)): ?>
<div id="peertube-orphans-wrapper">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<img src="/assets/icons/video.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('video') ?>
Vidéos PeerTube orphelines
</summary>
<div id="peertube-orphans-stats">
@@ -34,7 +34,7 @@ if (!($d['configured'] ?? false)): ?>
<div id="peertube-orphans-wrapper">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<img src="/assets/icons/video.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('video') ?>
Vidéos PeerTube orphelines
</summary>
<div id="peertube-orphans-stats">
@@ -47,7 +47,7 @@ if (!($d['configured'] ?? false)): ?>
<div id="peertube-orphans-wrapper">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<img src="/assets/icons/video.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('video') ?>
Vidéos PeerTube orphelines <span class="n-meta"><?= (int)($d['orphan_count'] ?? 0) ?> vidéos orphelines</span>
</summary>
<div id="peertube-orphans-stats">
@@ -70,7 +70,7 @@ if (!($d['configured'] ?? false)): ?>
hx-swap="outerHTML"
hx-trigger="click"
hx-indicator="#peertube-orphans-wrapper">
<img src="/assets/icons/trash.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('trash') ?>
Supprimer
</button>
</td>
@@ -87,7 +87,7 @@ if (!($d['configured'] ?? false)): ?>
<?php if (($d['stale_count'] ?? 0) > 0): ?>
<details id="peertube-stale-section" class="n-section" open>
<summary>
<img src="/assets/icons/warning-diamond.svg" width="14" height="14" alt="" aria-hidden="true">
<?= icon('warning-diamond') ?>
Références DB obsolètes <span class="n-meta"><?= $d['stale_count'] ?></span>
</summary>
<p style="margin:0 0 var(--space-sm) 0;font-size:0.85em;color:var(--text-secondary)">Ces UUID sont référencés en base de données mais n'existent plus sur la chaîne PeerTube. Les TFE liés affichent des liens morts.</p>