Commit d2273c97 authored by robin Tissot's avatar robin Tissot Committed by Robin

Hook the form to representative-list.

parent b7a0bd50
{% load i18n %}
<form class="form-horizontal">
<form class="form-horizontal" target="{% url "representative-list" %}">
<div class="input-group">
<label class="sr-only" for="rechercher">{% trans "Search" %}</label>
<input type="text" class="form-control" placeholder="{% trans "Search" %}" id="rechercher">
<input type="text" class="form-control" name="search" placeholder="{% trans "Search" %}" id="rechercher">
<span class="input-group-btn">
<button class="btn btn-primary" type="button">
<span class="glyphicon glyphicon-search"></span>
......@@ -12,99 +12,93 @@
</div>
</form>
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#moresearch" aria-expanded="false" aria-controls="moresearch">
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#formMEP" aria-expanded="false" aria-controls="formMEP">
{% trans "More search options" %}
</button>
<div class="collapse" id="moresearch">
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#formMEP" aria-expanded="false" aria-controls="formMEP">
{% trans "Find a MEP" %}
</button>
<div class="collapse" id="formMEP">
<form class="form-horizontal">
<div class="form-group">
{# Note: could we not have only one form and get rid of this field ? #}
<label class="col-sm-2" for="name">{% trans "Name" %}</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="name" placeholder="{% trans "Leave empty for all" %}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="country">{% trans "Country" %}</label>
<div class="col-sm-9">
<select class="form-control" id="country">
<option>{% trans "All" %}</option>
{% for country in countries %}
<option value="{{ country.id }}">{{ country.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="party">{% trans "Party" %}</label>
<div class="col-sm-9">
<select class="form-control" id="party">
<option>{% trans "All" %}</option>
{% for party in parties %}
<option value="{{ party.pk }}">{{ party.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="collapse" id="formMEP">
<form id="search-form" class="form-horizontal">
<div class="form-group">
<label class="col-sm-3" for="country">{% trans "Country" %}</label>
<div class="col-sm-9">
<select class="form-control" id="country">
<option>{% trans "All" %}</option>
{% for country in countries %}
<option value="{{ country.id }}" data-url="{% url "representative-list" group_kind="country" group=country.name %}">
{{ country.name }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="delegation">Delegation</label>
<div class="col-sm-9">
<select class="form-control" id="delegation">
<option>{% trans "All" %}</option>
{% for delegation in delegations %}
<option value="{{ delegation.pk }}">{{ delegation.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="party">{% trans "Party" %}</label>
<div class="col-sm-9">
<select class="form-control" id="party">
<option>{% trans "All" %}</option>
{% for party in parties %}
<option value="{{ party.pk }}" data-url="{% url "representative-list" group_kind="group" group=party.name %}">
{{ party.name }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="committee">Committee</label>
<div class="col-sm-9">
<select class="form-control" id="committee">
<option>{% trans "All" %}</option>
{% for commitee in committees %}
<option value="{{ commitee.pk }}">{{ commitee.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="delegation">Delegation</label>
<div class="col-sm-9">
<select class="form-control" id="delegation">
<option>{% trans "All" %}</option>
{% for delegation in delegations %}
<option value="{{ delegation.pk }}" data-url="{% url "representative-list" group_kind="delegation" group=delegation.name %}">
{{ delegation.name }}
</option>
{% endfor %}
</select>
</div>
</div>
<button type="submit" class="btn btn-default">{% trans "Search" %}</button>
</form>
<div class="form-group">
<label class="col-sm-3" for="committee">Committee</label>
<div class="col-sm-9">
<select class="form-control" id="committee">
<option>{% trans "All" %}</option>
{% for commitee in committees %}
<option value="{{ commitee.pk }}" data-url="{% url "representative-list" group_kind="commitee" group=commitee.name %}">
{{ commitee.name }}
</option>
{% endfor %}
</select>
</div>
</div>
{% comment %}
<!-- i don't know what is this list supposed to contain since we already have a 2 click to dossier detail btn -->
{% comment %}<button type="submit" class="btn btn-default">{% trans "Search" %}</button>{% endcomment %}
</form>
</div>
{% comment %}
<!-- i don't know what is this list supposed to contain since we already have a 2 click to dossier detail btn -->
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#formDossiers" aria-expanded="false" aria-controls="formDossiers">
{% trans "Explore the dossiers" %}
</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#formDossiers" aria-expanded="false" aria-controls="formDossiers">
{% trans "Explore the dossiers" %}
</button>
<div class="collapse" id="formDossiers">
<form class="form-horizontal">
<div class="collapse" id="formDossiers">
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-12">
<select class="form-control" id="dossiers">
<option>All</option>
<option>Personal data protection: processing of data for the purposes of prevention, investigation, detection or prosecution of criminal offences or execution of criminal penalties, and free movement of data </option>
<option>ACTA </option>
<option>Personal data protection: processing and free movement of data </option>
</select>
</div>
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
<div class="form-group">
<div class="col-sm-12">
<select class="form-control" id="dossiers">
<option>All</option>
<option>Personal data protection: processing of data for the purposes of prevention, investigation, detection or prosecution of criminal offences or execution of criminal penalties, and free movement of data </option>
<option>ACTA </option>
<option>Personal data protection: processing and free movement of data </option>
</select>
</div>
</div>
{% endcomment %}
<button type="submit" class="btn btn-default">Search</button>
</form>
</div>
{% endcomment %}
<script>
$(function() {
// redirect to the url contained in data-url of the selected <option>
$('#search-form :input').change(function(event) {
var url = $(':selected', event.target).data('url')
if (url) window.location.href = url;
});
});
</script>
......@@ -68,11 +68,12 @@
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="./js/ie10-viewport-bug-workaround.js"></script>
{% include '_base_search_form_script.html' %}
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
</body>
</html>
......@@ -7,8 +7,9 @@
{% block container-class %}custom-listMEP{% endblock %}
{% block content %}
<h1 class="text-center">{% trans "Members of the European Parliement" %}</h1>
<p class="lead text-center">{number} MEP from {country}, members of {party}, working in {delegation} and on {committee}.</p>
<p class="lead text-center">
{{ paginator.count }} {% trans "MEP" %}{% if search.country %} {% trans "from" %} {{ search.country }}{% endif %}{% if search.group %}, {% trans "members of" %} {{ search.group }}{% endif %}{% if search.delegation %}, {% trans "working in" %} {{ search.delegation }}{% endif %}{% if search.commitee %}, {% trans "on" %} {{ search.commitee }}{% endif %}.
</p>
{% comment %}
<!-- TODO: layout & ordering -->
......
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