manager: style sections (#21778)

This commit is contained in:
Frédéric Péters 2018-02-11 10:48:37 +01:00
parent c1de0ac538
commit 0211c0b8be
2 changed files with 28 additions and 19 deletions

View File

@ -28,9 +28,10 @@
{% block content %} {% block content %}
{% if object.kind == "events" %} {% if object.kind == "events" %}
<div class="section">
<h3>{% trans "Events" %}</h3> <h3>{% trans "Events" %}</h3>
{% if object.event_set.count %}
<div> <div>
{% if object.event_set.count %}
<ul class="objects-list single-links"> <ul class="objects-list single-links">
{% for event in object.event_set.all %} {% for event in object.event_set.all %}
<li class="{% if event.booked_places > event.places %}overbooking{% endif %} <li class="{% if event.booked_places > event.places %}overbooking{% endif %}
@ -65,7 +66,6 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div>
{% else %} {% else %}
<div class="big-msg-info"> <div class="big-msg-info">
{% blocktrans %} {% blocktrans %}
@ -74,13 +74,16 @@
{% endblocktrans %} {% endblocktrans %}
</div> </div>
{% endif %} {% endif %}
</div>
</div>
{% endif %} {% endif %}
{% if object.kind == "meetings" %} {% if object.kind == "meetings" %}
<div class="section">
<h3>{% trans 'Meeting Types' %}</h3> <h3>{% trans 'Meeting Types' %}</h3>
{% if object.meetingtype_set.count %}
<div> <div>
{% if object.meetingtype_set.count %}
<ul class="objects-list single-links"> <ul class="objects-list single-links">
{% for meeting_type in object.meetingtype_set.all %} {% for meeting_type in object.meetingtype_set.all %}
<li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-meeting-type-edit' pk=meeting_type.id %}{% else %}#{% endif %}"> <li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-meeting-type-edit' pk=meeting_type.id %}{% else %}#{% endif %}">
@ -91,9 +94,20 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This agenda doesn't have any meeting type yet. Click on the "New Meeting Type" button in
the top right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div> </div>
<div class="section">
<h3>{% trans 'Time Periods' %}</h3> <h3>{% trans 'Time Periods' %}</h3>
<div>
{% if object.desk_set.count %} {% if object.desk_set.count %}
<div class="timeperiods"> <div class="timeperiods">
{% for desk in object.desk_set.all %} {% for desk in object.desk_set.all %}
@ -135,39 +149,37 @@
{% endfor %} {% endfor %}
</div> </div>
{% else %} {% else %}
<div> <div class="big-msg-info">
{% blocktrans %} {% blocktrans %}
This agenda doesn't have any desk yet. Click on the "New Desk" button in This agenda doesn't have any desk yet. Click on the "New Desk" button in
the top right of the page to add a first one. the top right of the page to add a first one.
{% endblocktrans %} {% endblocktrans %}
</div> </div>
{% endif %} {% endif %}
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This agenda doesn't have any meeting type yet. Click on the "New Meeting Type" button in
the top right of the page to add a first one.
{% endblocktrans %}
</div> </div>
{% endif %} </div>
{% endif %} {% endif %}
<div class="section">
<h3>{% trans "Permissions" %}</h3> <h3>{% trans "Permissions" %}</h3>
<div>
<ul> <ul>
<li>{% trans "Edit Role:" %} {% if agenda.edit_role %}{{ agenda.edit_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li> <li>{% trans "Edit Role:" %} {% if agenda.edit_role %}{{ agenda.edit_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li>
<li>{% trans "View Role:" %} {% if agenda.view_role %}{{ agenda.view_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li> <li>{% trans "View Role:" %} {% if agenda.view_role %}{{ agenda.view_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li>
</ul> </ul>
</div>
</div>
<div class="section">
<h3>{% trans "Booking Delays" %}</h3> <h3>{% trans "Booking Delays" %}</h3>
<div>
<ul> <ul>
<li>{% trans "Minimal booking delay:" %} {{ agenda.minimal_booking_delay }} {% trans "days" %}</li> <li>{% trans "Minimal booking delay:" %} {{ agenda.minimal_booking_delay }} {% trans "days" %}</li>
<li>{% trans "Maximal booking delay:" %} {{ agenda.maximal_booking_delay }} {% trans "days" %}</li> <li>{% trans "Maximal booking delay:" %} {{ agenda.maximal_booking_delay }} {% trans "days" %}</li>
</ul> </ul>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -585,11 +585,8 @@ def test_meetings_agenda_add_time_period(app, admin_user):
agenda = Agenda(label=u'Foo bar', kind='meetings') agenda = Agenda(label=u'Foo bar', kind='meetings')
agenda.save() agenda.save()
desk = Desk.objects.create(agenda=agenda, label='Desk A') desk = Desk.objects.create(agenda=agenda, label='Desk A')
app = login(app)
resp = app.get('/manage/agendas/%s/' % agenda.id, status=302).follow()
resp = resp.click('Settings')
assert not 'Add a time period' in resp.body
MeetingType(agenda=agenda, label='Blah').save() MeetingType(agenda=agenda, label='Blah').save()
app = login(app)
resp = app.get('/manage/agendas/%s/' % agenda.id, status=302).follow() resp = app.get('/manage/agendas/%s/' % agenda.id, status=302).follow()
resp = resp.click('Settings') resp = resp.click('Settings')
resp = resp.click('Add a time period') resp = resp.click('Add a time period')