3eacb6c326
- templates/app_row.html: app_list_row/app_list_row_end (layout_start/_end idiom) — icon+name (+optional secondary) left, caller action block right; compact 44px row; logoURL→PNG→ optional FallbackIcon→hidden onerror chain - applied: Távoli mentés toggle list, Visszaállítás restore-to-verify + .fab lists, dashboard Telepített alkalmazások (state edge + data-href preserved); Alkalmazások collapsed headers ALIGNED (icon+name left, status dot moved right before chevron; expander untouched) - funcmap: dict + appHref; OffboxAppRow/AppBackupRow gain Slug - style.css: .app-row family; stack-card/stack-info/stack-logo/stack-name/stack-desc/ stack-actions rules retired (dashboard rows now shared); .app-backup-row-header matched to the shared row height - scripts/app_row_dedup_gate.py: row markup single-sourced (red-proven: pasted old storage-path-item block → exit 1); render tests per surface (app_row_test.go) - NO behavior change: toggle/download/expander actions byte-identical
31 lines
1.6 KiB
HTML
31 lines
1.6 KiB
HTML
{{/* app_list_row / app_list_row_end — THE canonical app-list row (v0.126.0).
|
|
One grammar on every list surface: icon + name (+ optional one-line secondary) left,
|
|
caller-provided action block right. A row without a secondary line stays compact.
|
|
|
|
Usage (the layout_start/layout_end idiom):
|
|
{{template "app_list_row" dict "Slug" .Slug "Name" .DisplayName}}
|
|
...caller action buttons / status...
|
|
{{template "app_list_row_end"}}
|
|
|
|
dict keys: Slug (icon lookup), Name, Secondary (optional one-liner),
|
|
RowClass (optional extra row class, e.g. stack-state-run), Href (optional data-href),
|
|
FallbackIcon (optional last-resort icon URL — infra stacks pass the generic infra SVG).
|
|
|
|
Do NOT hand-roll app rows — scripts/app_row_dedup_gate.py asserts this markup exists
|
|
here ONCE (the backups_apps expander header is the single allowlisted aligned copy). */}}
|
|
{{define "app_list_row"}}
|
|
<div class="app-row{{with .RowClass}} {{.}}{{end}}"{{with .Href}} data-href="{{.}}"{{end}}>
|
|
<img class="app-row-icon" src="{{logoURL .Slug}}" alt=""{{with .FallbackIcon}} data-fallback="{{.}}"{{end}}
|
|
onerror="if(!this.dataset.step){this.dataset.step='1';this.src='{{logoPNGURL .Slug}}';}else if(this.dataset.fallback&&this.dataset.step==='1'){this.dataset.step='2';this.src=this.dataset.fallback;}else{this.onerror=null;this.style.visibility='hidden';}">
|
|
<div class="app-row-text">
|
|
<span class="app-row-name">{{.Name}}</span>
|
|
{{with .Secondary}}<span class="app-row-secondary">{{.}}</span>{{end}}
|
|
</div>
|
|
<div class="app-row-actions">
|
|
{{end}}
|
|
|
|
{{define "app_list_row_end"}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|