Commit a73a2348 authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Add representative and tags to position lists

parent 93fac5d4
......@@ -6,10 +6,11 @@
{% comment %}
Expected variables
- 'positions': positions list
- 'show_representatives': show representatives
{% endcomment %}
{% if not positions %}
<p class="no-positions text-center">
<p class="no-positions empty text-center">
{% trans "No public position has been recorded yet." %}
<br><br>
<a class="btn btn-primary hidden-print" data-toggle="modal" data-target="#add-position-form" aria-expanded="false" aria-controls="add-position-form">
......@@ -35,7 +36,12 @@
<td>
{% for position in timeframe %}
<button class="btn btn-default position-button" id="position-button-{{ position.pk }}" type="button" data-toggle="modal" data-target="#position-modal-{{ position.pk }}" aria-expanded="false" aria-controls="position-modal-{{ position.pk }}">
{{ position.datetime|naturalday }}
{% if show_representatives %}
<h5>{{ position.representative }}</h5>
{% endif %}
<div class="text-center">{{ position.datetime|naturalday }}</div>
{% include "blocks/_themetags.html" with themes=position.themes.all exclude=theme.pk %}
</button>
<div class="modal fade" id="position-modal-{{ position.pk }}" tabindex="-1" role="dialog" aria-labelledby="position-button-{{ position.pk }}">
......@@ -43,7 +49,15 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{% trans "Public position" %}</h4>
<h4 class="modal-title">
{% if show_representative %}
{% trans "Public position" %}
{% else %}
{% blocktrans with rep=position.representative %}
Public position by {{ rep }}
{% endblocktrans %}
{% endif %}
</h4>
</div>
<div class="modal-body">
......
{% for theme in themes %}
<a class="tag" href="{% url 'theme-detail' slug=theme.slug %}">{{ theme.name }}</a>
{% if theme.pk != exclude %}
<a class="tag" href="{% url 'theme-detail' slug=theme.slug %}">{{ theme.name }}</a>
{% endif %}
{% endfor %}
\ No newline at end of file
......@@ -2,6 +2,6 @@
{% block theme_content %}
{% include "blocks/_position_list.html" %}
{% include "blocks/_position_list.html" with show_representatives=True %}
{% endblock %}
......@@ -2,6 +2,6 @@
{% block representative_content %}
{% include "blocks/_position_list.html" %}
{% include "blocks/_position_list.html" with positions=representative.positions.all %}
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment