Improved calendar view

This commit is contained in:
Yusur 2023-03-17 11:40:34 +01:00
parent a8b24f2765
commit 9f9525ecd1
5 changed files with 34 additions and 26 deletions

View file

@ -5,29 +5,28 @@
{% block content %}
<h1>Calendar</h1>
<form>
<fieldset>
<legend>Calendar view</legend>
<ul>
{% for year in range(till_year, from_year-1, -1) %}
<li>
<strong>{{ year }} {% if year == now.year %}(current){% endif %}:</strong>
<ul class="inline">
{% for month in range(1, 13) %}
<li><a href="/calendar/{{year}}/{{month}}">{{ year }}.{{ month }}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<div>
<label><strong>Show as</strong>:</label>
<ul class="inline">
{% set view_choices = ["month"] %}
{% for vch in view_choices %}
<li>
{% if vch == viewas %}
<strong>{{ T(vch) }}</strong>
{% else %}
<a href="/calendar/{{ vch }}">{{ T(vch) }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" >
<div>
<label><strong>Show month</strong></label>
</div>
</fieldset>
</form>
<p>
Show more years:
<ul class="inline">
<li>
<a href="?till_year={{ till_year + 15 }}">in the future</a>
</li>
<li>
<a href="?from_year={{ from_year - 15 }}">in the past</a>
</li>
</ul>
</p>
{% endblock %}