Commit 811f4dcd authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Factor position display + move content to modal

parent 739eebfb
<button aria-controls="collapsePosition-566" aria-expanded="false" class="btn btn-default position-button" data-target="#collapsePosition-566" data-toggle="collapse" type="button">
<button aria-controls="position-modal-566" aria-expanded="false" class="btn btn-default position-button" data-target="#position-modal-566" data-toggle="modal" id="position-button-566" type="button">
Oct. 3, 2009
</button>
---
<button aria-controls="collapsePosition-567" aria-expanded="false" class="btn btn-default position-button" data-target="#collapsePosition-567" data-toggle="collapse" type="button">
<button aria-controls="position-modal-567" aria-expanded="false" class="btn btn-default position-button" data-target="#position-modal-567" data-toggle="modal" id="position-button-567" type="button">
June 17, 2008
</button>
\ No newline at end of file
<div class="collapse position-details" id="collapsePosition-566">
<div class="panel panel-default">
<div class="panel-body text-justify">
<div class="modal-dialog modal-lg position-details" role="document">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Public position</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12 text-justify">
<blockquote>
<p>Billet sur blog expliquant la position du groupe socialiste
Projet de loi Hadopi, craintes et menaces
......@@ -12,16 +19,29 @@ Cette opposition au projet présenté ne doit pas clore la réflexion quant au f
Enfin, la méthode nous interroge aussi. Ce projet n'a été précédé d'aucune étude d'impact et la loi DADVSI adoptée en 2006 prévoyait une étude de bilan après 18 mois qui n'a pas été faite. De plus, la directive européenne 2002/58/CE relative au traitement des données personnelles et à la protection de la vie privée n'est pas totalement respectée, de même que les articles 17 et 47 de la Charte des Droits Fondamentaux, et l'article 8 de la CEDH.
Olivier Dussopt n'a pas fait de réponse aux commentaires sur son blog.</p>
</blockquote>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="http://www.olivierdussopt.fr/blog/2009/03/projet-de-loi-hadopi-craintes-et-menaces.html" target="_blank">Check the source »</a>
<p class="text-right"><a class="btn btn-primary" href="http://www.olivierdussopt.fr/blog/2009/03/projet-de-loi-hadopi-craintes-et-menaces.html" target="blank">Check the source »</a></p>
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button>
</div>
</div>
</div>
---
<div class="collapse position-details" id="collapsePosition-567">
<div class="panel panel-default">
<div class="panel-body text-justify">
<div class="modal-dialog modal-lg position-details" role="document">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Public position</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12 text-justify">
<blockquote>
<p>Billet signalant un appel de parlementaires socialistes contre le projet de loi Hadopi
Avec quelques uns de mes collègues, nous avons publié dans l'édition internet de Libération des 17 et 18 juin un appel contre le projet de loi proposé par le Gouvernement. Vous le trouverez ci-après et dans la suite de cet article.
......@@ -45,9 +65,15 @@ Socialistes, nous nous dressons donc aujourd'hui contre ce projet disproportionn
La France, pays des droits de l'Homme et des Lumières, ne peut pas entrer dans le millénaire du numérique avec les habits de l'Ancien Régime.
Olivier Dussopt n'a fait aucune réponse aux commentaires sur son blog.</p>
</blockquote>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="http://www.olivierdussopt.fr/blog/2008/06/appel-contre-un.html" target="_blank">Check the source »</a>
<p class="text-right"><a class="btn btn-primary" href="http://www.olivierdussopt.fr/blog/2008/06/appel-contre-un.html" target="blank">Check the source »</a></p>
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button>
</div>
</div>
</div>
\ No newline at end of file
......@@ -13,5 +13,8 @@ class ThemePositionsTest(ThemeBaseTest):
def test_queries(self):
self.do_query_test()
def test_positions(self):
self.selector_test('.position')
def test_position_buttons(self):
self.selector_test('.position-button')
def test_position_details(self):
self.selector_test('.position-details')
{% load i18n %}
{% load bootstrap3 %}
{% load humanize %}
{% load representatives_positions_tags %}
{% comment %}
Expected variables
- 'positions': positions list
{% endcomment %}
{% if not positions %}
<p class="no-positions 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">
{% bootstrap_icon "bullhorn" %}
{% trans "Add a public position" %}
</a>
</p>
{% else %}
<table class="table table-responsive custom-timeline text-center">
<thead>
<tr>
<th class="text-center">{% trans "Before" %}</th>
<th class="text-center">{% trans "Last year" %}</th>
<th class="text-center">{% trans "Last 6 months" %}</th>
<th class="text-center">{% trans "This month" %}</th>
</tr>
</thead>
<tbody>
<tr>
{% for timeframe in positions|regroup_by_age %}
<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 }}
</button>
<div class="modal fade" id="position-modal-{{ position.pk }}" tabindex="-1" role="dialog" aria-labelledby="position-button-{{ position.pk }}">
<div class="modal-dialog modal-lg position-details" role="document">
<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>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12 text-justify">
<blockquote>
<p>{{ position.text }}</p>
</blockquote>
</div>
</div>
</div>
<div class="modal-footer">
{% if position.link %}
<a class="btn btn-primary" href="{{ position.link }}" target="_blank">Check the source &raquo;</a>
{% endif %}
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
</div>
</div>
</div>
</div>
{% endfor %}
</td>
{% endfor %}
</tr>
</tbody>
</table>
{% endif %}
{% extends 'memopol_themes/theme_detail.html' %}
{% load i18n %}
{% load memopol_tags %}
{% block theme_content %}
<table class="table table-responsive">
<tr>
<th>
{% trans "Representative" %}
</th>
<th>
{% trans "Date" %}
</th>
<th>
{% trans "Position" %}
</th>
<th>
{% trans "Link" %}
</th>
</tr>
{% for position in positions %}
<tr class="position">
<td>{{ position.representative }}</td>
<td>{{ position.datetime }}</td>
<td>
<a href="{{ position.get_absolute_url }}">
{{ position.text|truncatewords:8 }}
</a>
</td>
<td>
<a href="{{ position.link }}">
{{ position.link }}
</a>
</td>
</tr>
{% endfor %}
</table>
{% include "blocks/_position_list.html" %}
{% endblock %}
{% extends 'representatives/representative_detail.html' %}
{% load i18n %}
{% load bootstrap3 %}
{% load humanize %}
{% load representatives_positions_tags %}
{% block representative_content %}
{% if not positions %}
<p class="no-positions 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">
{% bootstrap_icon "bullhorn" %}
{% trans "Add a public position" %}
</a>
</p>
{% else %}
<table class="table table-responsive custom-timeline text-center">
<thead>
<tr>
<th class="text-center">{% trans "Before" %}</th>
<th class="text-center">{% trans "Last year" %}</th>
<th class="text-center">{% trans "Last 6 months" %}</th>
<th class="text-center">{% trans "This month" %}</th>
</tr>
</thead>
<tbody>
<tr>
{% for timeframe in positions|regroup_by_age %}
<td>
{% for position in timeframe %}
<button class="btn btn-default position-button" type="button" data-toggle="collapse" data-target="#collapsePosition-{{ position.pk }}" aria-expanded="false" aria-controls="collapsePosition-{{ position.pk }}">
{{ position.datetime|naturalday }}
</button>
{% endfor %}
</td>
{% endfor %}
</tr>
</tbody>
</table>
{% for position in positions %}
<div class="collapse position-details" id="collapsePosition-{{ position.pk }}">
<div class="panel panel-default">
<div class="panel-body text-justify">
<blockquote>
<p>{{ position.text }}</p>
</blockquote>
{% if position.link %}
<p class="text-right"><a class="btn btn-primary" href="{{ position.link }}" target="blank">Check the source &raquo;</a></p>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% include "blocks/_position_list.html" %}
{% endblock %}
Supports Markdown
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