fix: restore hours_strip today-highlight via context.now weekday (WO-WZ-021)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-07-04 15:39:18 +08:00
parent 1a6cc30202
commit 9680039b39

View File

@ -1,9 +1,11 @@
{% if context.now %}{% set today = context.now|date:"D"|lower %}{% endif %}
<aside data-block="coffee:hours_strip" class="my-4"> <aside data-block="coffee:hours_strip" class="my-4">
<ul class="coffee-card grid grid-cols-1 sm:grid-cols-2 md:grid-cols-7 gap-1 p-2 max-w-5xl mx-auto"> <ul class="coffee-card grid grid-cols-1 sm:grid-cols-2 md:grid-cols-7 gap-1 p-2 max-w-5xl mx-auto">
{% if not hours %}<li class="coffee-body text-sm text-muted-foreground italic px-3 py-2 col-span-full text-center">Add weekday hours to display the strip.</li>{% endif %} {% if not hours %}<li class="coffee-body text-sm text-muted-foreground italic px-3 py-2 col-span-full text-center">Add weekday hours to display the strip.</li>{% endif %}
{% for row in hours %} {% for row in hours %}
<li class="coffee-body px-2 py-1 flex items-baseline gap-2 text-sm rounded-sm "> <li class="coffee-body px-2 py-1 flex items-baseline gap-2 text-sm rounded-sm {% if row.day and row.day|lower|slice:":3" == today %}coffee-hours-today is-today today{% endif %}">
<span class="coffee-display font-semibold text-foreground w-12 shrink-0">{{ row.day }}</span> <span class="coffee-display font-semibold text-foreground w-12 shrink-0">{{ row.day }}</span>
{% if row.day and row.day|lower|slice:":3" == today %}<span class="coffee-body text-[10px] uppercase tracking-wider text-accent">{{ todayLabel|default:"Today" }}</span>{% endif %}
<span class="coffee-mono text-foreground">{% if row.open or row.close %}{{ row.open }} {{ row.close }}{% else %}Closed{% endif %}</span> <span class="coffee-mono text-foreground">{% if row.open or row.close %}{{ row.open }} {{ row.close }}{% else %}Closed{% endif %}</span>
</li> </li>
{% endfor %} {% endfor %}