0002-manager-always-display-Month-Week-Day-buttons-33404.patch
chrono/manager/templates/chrono/manager_events_agenda_day_view.html | ||
---|---|---|
10 | 10 |
{% endif %} |
11 | 11 |
{{ block.super }} |
12 | 12 |
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a> |
13 |
<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> |
|
14 |
<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> |
|
13 |
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a> |
|
14 |
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
15 |
<a class="disabled">{% trans 'Day' %}</a> |
|
15 | 16 |
{% endblock %} |
16 | 17 | |
17 | 18 |
{% block content %} |
chrono/manager/templates/chrono/manager_events_agenda_month_view.html | ||
---|---|---|
11 | 11 |
</ul> |
12 | 12 |
{{ block.super }} |
13 | 13 |
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a> |
14 |
<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> |
|
15 |
<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> |
|
14 |
<a class="disabled">{% trans 'Month' %}</a> |
|
15 |
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
16 |
<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> |
|
16 | 17 |
{% endblock %} |
17 | 18 | |
18 | 19 |
{% block content %} |
chrono/manager/templates/chrono/manager_events_agenda_week_view.html | ||
---|---|---|
11 | 11 |
</ul> |
12 | 12 |
{{ block.super }} |
13 | 13 |
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a> |
14 |
<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> |
|
15 |
<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> |
|
14 |
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month' %}</a> |
|
15 |
<a class="disabled">{% trans 'Week' %}</a> |
|
16 |
<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> |
|
16 | 17 |
{% endblock %} |
17 | 18 | |
18 | 19 |
{% block content %} |
chrono/manager/templates/chrono/manager_meetings_agenda_day_view.html | ||
---|---|---|
3 | 3 | |
4 | 4 |
{% block actions %} |
5 | 5 |
{{ block.super }} |
6 |
<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> |
|
7 |
<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> |
|
6 |
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a> |
|
7 |
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
8 |
<a class="disabled">{% trans 'Day' %}</a> |
|
8 | 9 |
{% endblock %} |
9 | 10 | |
10 | 11 |
{% block content %} |
chrono/manager/templates/chrono/manager_meetings_agenda_month_view.html | ||
---|---|---|
3 | 3 | |
4 | 4 |
{% block actions %} |
5 | 5 |
{{ block.super }} |
6 |
<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> |
|
7 |
<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> |
|
6 |
<a class="disabled">{% trans 'Month' %}</a> |
|
7 |
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
8 |
<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> |
|
8 | 9 |
{% endblock %} |
9 | 10 | |
10 | 11 |
{% block content %} |
chrono/manager/templates/chrono/manager_meetings_agenda_week_view.html | ||
---|---|---|
3 | 3 | |
4 | 4 |
{% block actions %} |
5 | 5 |
{{ block.super }} |
6 |
<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> |
|
7 |
<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> |
|
6 |
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" %}">{% trans 'Month' %}</a> |
|
7 |
<a class="disabled">{% trans 'Week' %}</a> |
|
8 |
<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> |
|
8 | 9 |
{% endblock %} |
9 | 10 | |
10 | 11 |
{% block content %} |
chrono/manager/templates/chrono/manager_resource_day_view.html | ||
---|---|---|
22 | 22 |
</h2> |
23 | 23 |
{% endblock %} |
24 | 24 |
{% block appbar-extras %} |
25 |
<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> |
|
26 |
<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> |
|
25 |
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a> |
|
26 |
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
27 |
<a class="disabled">{% trans 'Day' %}</a> |
|
27 | 28 |
{% endblock %} |
28 | 29 | |
29 | 30 |
{% block content %} |
chrono/manager/templates/chrono/manager_resource_month_view.html | ||
---|---|---|
23 | 23 |
</h2> |
24 | 24 |
{% endblock %} |
25 | 25 |
{% block appbar-extras %} |
26 |
<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> |
|
27 |
<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> |
|
26 |
<a class="disabled">{% trans 'Month' %}</a> |
|
27 |
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" week=view.date|date:"W" %}">{% trans 'Week' %}</a> |
|
28 |
<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> |
|
28 | 29 |
{% endblock %} |
29 | 30 | |
30 | 31 |
{% block content %} |
chrono/manager/templates/chrono/manager_resource_week_view.html | ||
---|---|---|
23 | 23 |
</h2> |
24 | 24 |
{% endblock %} |
25 | 25 |
{% block appbar-extras %} |
26 |
<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> |
|
27 |
<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> |
|
26 |
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month' %}</a> |
|
27 |
<a class="disabled">{% trans 'Week' %}</a> |
|
28 |
<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> |
|
28 | 29 |
{% endblock %} |
29 | 30 | |
30 | 31 |
{% block content %} |
tests/manager/test_all.py | ||
---|---|---|
1160 | 1160 | |
1161 | 1161 |
login(app) |
1162 | 1162 |
resp = app.get('/manage/agendas/%s/%s/%s/%s/' % (agenda.pk, today.year, today.month, today.day)) |
1163 |
assert 'Month view' in resp.text |
|
1163 |
assert '>Month<' in resp.text |
|
1164 |
assert '>Week<' in resp.text |
|
1165 |
assert '>Day<' in resp.text |
|
1164 | 1166 |
assert "This day doesn't have any event configured." in resp.text |
1165 | 1167 | |
1166 | 1168 |
# event |
... | ... | |
1224 | 1226 | |
1225 | 1227 |
login(app) |
1226 | 1228 |
resp = app.get('/manage/agendas/%s/%s/week/%s/' % (agenda.pk, today.year, today.strftime('%W'))) |
1227 |
assert 'Day view' in resp.text |
|
1229 |
assert '>Month<' in resp.text |
|
1230 |
assert '>Week<' in resp.text |
|
1231 |
assert '>Day<' in resp.text |
|
1228 | 1232 |
assert "This week doesn't have any event configured." in resp.text |
1229 | 1233 | |
1230 | 1234 |
# add event in a future month, a wednesday |
... | ... | |
1315 | 1319 | |
1316 | 1320 |
login(app) |
1317 | 1321 |
resp = app.get('/manage/agendas/%s/%s/%s/' % (agenda.pk, today.year, today.month)) |
1318 |
assert 'Day view' in resp.text |
|
1322 |
assert '>Month<' in resp.text |
|
1323 |
assert '>Week<' in resp.text |
|
1324 |
assert '>Day<' in resp.text |
|
1319 | 1325 |
assert "This month doesn't have any event configured." in resp.text |
1320 | 1326 | |
1321 | 1327 |
# add event in a future month, a wednesday |
... | ... | |
1508 | 1514 |
agenda.view_role = manager_user.groups.all()[0] |
1509 | 1515 |
agenda.save() |
1510 | 1516 |
resp = app.get('/manage/agendas/%s/events/open/' % agenda.pk) |
1511 |
assert 'Month view' in resp.text |
|
1512 | 1517 | |
1513 | 1518 |
# wrong kind |
1514 | 1519 |
agenda.kind = 'meetings' |
... | ... | |
1529 | 1534 | |
1530 | 1535 |
login(app) |
1531 | 1536 |
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day)) |
1532 |
assert 'Month view' in resp.text |
|
1533 |
resp = resp.click('Month view') |
|
1537 |
resp = resp.click('Month') |
|
1534 | 1538 |
assert resp.request.url.endswith('%s/%s/' % (today.year, today.month)) |
1535 | 1539 | |
1536 |
assert 'Day view' in resp.text # day view link should be present |
|
1537 |
assert 'Week view' in resp.text # week view link should be present |
|
1540 |
assert '>Month<' in resp.text |
|
1541 |
assert '>Week<' in resp.text |
|
1542 |
assert '>Day<' in resp.text |
|
1538 | 1543 |
assert 'No opening hours this month.' in resp.text |
1539 | 1544 | |
1540 | 1545 |
today = datetime.date(2018, 11, 10) # fixed day |
... | ... | |
1923 | 1928 | |
1924 | 1929 |
login(app) |
1925 | 1930 |
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day)) |
1926 |
assert 'Week view' in resp.text |
|
1927 |
resp = resp.click('Week view') |
|
1931 |
resp = resp.click('Week') |
|
1928 | 1932 |
assert resp.request.url.endswith('%s/week/%s/' % (today.year, today.strftime('%W'))) |
1929 | 1933 | |
1930 |
assert 'Day view' in resp.text # day view link should be present |
|
1931 |
assert 'Month view' in resp.text # month view link should be present |
|
1934 |
assert '>Month<' in resp.text |
|
1935 |
assert '>Week<' in resp.text |
|
1936 |
assert '>Day<' in resp.text |
|
1932 | 1937 |
assert 'No opening hours this week.' in resp.text |
1933 | 1938 | |
1934 | 1939 |
today = datetime.date(2018, 11, 10) # fixed day |
... | ... | |
2559 | 2564 | |
2560 | 2565 |
login(app) |
2561 | 2566 |
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day)) |
2562 |
assert 'Week view' in resp.text |
|
2563 |
resp = resp.click('Week view') |
|
2567 |
resp = resp.click('Week') |
|
2564 | 2568 |
assert resp.request.url.endswith('%s/week/%s/' % (today.year, today.strftime('%W'))) |
2565 | 2569 | |
2566 |
assert 'Day view' in resp.text # day view link should be present |
|
2567 |
assert 'Month view' in resp.text # month view link should be present |
|
2570 |
assert '>Month<' in resp.text |
|
2571 |
assert '>Week<' in resp.text |
|
2572 |
assert '>Day<' in resp.text |
|
2568 | 2573 |
assert 'No opening hours this week.' in resp.text |
2569 | 2574 | |
2570 | 2575 |
today = datetime.date(2018, 11, 10) # fixed day |
... | ... | |
2682 | 2687 | |
2683 | 2688 |
login(app) |
2684 | 2689 |
resp = app.get('/manage/agendas/%s/%d/%d/%d/' % (agenda.pk, today.year, today.month, today.day)) |
2685 |
assert 'Month view' in resp.text |
|
2686 |
resp = resp.click('Month view') |
|
2690 |
resp = resp.click('Month') |
|
2687 | 2691 |
assert resp.request.url.endswith('%s/%s/' % (today.year, today.month)) |
2688 | 2692 | |
2689 |
assert 'Day view' in resp.text # day view link should be present |
|
2690 |
assert 'Week view' in resp.text # week view link should be present |
|
2693 |
assert '>Month<' in resp.text |
|
2694 |
assert '>Week<' in resp.text |
|
2695 |
assert '>Day<' in resp.text |
|
2691 | 2696 |
assert 'No opening hours this month.' in resp.text |
2692 | 2697 | |
2693 | 2698 |
today = datetime.date(2018, 11, 10) # fixed day |
tests/manager/test_resource.py | ||
---|---|---|
935 | 935 |
assert 'Edit' not in resp.text |
936 | 936 |
assert 'Delete' not in resp.text |
937 | 937 | |
938 |
assert resp.click('Month view') |
|
939 |
assert resp.click('Day view') |
|
938 |
assert resp.click('Month') |
|
939 |
assert resp.click('Week') |
|
940 |
assert resp.click('Day') |
|
940 | 941 | |
941 | 942 |
assert app.get('/manage/resource/%s/' % resource2.pk, status=403) |
942 |
- |