Add the previous/next year/month links to the month view

This commit is contained in:
2018-07-02 10:53:15 +02:00
parent f41cf43f80
commit 4c03829264
3 changed files with 138 additions and 5 deletions

View File

@@ -15,6 +15,15 @@
padding-bottom: .5em;
}
tr.month > td > a {
font-weight: normal;
color: black;
}
tr.month > td.month-name > a {
font-weight: bold;
}
tr.days > td {
text-align: center;
border-bottom: 2px solid black;
@@ -46,7 +55,27 @@
<table class="calendar">
<thead>
<tr class="month">
<td colspan="7">{{ calendar.month }}</td>
<td>
<a href="{{ url_for('hello', date=calendar.prev_year) }}">« {{ calendar.prev_year_year }}</a>
</td>
<td>
<a href="{{ url_for('hello', date=calendar.prev_month) }}"> {{ calendar.prev_month_name }}</a>
</td>
<td colspan="3" class="month-name">
{% if not calendar.has_today %}
<a href="{{ url_for('hello', date=now_ts) }}">
{% endif %}
{{ calendar.month }}
{% if not calendar.has_today %}
</a>
{% endif %}
</td>
<td>
<a href="{{ url_for('hello', date=calendar.next_month) }}">{{ calendar.next_month_name }} </a>
</td>
<td>
<a href="{{ url_for('hello', date=calendar.next_year) }}">{{ calendar.next_year_year }} »</a>
</td>
</tr>
<tr class="days">
{% for day in calendar.day_names %}
@@ -68,7 +97,7 @@
{%- endif %}
<tr class="week">
{%- endif %}
<td class="{% if day.month != calendar.timestamp.month %} other-month{% endif %}{% if day.date() == calendar.timestamp.date() %} today{% endif %}">
<td class="{% if day.month != calendar.timestamp.month %} other-month{% endif %}{% if day.date() == now.date() %} today{% endif %}">
<span class="day-num">{{ day.day }}</span>
{% for event in calendar.day_events(day, user=current_user) %}
<div class="event">