From 26ae7c0cb78037adfccc8e8ffacd216b3c24d9b7 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Fri, 26 Jun 2026 14:32:05 -0400 Subject: [PATCH] Jun 26 - Update - Shift new/edit modal has separate website list by daily/weekly --- templates/admin/shifts.html | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/templates/admin/shifts.html b/templates/admin/shifts.html index 6ecf436..664dc8b 100644 --- a/templates/admin/shifts.html +++ b/templates/admin/shifts.html @@ -129,10 +129,28 @@
+ {% set daily_sites = all_sites | selectattr('check_type', 'equalto', 'daily') | list %} + {% set weekly_sites = all_sites | selectattr('check_type', 'equalto', 'weekly') | list %} + {% set other_sites = all_sites | rejectattr('check_type', 'in', ['daily','weekly']) | list %}
- {% for w in all_sites %} + {% if daily_sites %} +
Daily
+ {% for w in daily_sites %} {% endfor %} + {% endif %} + {% if weekly_sites %} +
Weekly
+ {% for w in weekly_sites %} + + {% endfor %} + {% endif %} + {% if other_sites %} +
Other
+ {% for w in other_sites %} + + {% endfor %} + {% endif %}
@@ -192,9 +210,18 @@ function buildShiftForm(s) { `).join(''); - const sites = ALL_SITES.map(w => ` - `).join(''); + const siteGroups = [ + { label: 'Daily', items: ALL_SITES.filter(w => w.check_type === 'daily') }, + { label: 'Weekly', items: ALL_SITES.filter(w => w.check_type === 'weekly') }, + { label: 'Other', items: ALL_SITES.filter(w => w.check_type !== 'daily' && w.check_type !== 'weekly') }, + ]; + const sites = siteGroups.filter(g => g.items.length).map(g => + `
${g.label}
` + + g.items.map(w => + `` + ).join('') + ).join(''); return `
@@ -238,6 +265,17 @@ function esc(s) { return (s||'').replace(/&/g,'&').replace(/"/g,'"').re