fixing and improving templates

This commit is contained in:
Élie Bouttier 2016-07-07 16:46:55 +02:00
parent 374d7a97cb
commit 75dd322721
4 changed files with 23 additions and 15 deletions

View File

@ -12,7 +12,7 @@
{% endfor %}
<i>in</i>
{% for topic in talk.topics.all %}
{{ topic.get_link }}
<a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic }}</a>
{% if forloop.revcounter == 2 %} and {% elif not forloop.last %}, {% endif %}
{% endfor %}
</li>

View File

@ -30,7 +30,7 @@
<ul>
{% for topic in talk.topics.all %}
<li>{{ topic.get_link }}</li>
<li><a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic }}</a></li>
{% endfor %}
</ul>

View File

@ -14,6 +14,23 @@
<h1>{{ topic }}</h1>
{% if request.user.is_superuser %}
<a href="{% url 'edit-talk' topic.slug %}">edit</a><br />
{% endif %}
<a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic.talks.count }} talk{{ topic.talks.count|pluralize }}</a><br />
Reviewers:
<ul>
{% for reviewer in topic.reviewers.all %}
<li>
{{ reviewer }}
{% if request|orga %} - <a href="{% url 'remove-reviewer' topic.slug reviewer.user.username %}">remove</a>{% endif %}
</li>
{% empty %}
<li><i>No reviewers.</i></li>
{% endfor %}
</ul>
{% if request|orga %}
<form class="form-inline" method="post" action="{% url 'add-reviewer' topic.slug %}" role="form" id="add-reviewer-form">
{% csrf_token %}
@ -28,16 +45,6 @@
</form>
{% endif %}
<ul>
{% for reviewer in topic.reviewers.all %}
<li>
{{ reviewer }}
{% if request|orga %} - <a href="{% url 'remove-reviewer' topic.slug reviewer.user.username %}">remove</a>{% endif %}
</li>
{% empty %}
<li><i>No reviewers.</i></li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -11,13 +11,14 @@
<ul>
{% for topic in topic_list %}
<li>
{{ topic }}:
{% if request|staff %}
{{ topic }}:
<a href="{{ topic.get_absolute_url }}">{{ topic.reviewers.count }} reviewer{{ topic.reviewers.count|pluralize }}</a>
and
{% comment %}{% if topic.reviewers.exists %} ({% for reviewer in topic.reviewers.all %} {{ reviewer.get_link }} {% if not forloop.last %}, {% endif %}{% endfor %}) {% endif %}{% endcomment %}
<a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic.talks.count }} talk{{ topic.talks.count|pluralize }}</a>
{% else %}
<a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic }}</a>
{% endif %}
<a href="{% url 'list-talks-by-topic' topic.slug %}">{{ topic.talks.count }} talk{{ topic.talks.count|pluralize }}</a>.
{% if request.user.is_superuser %} - <a href="{% url 'edit-topic' topic.slug %}">edit</a>{% endif %}
</li>
{% empty %}