diff --git a/templates/representatives/_filter_form.haml b/templates/representatives/_filter_form.haml new file mode 100644 index 0000000000000000000000000000000000000000..1940d5fc0456974c3e3add4925336e1682ff81ef --- /dev/null +++ b/templates/representatives/_filter_form.haml @@ -0,0 +1,15 @@ +- load bootstrap3 + +%form.filter-form{'action': '{{action}}', 'method': 'get'} + + - bootstrap_form form=form bound_css_class='filter-form-group' + + - buttons + %button{'type': 'submit', 'class': 'btn btn-primary'} + {% bootstrap_icon "filter" %} Filter + - endbuttons + + - buttons + %a{'href': '?{{ qs }}&csv', 'class': 'btn btn-primary'} + {% bootstrap_icon "download-alt" %} Download as CSV + - endbuttons diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml index 620388405597234cac772062d833c5ccfbe2b7bd..087f2f1101477fd618eeee5933fa7a96f58d1651 100644 --- a/templates/representatives/representative_list.haml +++ b/templates/representatives/representative_list.haml @@ -4,18 +4,16 @@ - load memopol_tags - load representatives_recommendations_tags -- block content +- block head - - block search + {{ filter.form.media }} - {{ filter.form.media }} +- block content - %form.filter-form{action:'', method:'get'} - {{ filter.form.as_p }} - %input{type:"submit", value:"Go"} + - block search - %a{href:"?{% if request.GET.search %}search={{ request.GET.search }}&{% endif %}csv"} - - trans 'Download data as CSV' + {% url 'representative-list' as action_url %} + - include 'representatives/_filter_form.html' with action=action_url form=filter.form qs=request.GET.urlencode - include 'core/blocks/pagination.html'