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 %}
{% if object.kind == "events" %}
<div class="section">
<h3>{% trans "Events" %}</h3>
{% if object.event_set.count %}
<div>
{% if object.event_set.count %}
<ul class="objects-list single-links">
{% for event in object.event_set.all %}
<li class="{% if event.booked_places > event.places %}overbooking{% endif %}
@ -65,7 +66,6 @@
</li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
@ -74,13 +74,16 @@
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% if object.kind == "meetings" %}
<div class="section">
<h3>{% trans 'Meeting Types' %}</h3>
{% if object.meetingtype_set.count %}
<div>
{% if object.meetingtype_set.count %}
<ul class="objects-list single-links">
{% 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 %}">
@ -91,9 +94,20 @@
</li>
{% endfor %}
</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 class="section">
<h3>{% trans 'Time Periods' %}</h3>
<div>
{% if object.desk_set.count %}
<div class="timeperiods">
{% for desk in object.desk_set.all %}
@ -135,39 +149,37 @@
{% endfor %}
</div>
{% else %}
<div>
<div class="big-msg-info">
{% blocktrans %}
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.
{% endblocktrans %}
</div>
{% 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>
{% endif %}
</div>
{% endif %}
<div class="section">
<h3>{% trans "Permissions" %}</h3>
<div>
<ul>
<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>
</ul>
</div>
</div>
<div class="section">
<h3>{% trans "Booking Delays" %}</h3>
<div>
<ul>
<li>{% trans "Minimal booking delay:" %} {{ agenda.minimal_booking_delay }} {% trans "days" %}</li>
<li>{% trans "Maximal booking delay:" %} {{ agenda.maximal_booking_delay }} {% trans "days" %}</li>
</ul>
</div>
</div>
{% 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.save()
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()
app = login(app)
resp = app.get('/manage/agendas/%s/' % agenda.id, status=302).follow()
resp = resp.click('Settings')
resp = resp.click('Add a time period')