salvi/templates/month.jinja2

50 lines
No EOL
1.7 KiB
Django/Jinja
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.

{% extends "base.jinja2" %}
{% block title %}{{ d.strftime("%B %Y") }} {{ app_name }}{% endblock %}
{% block content %}
<main>
<h1 id="firstHeading">{{ d.strftime("%B %Y") }}</h1>
<div class="inner-content">
{% if total_count > 0 %}
{% from "macros/nl.jinja2" import nl_list with context %}
{{ nl_list(notes, total_count=total_count, page_n=page_n, hl_calendar=d) }}
{% else %}
<p class="nl-placeholder">{{ T('notes-month-empty') }}</p>
{% endif %}
{% set past_year = advance_calendar(d, -2) %}
{% set past_month = advance_calendar(d, -1) %}
{% set next_month = advance_calendar(d, 1) %}
{% set next_year = advance_calendar(d, 2) %}
<div class="calendar-navigation">
<ul class="inline">
<li>&laquo; <a href="/calendar/{{ past_year.year }}/{{ past_year.month }}">{{ past_year.strftime("%B %Y") }}</a></li>
<li><a href="/calendar/{{ past_month.year }}/{{ past_month.month }}">{{ past_month.strftime("%B %Y") }}</a></li>
<li><strong>{{ d.strftime("%B %Y") }}</strong></li>
<li><a href="/calendar/{{ next_month.year }}/{{ next_month.month }}">{{ next_month.strftime("%B %Y") }}</a></li>
<li><a href="/calendar/{{ next_year.year }}/{{ next_year.month }}">{{ next_year.strftime("%B %Y") }}</a> &raquo;</li>
</ul>
</div>
<p>{{ T('back-to') }} <a href="/calendar">{{ T('calendar') }}</a></p>
</div>
</main>
{% endblock %}
{% block toc %}
<nav class="toc">
<h3>{{ d.year }}</h3>
<ul>
{#% for i in range(1, 13) %}
<li>
<a href="/calendar/{{ d.year }}/{{ i }}">{{ nd.strftime("%B") }}</a>
<strong>({{ toc[i] }})</strong>
</li>
{% endfor %#}
</ul>
</nav>
{% endblock %}