Compare commits

...

1 Commits

Author SHA1 Message Date
giles
125c9bd64a refactor: make calendar header and nav cross-service (events_url)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 11:55:09 +00:00
2 changed files with 8 additions and 13 deletions

View File

@@ -1,17 +1,12 @@
<!-- Desktop nav -->
{% import 'macros/links.html' as links %}
{% call links.link(
url_for('blog.post.calendars.calendar.slots.get', slug=post.slug, calendar_slug=calendar.slug),
hx_select_search,
select_colours,
aclass=styles.nav_button
) %}
<a href="{{ events_url('/' + post.slug + '/calendars/' + calendar.slug + '/slots/') }}" class="{{styles.nav_button}}">
<i class="fa fa-clock" aria-hidden="true"></i>
<div>
Slots
</div>
{% endcall %}
<div>Slots</div>
</a>
{% if g.rights.admin %}
{% from 'macros/admin_nav.html' import admin_nav_item %}
{{admin_nav_item(url_for('blog.post.calendars.calendar.admin.admin', slug=post.slug, calendar_slug=calendar.slug))}}
<a href="{{ events_url('/' + post.slug + '/calendars/' + calendar.slug + '/admin/') }}" class="{{styles.nav_button}}">
<i class="fa fa-cog" aria-hidden="true"></i>
</a>
{% endif %}

View File

@@ -1,7 +1,7 @@
{% import 'macros/links.html' as links %}
{% macro header_row(oob=False) %}
{% call links.menu_row(id='calendar-row', oob=oob) %}
{% call links.link(url_for('blog.post.calendars.calendar.get', slug=post.slug, calendar_slug= calendar.slug), hx_select_search) %}
<a href="{{ events_url('/' + post.slug + '/calendars/' + calendar.slug + '/') }}" class="flex items-center gap-2 px-3 py-2 rounded whitespace-normal text-center break-words leading-snug">
<div class="flex flex-col md:flex-row md:gap-2 items-center min-w-0">
<div class="flex flex-row items-center gap-2">
<i class="fa fa-calendar"></i>
@@ -12,7 +12,7 @@
{% from '_types/calendar/_description.html' import description %}
{{description(calendar)}}
</div>
{% endcall %}
</a>
{% call links.desktop_nav() %}
{% include '_types/calendar/_nav.html' %}
{% endcall %}