manager: always display Month/Week/Day buttons (#33404)

This commit is contained in:
Lauréline Guérin 2022-10-27 15:30:59 +02:00
parent 863dc6ce70
commit 4105b03ab9
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
11 changed files with 55 additions and 40 deletions

View File

@ -10,8 +10,9 @@
{% endif %}
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a class="disabled">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -11,8 +11,9 @@
</ul>
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a class="disabled">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -11,8 +11,9 @@
</ul>
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month' %}</a>
<a class="disabled">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -3,8 +3,9 @@
{% block actions %}
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a class="disabled">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -3,8 +3,9 @@
{% block actions %}
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a class="disabled">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -3,8 +3,9 @@
{% block actions %}
{{ block.super }}
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month' %}</a>
<a class="disabled">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -22,8 +22,9 @@
</h2>
{% endblock %}
{% block appbar-extras %}
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a class="disabled">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -23,8 +23,9 @@
</h2>
{% endblock %}
{% block appbar-extras %}
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week view' %}</a>
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a class="disabled">{% trans 'Month' %}</a>
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -23,8 +23,9 @@
</h2>
{% endblock %}
{% block appbar-extras %}
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month view' %}</a>
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" day=view.date|date:"d" %}">{% trans 'Day view' %}</a>
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a>
<a class="disabled">{% trans 'Week' %}</a>
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
{% endblock %}
{% block content %}

View File

@ -1160,7 +1160,9 @@ def test_agenda_events_day_view(app, admin_user):
login(app)
resp = app.get('/manage/agendas/%s/%s/%s/%s/' % (agenda.pk, today.year, today.month, today.day))
assert 'Month view' in resp.text
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert "This day doesn't have any event configured." in resp.text
# event
@ -1224,7 +1226,9 @@ def test_agenda_events_week_view(app, admin_user):
login(app)
resp = app.get('/manage/agendas/%s/%s/week/%s/' % (agenda.pk, today.year, today.strftime('%W')))
assert 'Day view' in resp.text
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert "This week doesn't have any event configured." in resp.text
# add event in a future month, a wednesday
@ -1315,7 +1319,9 @@ def test_agenda_events_month_view(app, admin_user):
login(app)
resp = app.get('/manage/agendas/%s/%s/%s/' % (agenda.pk, today.year, today.month))
assert 'Day view' in resp.text
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert "This month doesn't have any event configured." in resp.text
# add event in a future month, a wednesday
@ -1508,7 +1514,6 @@ def test_agenda_open_events_view(app, admin_user, manager_user):
agenda.view_role = manager_user.groups.all()[0]
agenda.save()
resp = app.get('/manage/agendas/%s/events/open/' % agenda.pk)
assert 'Month view' in resp.text
# wrong kind
agenda.kind = 'meetings'
@ -1529,12 +1534,12 @@ def test_agenda_month_view(app, admin_user, manager_user, api_user, get_proper_h
login(app)
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day))
assert 'Month view' in resp.text
resp = resp.click('Month view')
resp = resp.click('Month')
assert resp.request.url.endswith('%s/%s/' % (today.year, today.month))
assert 'Day view' in resp.text # day view link should be present
assert 'Week view' in resp.text # week view link should be present
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert 'No opening hours this month.' in resp.text
today = datetime.date(2018, 11, 10) # fixed day
@ -1923,12 +1928,12 @@ def test_agenda_week_view(app, admin_user, manager_user, api_user, get_proper_ht
login(app)
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day))
assert 'Week view' in resp.text
resp = resp.click('Week view')
resp = resp.click('Week')
assert resp.request.url.endswith('%s/week/%s/' % (today.year, today.strftime('%W')))
assert 'Day view' in resp.text # day view link should be present
assert 'Month view' in resp.text # month view link should be present
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert 'No opening hours this week.' in resp.text
today = datetime.date(2018, 11, 10) # fixed day
@ -2559,12 +2564,12 @@ def test_virtual_agenda_week_view(app, admin_user, get_proper_html_str):
login(app)
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day))
assert 'Week view' in resp.text
resp = resp.click('Week view')
resp = resp.click('Week')
assert resp.request.url.endswith('%s/week/%s/' % (today.year, today.strftime('%W')))
assert 'Day view' in resp.text # day view link should be present
assert 'Month view' in resp.text # month view link should be present
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert 'No opening hours this week.' in resp.text
today = datetime.date(2018, 11, 10) # fixed day
@ -2682,12 +2687,12 @@ def test_virtual_agenda_month_view(app, admin_user, get_proper_html_str):
login(app)
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day))
assert 'Month view' in resp.text
resp = resp.click('Month view')
resp = resp.click('Month')
assert resp.request.url.endswith('%s/%s/' % (today.year, today.month))
assert 'Day view' in resp.text # day view link should be present
assert 'Week view' in resp.text # week view link should be present
assert '>Month<' in resp.text
assert '>Week<' in resp.text
assert '>Day<' in resp.text
assert 'No opening hours this month.' in resp.text
today = datetime.date(2018, 11, 10) # fixed day

View File

@ -935,7 +935,8 @@ def test_resource_access_permission(app, manager_user):
assert 'Edit' not in resp.text
assert 'Delete' not in resp.text
assert resp.click('Month view')
assert resp.click('Day view')
assert resp.click('Month')
assert resp.click('Week')
assert resp.click('Day')
assert app.get('/manage/resource/%s/' % resource2.pk, status=403)