manager: restore week number display (#75011)
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Valentin Deniaud 2023-04-27 12:18:51 +02:00
parent 139f96672d
commit b35708abcb
5 changed files with 10 additions and 11 deletions

View File

@ -10,7 +10,7 @@
{% block content %}
<div class="section">
<h3>{% trans "Events" %}</h3>
<h3>{% blocktrans with weeknum=view.first_day|date:"W" %}Events - Week {{ weeknum }}{% endblocktrans %}</h3>
{% include 'chrono/manager_event_cancellation_report_notice.html' %}
<div>
{% if object_list %}

View File

@ -8,11 +8,9 @@
{% for day in week_days.days %}
{% if forloop.first %}
<th class="weeknum">
{% if kind == 'month' %}
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">
{% blocktrans with weeknum=day.date|date:"W" %}Week{{ weeknum }}{% endblocktrans %}
</a>
{% endif %}
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">
{% blocktrans with weeknum=day.date|date:"W" %}Week{{ weeknum }}{% endblocktrans %}
</a>
</th>
{% endif %}
<th class="weekday {% if day.today %}today{% endif %}">{% if kind == 'month' and not day.other_month or kind == 'week' %}<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">{{ day.date|date:"l j" }}{% if kind == 'week' %}<br />{{ day.date|date:"F" }}{% endif %}</a>{% endif %}</th>

View File

@ -9,11 +9,9 @@
{% for day in week_days.days %}
{% if forloop.first %}
<th class="weeknum">
{% if kind == 'month' %}
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">
{% blocktrans with weeknum=day.date|date:"W" %}Week{{ weeknum }}{% endblocktrans %}
</a>
{% endif %}
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">
{% blocktrans with weeknum=day.date|date:"W" %}Week{{ weeknum }}{% endblocktrans %}
</a>
</th>
{% endif %}
<th class="weekday {% if day.today %}today{% endif %}">{% if kind == 'month' and not day.other_month or kind == 'week' %}<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">{{ day.date|date:"l j" }}{% if kind == 'week' %}<br />{{ day.date|date:"F" }}{% endif %}</a>{% endif %}</th>

View File

@ -1280,6 +1280,7 @@ def test_agenda_events_week_view(app, admin_user):
login(app)
resp = app.get('/manage/agendas/%s/week/%s/%s/%s/' % (agenda.pk, today.year, today.month, today.day))
assert '28 September 04 October 2020' in resp.text
assert 'Events - Week 40' in resp.text
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
@ -2018,6 +2019,7 @@ def test_agenda_week_view(app, admin_user, manager_user, api_user):
assert 'No opening hours this week.' not in resp.text
assert '<div class="booking' not in resp.text
assert resp.text.count('<tr') == 9
assert 'Week45' in resp.text
# check opening hours cells
assert '<div class="opening-hours" style="height:800.0%;top:0.0%;width:97.0%;left:1.0%' in resp.text

View File

@ -255,6 +255,7 @@ def test_resource_week_view(app, admin_user):
resp = app.get('/manage/resource/%s/week/%s/%s/%s/' % (resource.pk, today.year, today.month, today.day))
assert '<div class="booking' not in resp.text
assert resp.text.count('<tr') == 9
assert 'Week45' in resp.text
# book some slots
for hour, minute in [(10, 30), (14, 0)]: