Move risky badge to right side

This commit is contained in:
Jonathon Leight
2026-07-07 21:01:39 -04:00
parent e0336f3a9a
commit 8a0f6cc0fd
+8 -5
View File
@@ -1,10 +1,13 @@
{{/* command-grid renders feature-grouped command checkboxes, shared by the
per-user share-commands page and the per-org limits modal. Data:
.Groups []commandGroup — each {Name, Commands[]commandChoice}
$.ShowAccess bool — when true, show the Members/Admins tier badge
Risky commands carry data-risky so ui.js confirms before enabling them, and
each group is a [data-check-scope] with Select all / none (ui.js delegated).
No inline JS, so it works when swapped into a modal via htmx under the CSP. */}}
$.ShowAccess bool — when true, also show the Members/Admins tier
badge (org limits); off for per-user shares.
Every command shows a red "Risky" badge when risky, in the same trailing slot,
so both pages read identically. Risky commands carry data-risky so ui.js
confirms before enabling them, and each group is a [data-check-scope] with
Select all / none (ui.js delegated). No inline JS, so it works when swapped
into a modal via htmx under the CSP. */}}
{{define "command-grid"}}
{{range .Groups}}
<div class="card mt-3" data-check-scope>
@@ -22,8 +25,8 @@
<span class="flex-fill">
<code>{{.Template}}</code>
{{if .Args}}<span class="text-secondary ms-1">{{.Args}}</span>{{end}}
{{if .Risky}}<span class="badge bg-warning-lt ms-1">risky</span>{{end}}
</span>
{{if .Risky}}<span class="badge bg-red-lt">Risky</span>{{end}}
{{if $.ShowAccess}}
{{if .MemberAllowed}}<span class="badge bg-azure-lt">Members</span>{{else}}<span class="badge bg-success-lt">Admins</span>{{end}}
{{end}}