added events calendar

This commit is contained in:
2026-01-23 11:57:29 +01:00
parent e371ced1db
commit 59df30f672
2 changed files with 330 additions and 1 deletions
+115
View File
@@ -560,6 +560,121 @@ data:
# ---------- RIGHT COLUMN ----------
- size: small
widgets:
# Calendar Events Widget (Órák & Családi)
- type: custom-api
title: Next Events
cache: 5m
url: http://glance-helper.glance-system.svc.cluster.local:8000/calendar/events
parameters:
count: 10
days: 14
template: |
{{ $events := .JSON.Array "events" }}
{{ $count := len $events }}
{{ $showCount := 5 }}
{{ $hasMore := gt $count $showCount }}
<style>
.cal-widget { display: flex; flex-direction: column; gap: 6px; }
.cal-meta { opacity: .65; font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
.cal-empty { opacity: 0.5; font-size: 13px; padding: 8px 0; }
.cal-list { display: flex; flex-direction: column; gap: 4px; }
.cal-item {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px;
padding: 8px 10px;
border-radius: 8px;
background: rgba(255,255,255,0.04);
align-items: start;
}
.cal-item:hover { background: rgba(255,255,255,0.08); }
.cal-title {
font-weight: 600;
opacity: 0.95;
font-size: 13px;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
}
.cal-source {
font-size: 10px;
opacity: 0.5;
margin-top: 2px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.cal-time {
font-size: 12px;
opacity: 0.7;
text-align: right;
white-space: nowrap;
line-height: 1.4;
}
.cal-date { font-weight: 600; }
.cal-hour { opacity: 0.8; }
.cal-allday {
font-size: 10px;
opacity: 0.6;
text-transform: uppercase;
}
/* Collapse/expand styling */
.cal-hidden { display: none; }
.cal-toggle {
font-size: 12px;
opacity: 0.6;
cursor: pointer;
text-align: center;
padding: 6px;
border-radius: 6px;
margin-top: 4px;
}
.cal-toggle:hover { opacity: 0.9; background: rgba(255,255,255,0.05); }
#cal-expand:checked ~ .cal-list .cal-extra { display: grid; }
#cal-expand:checked ~ .cal-toggle-more { display: none; }
#cal-expand:not(:checked) ~ .cal-toggle-less { display: none; }
</style>
<div class="cal-widget">
<div class="cal-meta">
<span>Next events ({{ $count }})</span>
</div>
{{ if lt $count 1 }}
<div class="cal-empty">No event in near future.</div>
{{ else }}
{{ if $hasMore }}<input type="checkbox" id="cal-expand" style="display:none;">{{ end }}
<div class="cal-list">
{{ range $i, $e := $events }}
{{ $isExtra := ge $i $showCount }}
{{ $start := $e.String "start" }}
{{ $isAllDay := $e.Bool "is_all_day" }}
{{ $calendar := $e.String "calendar" }}
{{ $title := $e.String "title" }}
<div class="cal-item{{ if $isExtra }} cal-extra cal-hidden{{ end }}">
<div>
<div class="cal-title">{{ $title }}</div>
<div class="cal-source">{{ $calendar }}</div>
</div>
<div class="cal-time">
<div class="cal-date">{{ formatTime $start "Jan 2" }}</div>
{{ if $isAllDay }}
<div class="cal-allday">Whole Day</div>
{{ else }}
<div class="cal-hour">{{ formatTime $start "15:04" }}</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ if $hasMore }}
<label class="cal-toggle cal-toggle-more" for="cal-expand">Show More ({{ sub $count $showCount }} további) ▼</label>
<label class="cal-toggle cal-toggle-less" for="cal-expand">Show Less ▲</label>
{{ end }}
{{ end }}
</div>
- type: rss
title: News & Feeds
limit: 15