themes-coffee/blocks/hours_strip.ninjatpl
Alex Dunmow 9680039b39 fix: restore hours_strip today-highlight via context.now weekday (WO-WZ-021)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 15:39:18 +08:00

14 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% if context.now %}{% set today = context.now|date:"D"|lower %}{% endif %}
<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">
{% 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 %}
<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>
{% 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>
</li>
{% endfor %}
</ul>
</aside>