0002-manager-reword-time-period-related-labels-70185.patch
chrono/manager/templates/chrono/manager_meetings_agenda_settings.html | ||
---|---|---|
39 | 39 |
aria-selected="{{meeting_types|yesno:"true,false"}}" |
40 | 40 |
id="tab-time-periods" role="tab" |
41 | 41 |
tabindex="{{meeting_types|yesno:"0"}}" |
42 |
>{% trans "Time Periods" %}</button>
|
|
42 |
>{% trans "Opening hours" %}</button>
|
|
43 | 43 |
{% if has_resources %} |
44 | 44 |
<button aria-controls="panel-resources" aria-selected="false" id="tab-resources" role="tab" tabindex="-1">{% trans "Resources" %}</button> |
45 | 45 |
{% endif %} |
... | ... | |
108 | 108 |
<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-delete' pk=time_period.id %}">{% trans "remove" %}</a> |
109 | 109 |
</li> |
110 | 110 |
{% endfor %} |
111 |
<li><a class="add" rel="popup" href="{{add_time_period_url}}">{% trans 'Add a time period' %}</a></li>
|
|
111 |
<li><a class="add" rel="popup" href="{{add_time_period_url}}">{% trans 'Add repeating periods' %}</a></li>
|
|
112 | 112 |
{% url 'chrono-manager-agenda-add-time-period-exception' agenda_pk=object.pk pk=desk.pk as add_time_period_exception_url %} |
113 | 113 |
<li> |
114 | 114 |
<a><strong>{% trans 'Exceptions' %}</strong></a> |
chrono/manager/templates/chrono/manager_time_period_form.html | ||
---|---|---|
11 | 11 |
{% if object.id %} |
12 | 12 |
<a href="">{{object}}</a> |
13 | 13 |
{% else %} |
14 |
<a href="">{% trans "New Time Period" %}</a>
|
|
14 |
<a href="">{% trans "Repeating period" %}</a>
|
|
15 | 15 |
{% endif %} |
16 | 16 |
{% endblock %} |
17 | 17 | |
18 | 18 |
{% block appbar %} |
19 |
<h2>{% trans "Repeating period" %}</h2> |
|
19 | 20 |
{% if object.id %} |
20 |
<h2>{% trans "Edit Time Period" %}</h2> |
|
21 | 21 |
<span class="actions"> |
22 | 22 |
<a rel="popup" href="{% url 'chrono-manager-time-period-delete' pk=object.id %}">{% trans 'Delete' %}</a> |
23 | 23 |
</span> |
24 |
{% else %} |
|
25 |
<h2>{% trans "New Time Period" %}</h2> |
|
26 | 24 |
{% endif %} |
27 | 25 |
{% endblock %} |
28 | 26 |
tests/manager/test_timeperiod.py | ||
---|---|---|
15 | 15 |
MeetingType.objects.create(agenda=agenda, label='Blah') |
16 | 16 |
app = login(app) |
17 | 17 |
resp = app.get('/manage/agendas/%s/settings' % agenda.pk) |
18 |
resp = resp.click('Add a time period', index=0)
|
|
18 |
resp = resp.click('Add repeating periods', index=0)
|
|
19 | 19 |
resp.form.get('weekdays', index=2).checked = True |
20 | 20 |
resp.form['start_time'] = '10:00' |
21 | 21 |
resp.form['end_time'] = '17:00' |
... | ... | |
30 | 30 |
resp = resp.follow() |
31 | 31 | |
32 | 32 |
# add a second time period |
33 |
resp = resp.click('Add a time period', index=0)
|
|
33 |
resp = resp.click('Add repeating periods', index=0)
|
|
34 | 34 |
resp.form.get('weekdays', index=0).checked = True |
35 | 35 |
resp.form['start_time'] = '10:00' |
36 | 36 |
resp.form['end_time'] = '13:00' |
... | ... | |
43 | 43 |
assert resp.text.index('Monday') < resp.text.index('Wednesday') |
44 | 44 | |
45 | 45 |
# invert start and end |
46 |
resp2 = resp.click('Add a time period', index=0)
|
|
46 |
resp2 = resp.click('Add repeating periods', index=0)
|
|
47 | 47 |
resp2.form.get('weekdays', index=0).checked = True |
48 | 48 |
resp2.form['start_time'] = '13:00' |
49 | 49 |
resp2.form['end_time'] = '10:00' |
... | ... | |
51 | 51 |
assert 'End time must come after start time.' in resp2.text |
52 | 52 | |
53 | 53 |
# and add same time periods on multiple days |
54 |
resp = resp.click('Add a time period', index=0)
|
|
54 |
resp = resp.click('Add repeating periods', index=0)
|
|
55 | 55 |
resp.form.get('weekdays', index=4).checked = True |
56 | 56 |
resp.form.get('weekdays', index=5).checked = True |
57 | 57 |
resp.form['start_time'] = '10:00' |
... | ... | |
107 | 107 |
agenda.save() |
108 | 108 | |
109 | 109 |
resp = app.get('/manage/agendas/%s/settings' % agenda.pk) |
110 |
assert 'Add a time period' in resp.text
|
|
110 |
assert 'Add repeating periods' in resp.text
|
|
111 | 111 |
assert '/manage/timeperiods/%s/edit' % time_period.id in resp.text |
112 | 112 |
assert '/manage/timeperiods/%s/delete' % time_period.id in resp.text |
113 | 113 | |
... | ... | |
128 | 128 |
# edit |
129 | 129 |
resp = app.get('/manage/agendas/%s/settings' % agenda.pk) |
130 | 130 |
resp = resp.click('Monday / 9 a.m. → noon', index=0) |
131 |
assert 'Edit Time Period' in resp.text
|
|
131 |
assert 'Repeating period' in resp.text
|
|
132 | 132 |
resp.form['start_time'] = '10:00' |
133 | 133 |
resp = resp.form.submit() |
134 | 134 |
resp = resp.follow() |
135 |
- |