Admin licenses : bouton BÊTA visible directement, plus dans un menu replié
Avant : pour basculer l'accès BÊTA d'un client, il fallait deviner qu'il fallait cliquer sur le code <channel> dans la cellule pour ouvrir un <details> caché — pas de chevron, pas de label « modifier ». L'admin trouvait pas l'option et pensait qu'elle n'existait pas. Après : sur la page Licenses, chaque ligne affiche directement deux boutons cliquables : - « Activer BÊTA » / « ✓ BÊTA actif » (bouton secondary / warning selon l'état) — toggle en un clic sans menu - « ✎ Channel » qui déplie le dropdown pour changer le channel L'état actuel reste visible au-dessus (code du channel + badge β BÊTA si actif). Beaucoup plus discoverable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -293,21 +293,41 @@ Layout::header('Licenses', 'licenses');
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<details style="display: inline-block;">
|
||||
<summary style="cursor: pointer; list-style: none;">
|
||||
<code style="background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-size: 11px;">
|
||||
<!-- Affichage de l'état actuel : channel + badge BÊTA si actif -->
|
||||
<div style="margin-bottom: 6px;">
|
||||
<code style="background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-size: 11px;"
|
||||
title="Channel actuellement attribué à cette license">
|
||||
<?= htmlspecialchars($l['channel'] ?? 'default') ?>
|
||||
</code>
|
||||
<?php if ((int)($l['can_see_betas'] ?? 0) === 1): ?>
|
||||
<span class="badge badge-warning" style="margin-left: 4px;" title="Voit les versions taggées beta">β</span>
|
||||
<span class="badge badge-warning" style="margin-left: 4px;" title="Voit les versions taggées beta">β BÊTA</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Toggle BÊTA en bouton DIRECTEMENT visible (pas dans un details).
|
||||
L'admin n'a plus à deviner qu'il faut cliquer sur le code du channel
|
||||
pour trouver l'option. -->
|
||||
<form method="post" style="display: inline-block; margin-right: 4px;">
|
||||
<?= Layout::csrfField() ?>
|
||||
<input type="hidden" name="action" value="toggle_betas">
|
||||
<input type="hidden" name="id" value="<?= $l['id'] ?>">
|
||||
<button class="btn <?= (int)($l['can_see_betas'] ?? 0) === 1 ? 'btn-warning' : 'btn-secondary' ?>"
|
||||
type="submit" style="font-size: 11px; padding: 4px 10px;"
|
||||
title="Bascule l'accès aux versions taggées BÊTA pour cette license">
|
||||
<?= (int)($l['can_see_betas'] ?? 0) === 1 ? '✓ BÊTA actif' : 'Activer BÊTA' ?>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Channel : modifier via un menu compact -->
|
||||
<details style="display: inline-block;">
|
||||
<summary class="btn btn-secondary" style="font-size: 11px; padding: 4px 10px; list-style: none;">
|
||||
✎ Channel
|
||||
</summary>
|
||||
<div style="margin-top: 8px; min-width: 220px;">
|
||||
<form method="post" style="display: flex; gap: 4px; align-items: center; margin-bottom: 6px;">
|
||||
<form method="post" style="margin-top: 8px; display: flex; gap: 4px; align-items: center;">
|
||||
<?= Layout::csrfField() ?>
|
||||
<input type="hidden" name="action" value="set_channel">
|
||||
<input type="hidden" name="id" value="<?= $l['id'] ?>">
|
||||
<select name="channel" style="flex: 1;">
|
||||
<select name="channel" style="min-width: 160px;">
|
||||
<?php foreach ($availableChannels as $value => $label):
|
||||
$selected = ($l['channel'] ?? '') === $value ? 'selected' : '';
|
||||
?>
|
||||
@@ -316,15 +336,6 @@ Layout::header('Licenses', 'licenses');
|
||||
</select>
|
||||
<button class="btn btn-primary" type="submit">OK</button>
|
||||
</form>
|
||||
<form method="post">
|
||||
<?= Layout::csrfField() ?>
|
||||
<input type="hidden" name="action" value="toggle_betas">
|
||||
<input type="hidden" name="id" value="<?= $l['id'] ?>">
|
||||
<button class="btn btn-secondary" type="submit" style="width: 100%;">
|
||||
<?= (int)($l['can_see_betas'] ?? 0) === 1 ? 'Retirer accès BÊTA' : 'Activer accès BÊTA' ?>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</td>
|
||||
<td><span class="badge <?= $cls ?>"><?= $status ?></span></td>
|
||||
|
||||
Reference in New Issue
Block a user