updated tandoor widget and helper code

This commit is contained in:
2026-01-22 17:35:32 +01:00
parent a1f861b0b2
commit a3b06f5e5e
2 changed files with 165 additions and 33 deletions
+7 -4
View File
@@ -783,6 +783,7 @@ data:
url: http://glance-helper.glance-system.svc.cluster.local:8000/tandoor/daily
parameters:
count: 3
cooldown: 14 # Optional: override default cooldown days
options:
tandoor_url: https://tandoor.dooplex.hu
@@ -798,15 +799,16 @@ data:
.mw-meta { opacity:.65; font-size:12px; display:flex; justify-content:space-between; align-items:center; }
.mw-box { position:relative; border-radius:14px; background:rgba(255,255,255,0.04); box-shadow:0 0 0 1px rgba(255,255,255,0.06) inset; overflow:hidden; }
.mw-box input { display:none; }
.mw-track { display:flex; transition:transform 0.3s ease; }
.mw-track { display:flex; }
.mw-s { min-width:100%; flex-shrink:0; }
.mw-img { height:150px; background:rgba(0,0,0,0.15); overflow:hidden; }
.mw-img img { width:100%; height:100%; object-fit:cover; }
.mw-noimg { height:150px; display:flex; align-items:center; justify-content:center; opacity:.5; font-size:12px; }
.mw-name { padding:10px 12px 6px; font-weight:700; opacity:.95; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mw-name { padding:10px 12px 4px; font-weight:700; opacity:.95; line-height:1.3; }
.mw-stats { padding:0 12px 6px; font-size:11px; opacity:.5; }
.mw-acts { padding:0 12px 10px; display:flex; gap:10px; opacity:.8; font-size:12px; }
.mw-acts a, .mw-link { text-decoration:none; color:inherit; display:block; }
/* Arrows - hidden by default, shown on hover */
/* Arrows */
.mw-p, .mw-n { position:absolute; top:75px; transform:translateY(-50%); width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,0.6); color:#fff; align-items:center; justify-content:center; font-size:11px; cursor:pointer; z-index:5; display:none; }
.mw-p { left:6px; }
.mw-n { right:6px; }
@@ -833,12 +835,13 @@ data:
<div class="mw-box">
{{ range $i, $_ := $items }}<input type="radio" name="mr" id="mr{{ $i }}"{{ if eq $i 0 }} checked{{ end }}>{{ end }}
<div class="mw-track">
{{ range $r := $items }}{{ $img := $r.String "image" }}{{ $url := $r.String "url" }}{{ $cook := $r.String "cook_url" }}
{{ range $r := $items }}{{ $img := $r.String "image" }}{{ $url := $r.String "url" }}{{ $cook := $r.String "cook_url" }}{{ $cooked := $r.Int "cooked_count" }}
<div class="mw-s">
<a class="mw-link" href="{{ $url }}" target="_blank">
<div class="mw-img">{{ if $img }}<img src="{{ $img }}" alt="">{{ else }}<div class="mw-noimg">No image</div>{{ end }}</div>
<div class="mw-name">{{ $r.String "name" }}</div>
</a>
{{ if gt $cooked 0 }}<div class="mw-stats">Cooked {{ $cooked }}× before</div>{{ end }}
<div class="mw-acts"><a href="{{ $url }}" target="_blank">Open</a> <a href="{{ $cook }}" target="_blank">Cooked today ✔</a></div>
</div>
{{ end }}