Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
a73a2348
Commit
a73a2348
authored
Sep 03, 2016
by
Nicolas Joyard
Browse files
Add representative and tags to position lists
parent
93fac5d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
templates/blocks/_position_list.html
View file @
a73a2348
...
...
@@ -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"
>
×
</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"
>
...
...
templates/blocks/_themetags.html
View file @
a73a2348
{% 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
templates/memopol_themes/theme_detail_positions.html
View file @
a73a2348
...
...
@@ -2,6 +2,6 @@
{% block theme_content %}
{% include "blocks/_position_list.html" %}
{% include "blocks/_position_list.html"
with show_representatives=True
%}
{% endblock %}
templates/representatives/representative_detail_positions.html
View file @
a73a2348
...
...
@@ -2,6 +2,6 @@
{% block representative_content %}
{% include "blocks/_position_list.html" %}
{% include "blocks/_position_list.html"
with positions=representative.positions.all
%}
{% endblock %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment