diff --git a/core/templates/core/blocks/active-filter.haml b/core/templates/core/blocks/active-filter.haml index 5e51e92db2098c3292e484720155af430f31bb09..e60fc2697f31c9c07d8ba5fca3d038c10a90662c 100644 --- a/core/templates/core/blocks/active-filter.haml +++ b/core/templates/core/blocks/active-filter.haml @@ -1,9 +1,9 @@ Display : - if active_only current legislature only / - %a{'href': '?active_only=0'} + %a{'href': '?={queries.urlencode}&active_only=0'} all data - else - %a{'href': '?active_only=1'} + %a{'href': '?={queries.urlencode}&active_only=1'} current legislature only ="/ all data" \ No newline at end of file diff --git a/core/templates/core/blocks/grid-list.haml b/core/templates/core/blocks/grid-list.haml index 79a21ef8a57fdaa1c494f19eff1835ca4dffc557..0060670498fd50947e9c184690376d49104b8c2d 100644 --- a/core/templates/core/blocks/grid-list.haml +++ b/core/templates/core/blocks/grid-list.haml @@ -1,5 +1,5 @@ %span.grid-list-selector - %a{:href => '?display=grid'} + %a{:href => '?={queries.urlencode}&display=grid'} <i class="fa fa-th"></i> - %a{:href => '?display=list'} + %a{:href => '?={queries.urlencode}&display=list'} <i class="fa fa-th-list"></i> diff --git a/core/templates/core/blocks/pagination.haml b/core/templates/core/blocks/pagination.haml index fb0ffa6c890572277637b893b56515bc98076b47..d90403d8ebd50362b6dab261cc2f6a5c44746fcf 100644 --- a/core/templates/core/blocks/pagination.haml +++ b/core/templates/core/blocks/pagination.haml @@ -47,7 +47,7 @@ {{ paginator.per_page }} ( - for limit in pagination_limits - %a{'href': '?paginate_by={{ limit }}'} + %a{'href': '?={queries.urlencode}&paginate_by={{ limit }}'} {{ limit }} - if not forloop.last \/ diff --git a/core/views.py b/core/views.py index 6b72f0bf042b8f90df9264a8530664dcbaa1e628..051c31f41a8abc7a1136877be7c93a85e4d4c940 100644 --- a/core/views.py +++ b/core/views.py @@ -1,4 +1,7 @@ # coding: utf-8 + +from copy import copy + from django import http import unicodecsv as csv @@ -33,7 +36,10 @@ class ActiveLegislatureMixin(object): def get_active_only(self): overriden = self.override_active_only() if overriden is None: - return self.request.session['active_only'] + if 'active_only' in self.request.session: + return self.request.session['active_only'] + else: + return self.default_active_only else: return overriden @@ -77,6 +83,9 @@ class PaginationMixin(object): c['pagination_limits'] = self.pagination_limits c['paginate_by'] = self.request.session['paginate_by'] c['page_range'] = self.get_page_range(c['page_obj']) + c['queries'] = copy(self.request.GET) + if 'page' in c['queries']: + del c['queries']['page'] return c diff --git a/memopol/filters.py b/memopol/filters.py new file mode 100644 index 0000000000000000000000000000000000000000..453731b72b5e0a6ba6271f8da455e716ae09c59a --- /dev/null +++ b/memopol/filters.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +from dal.autocomplete import ModelSelect2 + +import datetime + +from django.db.models import Q +from django.utils.text import slugify + +from django_filters import FilterSet, MethodFilter, ModelChoiceFilter + +from representatives.models import Chamber, Group, Representative + + +def chamber_filter(qs, value): + today = datetime.date.today() + return qs.filter( + Q(mandates__end_date__gte=today) | Q(mandates__end_date__isnull=True), + mandates__group__chamber=value + ) + + +def group_filter(qs, value): + today = datetime.date.today() + return qs.filter( + Q(mandates__end_date__gte=today) | Q(mandates__end_date__isnull=True), + mandates__group=value + ) + + +class RepresentativeFilter(FilterSet): + + search = MethodFilter(action='search_filter') + + chamber = ModelChoiceFilter(queryset=Chamber.objects.all(), + action=chamber_filter) + + country = ModelChoiceFilter(queryset=Group.objects.filter(kind='country'), + action=group_filter) + + group = ModelChoiceFilter(queryset=Group.objects.exclude( + kind__in=['chamber', 'country']), + action=group_filter, + widget=ModelSelect2(url='group-autocomplete'), + label='Party, committee or delegation') + + class Meta: + model = Representative + fields = ['search', 'chamber', 'country'] + + def search_filter(self, qs, value): + if len(value) == 0: + return qs + + return qs.filter(slug__icontains=slugify(value)) diff --git a/memopol/tests/response_fixtures/DossiersTest.test_dossier_detail.content b/memopol/tests/response_fixtures/DossiersTest.test_dossier_detail.content index 9d4162d578569f2b62f9b22fed61a38da9f97d52..118a0cb6b8eae966ac205fa8f9314095478874bb 100644 --- a/memopol/tests/response_fixtures/DossiersTest.test_dossier_detail.content +++ b/memopol/tests/response_fixtures/DossiersTest.test_dossier_detail.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> diff --git a/memopol/tests/response_fixtures/DossiersTest.test_dossier_list.content b/memopol/tests/response_fixtures/DossiersTest.test_dossier_list.content index c56ee920b4eaf766a9b2b276c48f80578590ec63..8cd7c395b33d83d6fcb74e6a983fbebc0c770556 100644 --- a/memopol/tests/response_fixtures/DossiersTest.test_dossier_list.content +++ b/memopol/tests/response_fixtures/DossiersTest.test_dossier_list.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -126,28 +126,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_active_committees.content b/memopol/tests/response_fixtures/GroupListTest.test_active_committees.content index 8e578949692653decaf99a01553c7582e952497c..e5a0dcb97d810264fdcfa9edfce1cb7c540b9698 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_active_committees.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_active_committees.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -130,7 +130,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?&active_only=0'> all data </a> @@ -142,28 +142,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_active_delegations.content b/memopol/tests/response_fixtures/GroupListTest.test_active_delegations.content index 41ca09e5c0312a4a6a79acfc4f69130a64476565..535ed9a176d5200933b4eeba492178bfaee1b193 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_active_delegations.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_active_delegations.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -152,7 +152,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?&active_only=0'> all data </a> @@ -164,28 +164,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content b/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content index 370f2dcd0ee7398fbfec04d599214596429b1e4f..5411c42a78fad7e28769e8597298b65b1c565d2f 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -130,7 +130,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?&active_only=0'> all data </a> @@ -142,28 +142,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_all_committees.content b/memopol/tests/response_fixtures/GroupListTest.test_all_committees.content index 78fa76a623186d492b1c89c61d220db5c5f5a50a..e57acf0f2f8e050ad2991a5a3967a04f3e3566c1 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_all_committees.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_all_committees.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -129,7 +129,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?&active_only=1'> current legislature only </a> / all data @@ -142,28 +142,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_all_delegations.content b/memopol/tests/response_fixtures/GroupListTest.test_all_delegations.content index 09b3506ac084e0a5a492fa116f71e20b60b3017d..332811c79302040f5a17d472abf0d3c6bd9d58bb 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_all_delegations.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_all_delegations.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -151,7 +151,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?&active_only=1'> current legislature only </a> / all data @@ -164,28 +164,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content b/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content index 56aab28397e9d8149e549b48c2dfbfab20bb8b97..b2b606aa01625ec0a1f77b4123f5c61802007e10 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -140,7 +140,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?&active_only=1'> current legislature only </a> / all data @@ -153,28 +153,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.content b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.content new file mode 100644 index 0000000000000000000000000000000000000000..84f648bdb135367dd7e49247385a46bac95e3b12 --- /dev/null +++ b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.content @@ -0,0 +1 @@ +{"pagination": {"more": true}, "results": [{"text": "Committee on Agriculture and Rural Development", "id": 47}, {"text": "Committee on Budgetary Control", "id": 89}, {"text": "Committee on Budgets", "id": 34}, {"text": "Committee on Civil Liberties, Justice and Home Affairs", "id": 7}, {"text": "Committee on Constitutional Affairs", "id": 37}, {"text": "Committee on Culture and Education", "id": 20}, {"text": "Committee on Economic and Monetary Affairs", "id": 30}, {"text": "Committee on Employment and Social Affairs", "id": 3}, {"text": "Committee on Fisheries", "id": 55}, {"text": "Committee on Foreign Affairs", "id": 5}]} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.metadata b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.content b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.content new file mode 100644 index 0000000000000000000000000000000000000000..ecdf253bb5745ad8d8055f108ddcba13d899c58a --- /dev/null +++ b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.content @@ -0,0 +1 @@ +{"pagination": {"more": false}, "results": [{"text": "Committee on Agriculture and Rural Development", "id": 47}, {"text": "Committee on Regional Development", "id": 24}]} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.metadata b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/GroupListTest.test_autocomplete_query.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/GroupListTest.test_chambers.content b/memopol/tests/response_fixtures/GroupListTest.test_chambers.content index ddcc0c32cc3964cee7df5972c629865dd700e92e..a25c4e75c2756b1a1cecdcb7f4d971eee83452fe 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_chambers.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_chambers.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -97,28 +97,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_country.content b/memopol/tests/response_fixtures/GroupListTest.test_country.content index 46407dc23a2afa4b90a925840bd6c9e70a7caa0d..d749e778ce190c79ca9d3380f119e81f0209349d 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_country.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_country.content @@ -10,7 +10,7 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> @@ -142,28 +142,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?&paginate_by=96'> 96 </a> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content new file mode 100644 index 0000000000000000000000000000000000000000..e43743c271267cb3e3fc4f068e9401a5e4cf2f57 --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content @@ -0,0 +1,869 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="">---------</option> +<option value="1" selected="selected">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + + <li class='active'> + <a href=''> + 1 + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=2'> + 2 + + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=3'> + 3 + + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=4'> + 4 + + </a> + </li> + + + + + <li> + <a aria-label='Next' href='?country=&search=&group=&chamber=1&page=2'> + <i aria-hidden="true" class="fa fa-chevron-right"></i> + + </a> + </li> + <li> + <a aria-label='Last' href='?country=&search=&group=&chamber=1&page=21'> + <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> + + </a> + </li> + + </ul> + </nav> + <div class='count'> + Number of results : 252 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=&group=&chamber=1&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=&group=&chamber=1&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=&group=&chamber=1&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=&group=&chamber=1&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + <div class='representative_grid'> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Lithuania/'> + <span class="flag-icon flag-icon-lt"></span> Lithuania + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + </div> + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + + <li class='active'> + <a href=''> + 1 + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=2'> + 2 + + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=3'> + 3 + + </a> + </li> + + + + + + <li> + <a href='?country=&search=&group=&chamber=1&page=4'> + 4 + + </a> + </li> + + + + + <li> + <a aria-label='Next' href='?country=&search=&group=&chamber=1&page=2'> + <i aria-hidden="true" class="fa fa-chevron-right"></i> + + </a> + </li> + <li> + <a aria-label='Last' href='?country=&search=&group=&chamber=1&page=21'> + <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> + + </a> + </li> + + </ul> + </nav> + <div class='count'> + Number of results : 252 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=&group=&chamber=1&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=&group=&chamber=1&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=&group=&chamber=1&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=&group=&chamber=1&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=&group=&chamber=1&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.content new file mode 100644 index 0000000000000000000000000000000000000000..4d3da60e7ab8c39db99aac6c24dacc5e6d563abe --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.content @@ -0,0 +1,485 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110" selected="selected">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 4 + + + <br /> + Display : + + current legislature only / + <a href='?country=110&search=&group=&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=110&search=&group=&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=110&search=&group=&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=110&search=&group=&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + <div class='representative_grid'> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/yannick-jadot/'> + <img src='http://www.europarl.europa.eu/mepphoto/96740.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/yannick-jadot/'> + Yannick JADOT + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/eva-joly/'> + <img src='http://www.europarl.europa.eu/mepphoto/96883.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/eva-joly/'> + Eva JOLY + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + </div> + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 4 + + + <br /> + Display : + + current legislature only / + <a href='?country=110&search=&group=&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=110&search=&group=&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=110&search=&group=&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=110&search=&group=&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=110&search=&group=&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_country.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.content new file mode 100644 index 0000000000000000000000000000000000000000..2143b3648b0f9a4779a428f086b43d84748f864c --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.content @@ -0,0 +1,554 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="">---------</option> +<option value="17" selected="selected">Group of the Alliance of Liberals and Democrats for Europe</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 6 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=&group=17&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=&group=17&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=&group=17&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=&group=17&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + <div class='representative_grid'> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/marian-harkin/'> + <img src='http://www.europarl.europa.eu/mepphoto/28116.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/marian-harkin/'> + Marian HARKIN + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Ireland/'> + <span class="flag-icon flag-icon-ie"></span> Ireland + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/frederique-ries/'> + <img src='http://www.europarl.europa.eu/mepphoto/4253.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/frederique-ries/'> + Frédérique RIES + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Belgium/'> + <span class="flag-icon flag-icon-be"></span> Belgium + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-success">3</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + <img src='http://www.europarl.europa.eu/mepphoto/97203.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + Ramon TREMOSA i BALCELLS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Spain/'> + <span class="flag-icon flag-icon-es"></span> Spain + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/ivo-vajgl/'> + <img src='http://www.europarl.europa.eu/mepphoto/97019.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/ivo-vajgl/'> + Ivo VAJGL + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Slovenia/'> + <span class="flag-icon flag-icon-si"></span> Slovenia + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/cecilia-wikstrom/'> + <img src='http://www.europarl.europa.eu/mepphoto/96677.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/cecilia-wikstrom/'> + Cecilia WIKSTRÖM + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Sweden/'> + <span class="flag-icon flag-icon-se"></span> Sweden + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-7</span> + + </li> + </ul> + </div> + + </div> + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 6 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=&group=17&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=&group=17&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=&group=17&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=&group=17&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=&group=17&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_group.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.content new file mode 100644 index 0000000000000000000000000000000000000000..c7ad17e354f928d460d3c892218bae093627de83 --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.content @@ -0,0 +1,554 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="e" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="">---------</option> +<option value="1" selected="selected">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110" selected="selected">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="">---------</option> +<option value="17" selected="selected">Group of the Alliance of Liberals and Democrats for Europe</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 6 + + + <br /> + Display : + + current legislature only / + <a href='?country=110&search=e&group=17&chamber=1&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=110&search=e&group=17&chamber=1&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=110&search=e&group=17&chamber=1&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + <div class='representative_grid'> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + </div> + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 6 + + + <br /> + Display : + + current legislature only / + <a href='?country=110&search=e&group=17&chamber=1&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=110&search=e&group=17&chamber=1&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=110&search=e&group=17&chamber=1&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=110&search=e&group=17&chamber=1&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_multiple.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.content new file mode 100644 index 0000000000000000000000000000000000000000..36bed4ed779cbafbb7e83e6dc42cb05f7cfdf5a0 --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.content @@ -0,0 +1,198 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="non-existing-rep-name" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='no-results'>No matching representatives found :(</div> + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_notfound.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.content new file mode 100644 index 0000000000000000000000000000000000000000..5f6741576f83ea2af8c85c8812ec42d1bab3e63c --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.content @@ -0,0 +1,451 @@ +<!DOCTYPE html> +<html class="no-js" lang="en"> <!--<![endif]--> + <head> + <meta charset="utf-8" /> + <link rel="icon" type="image/png" href="/static/collected/img/favicon.ico" /> + <!-- Set the viewport width to device width for mobile --> + <meta name="viewport" content="width=device-width" /> + <title> + Home + - The Political Memory of </title> + + + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> + <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> +<script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + + </head> + <body > + <!-- -load memopol_tags cache --> + + + + +<div id='header' class='container-fluid'> + <a id='logo' href='/'> + <img src='/static/collected/images/logo.png' /> + </a> + <h1> + <a id='header_banner' href='/'> + Political Memory + </a> + </h1> + <p class='organization'> + + + </p> +</div> +<div id='nav' class='container-fluid'> + <ul class='nav'> + <li> + <a href='/legislature/representative/'> + Representatives + </a> + </li> + <li> + <a href='/legislature/group/country/'> + Countries + </a> + </li> + <li> + <a href='/legislature/group/chamber/'> + Chambers + </a> + </li> + <li> + <a href='/legislature/group/group/'> + Parties + </a> + </li> + <li> + <a href='/legislature/group/delegation/'> + Delegations + </a> + </li> + <li> + <a href='/legislature/group/committee/'> + Committees + </a> + </li> + <li> + <a href='/votes/dossier/'> + Dossiers + + </a> + </li> + </ul> +</div> + + <div class="container-fluid main-container"> + + + + + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="am" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + + + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 3 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=am&group=&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=am&group=&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=am&group=&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=am&group=&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + <div class='representative_grid'> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/michael-cramer/'> + <img src='http://www.europarl.europa.eu/mepphoto/28238.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/michael-cramer/'> + Michael CRAMER + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Germany/'> + <span class="flag-icon flag-icon-de"></span> Germany + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </li> + <li class='score'> + <span class="label label-danger">-15</span> + + </li> + </ul> + </div> + + <div class='representative_item active'> + <p class='photo'> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + <img src='http://www.europarl.europa.eu/mepphoto/97203.jpg' width='80' /> + </a> + </p> + <ul> + <li class='name'> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + Ramon TREMOSA i BALCELLS + </a> + </li> + <li class='chamber'> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + </a> + </li> + <li class='country'> + <a href='/legislature/representative/country/Spain/'> + <span class="flag-icon flag-icon-es"></span> Spain + </a> + </li> + <li class='mandate'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </li> + <li class='score'> + <span class="label label-success">15</span> + + </li> + </ul> + </div> + + </div> + + + <div class='pagination-block'> + + <nav> + <ul class='pagination pagination-sm'> + + + + </ul> + </nav> + <div class='count'> + Number of results : 3 + + + <br /> + Display : + + current legislature only / + <a href='?country=&search=am&group=&chamber=&active_only=0'> + all data + </a> + + + + + <br /> + Number of displayed results : + 12 + ( + + <a href='?country=&search=am&group=&chamber=&paginate_by=12'> + 12 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=24'> + 24 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=48'> + 48 + </a> + + / + + + <a href='?country=&search=am&group=&chamber=&paginate_by=96'> + 96 + </a> + + + ) + + <span class='grid-list-selector'> + <a href='?country=&search=am&group=&chamber=&display=grid'> + <i class="fa fa-th"></i> + </a> + <a href='?country=&search=am&group=&chamber=&display=list'> + <i class="fa fa-th-list"></i> + + </a> +</span> + + + + </div> +</div> + + + + + + </div> + + +<div id='footer' class='container-fluid'> + <div class='license-links'> + + Memopol is + <a href='https://github.com/political-memory/political_memory'>free software</a> + released under the terms of the + <a href='http://www.gnu.org/licenses/agpl.html'>GNU aGPLV3+</a> + + </div> + <div class='footer-link'> + <a href='https://github.com/political-memory/political_memory/issues/new'>Report a bug</a> + </div> + <div class='footer-link'> + <a href='http://www.memopol.org/'>Blog</a> + </div> + <div class='footer-link'> + <a href='http://memopol.readthedocs.io/en/master/'>Documentation</a> + </div> + <div class='footer-separator'></div> + <div class='footer-link'> + Developed by + <a href='http://www.laquadrature.net/'>La Quadrature du Net</a> + </div> + <div class='footer-link'> + EP data provided by + <a href='http://parltrack.euwiki.org/'>Parltrack</a> + </div> +</div> + + </body> +</html> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.metadata b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.metadata new file mode 100644 index 0000000000000000000000000000000000000000..a2e0a6921bc4a7d94e1887a6eab7a49889fc3ace --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_search.metadata @@ -0,0 +1,3 @@ +{ + "status_code": 200 +} \ No newline at end of file diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content index 61d4422198d36fb499b81e77a6dc1fb657e4ae26..0250a0930ea8fda297a6b98a24e21f2c5315b990 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,21 +90,74 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> - </form> - <a href='?csv'> - Download data as CSV - </a> - <div class='pagination-block'> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -114,7 +176,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -125,7 +187,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -135,13 +197,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -157,7 +219,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -169,28 +231,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -198,10 +260,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -213,467 +275,467 @@ </div> - + - <table class='table'> - <tr> - <th> - Photo - </th> - <th> - Name - </th> - <th> - Chamber - </th> - <th> - Country - </th> - <th> - Group - </th> - <th> - Score - - </th> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/zigmantas-balcytis/'> - <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/zigmantas-balcytis/'> - Zigmantas BALÄŒYTIS - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Lithuania/'> - Lithuania [LT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/vilija-blinkeviciute/'> - <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/vilija-blinkeviciute/'> - Vilija BLINKEVIÄŒIŪTÄ– - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Lithuania/'> - Lithuania [LT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/elmar-brok/'> - <img src='http://www.europarl.europa.eu/mepphoto/1263.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/elmar-brok/'> - Elmar BROK - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-10</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/cristian-silviu-busoi/'> - <img src='http://www.europarl.europa.eu/mepphoto/38420.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/cristian-silviu-busoi/'> - Cristian-Silviu BUÅžOI - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> + <table class='table'> + <tr> + <th> + Photo + </th> + <th> + Name + </th> + <th> + Chamber + </th> + <th> + Country + </th> + <th> + Group + </th> + <th> + Score + + </th> </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/david-casa/'> - <img src='http://www.europarl.europa.eu/mepphoto/28122.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/david-casa/'> - David CASA - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Malta/'> - Malta [MT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/jean-marie-cavada/'> - <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/jean-marie-cavada/'> - Jean-Marie CAVADA - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/nikolaos-chountis/'> - <img src='http://www.europarl.europa.eu/mepphoto/26851.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/nikolaos-chountis/'> - Nikolaos CHOUNTIS - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Greece/'> - Greece [GR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Confederal%20Group%20of%20the%20European%20United%20Left%20-%20Nordic%20Green%20Left/'> - <span class="group-icon group-icon-guengl"></span> GUE/NGL - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/michael-cramer/'> - <img src='http://www.europarl.europa.eu/mepphoto/28238.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/michael-cramer/'> - Michael CRAMER - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/bas-eickhout/'> - <img src='http://www.europarl.europa.eu/mepphoto/96725.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/bas-eickhout/'> - Bas EICKHOUT - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Netherlands/'> - Netherlands [NL] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - </table> - + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Lithuania/'> + Lithuania [LT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Lithuania/'> + Lithuania [LT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/elmar-brok/'> + <img src='http://www.europarl.europa.eu/mepphoto/1263.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/elmar-brok/'> + Elmar BROK + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-10</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/cristian-silviu-busoi/'> + <img src='http://www.europarl.europa.eu/mepphoto/38420.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/cristian-silviu-busoi/'> + Cristian-Silviu BUÅžOI + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Romania/'> + Romania [RO] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/david-casa/'> + <img src='http://www.europarl.europa.eu/mepphoto/28122.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/david-casa/'> + David CASA + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Malta/'> + Malta [MT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/nikolaos-chountis/'> + <img src='http://www.europarl.europa.eu/mepphoto/26851.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/nikolaos-chountis/'> + Nikolaos CHOUNTIS + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Greece/'> + Greece [GR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Confederal%20Group%20of%20the%20European%20United%20Left%20-%20Nordic%20Green%20Left/'> + <span class="group-icon group-icon-guengl"></span> GUE/NGL + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/michael-cramer/'> + <img src='http://www.europarl.europa.eu/mepphoto/28238.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/michael-cramer/'> + Michael CRAMER + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Romania/'> + Romania [RO] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/bas-eickhout/'> + <img src='http://www.europarl.europa.eu/mepphoto/96725.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/bas-eickhout/'> + Bas EICKHOUT + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Netherlands/'> + Netherlands [NL] - <div class='pagination-block'> + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + </table> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -692,7 +754,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -703,7 +765,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -713,13 +775,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -735,7 +797,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -747,28 +809,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -776,10 +838,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -791,6 +853,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content index 1c99e4ea2434e56140c399a003332e37dca11aba..84db20acd8b778afe9e1a28c5d5e2e61d77aa8d7 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,21 +90,74 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> - </form> - <a href='?csv'> - Download data as CSV - </a> - <div class='pagination-block'> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -114,7 +176,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -125,7 +187,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -135,13 +197,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -156,7 +218,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?search=&active_only=1'> current legislature only </a> / all data @@ -169,28 +231,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -198,10 +260,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -213,467 +275,467 @@ </div> - + - <table class='table'> - <tr> - <th> - Photo - </th> - <th> - Name - </th> - <th> - Chamber - </th> - <th> - Country - </th> - <th> - Group - </th> - <th> - Score - - </th> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/zigmantas-balcytis/'> - <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/zigmantas-balcytis/'> - Zigmantas BALÄŒYTIS - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Lithuania/'> - Lithuania [LT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/vilija-blinkeviciute/'> - <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/vilija-blinkeviciute/'> - Vilija BLINKEVIÄŒIŪTÄ– - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Lithuania/'> - Lithuania [LT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/elmar-brok/'> - <img src='http://www.europarl.europa.eu/mepphoto/1263.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/elmar-brok/'> - Elmar BROK - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-10</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/cristian-silviu-busoi/'> - <img src='http://www.europarl.europa.eu/mepphoto/38420.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/cristian-silviu-busoi/'> - Cristian-Silviu BUÅžOI - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> + <table class='table'> + <tr> + <th> + Photo + </th> + <th> + Name + </th> + <th> + Chamber + </th> + <th> + Country + </th> + <th> + Group + </th> + <th> + Score + + </th> </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/david-casa/'> - <img src='http://www.europarl.europa.eu/mepphoto/28122.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/david-casa/'> - David CASA - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Malta/'> - Malta [MT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/jean-marie-cavada/'> - <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/jean-marie-cavada/'> - Jean-Marie CAVADA - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/nikolaos-chountis/'> - <img src='http://www.europarl.europa.eu/mepphoto/26851.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/nikolaos-chountis/'> - Nikolaos CHOUNTIS - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Greece/'> - Greece [GR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Confederal%20Group%20of%20the%20European%20United%20Left%20-%20Nordic%20Green%20Left/'> - <span class="group-icon group-icon-guengl"></span> GUE/NGL - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/michael-cramer/'> - <img src='http://www.europarl.europa.eu/mepphoto/28238.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/michael-cramer/'> - Michael CRAMER - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/bas-eickhout/'> - <img src='http://www.europarl.europa.eu/mepphoto/96725.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/bas-eickhout/'> - Bas EICKHOUT - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Netherlands/'> - Netherlands [NL] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - </table> - + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/zigmantas-balcytis/'> + <img src='http://www.europarl.europa.eu/mepphoto/96680.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/zigmantas-balcytis/'> + Zigmantas BALÄŒYTIS + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Lithuania/'> + Lithuania [LT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/vilija-blinkeviciute/'> + <img src='http://www.europarl.europa.eu/mepphoto/96681.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/vilija-blinkeviciute/'> + Vilija BLINKEVIÄŒIŪTÄ– + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Lithuania/'> + Lithuania [LT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/elmar-brok/'> + <img src='http://www.europarl.europa.eu/mepphoto/1263.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/elmar-brok/'> + Elmar BROK + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-10</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/cristian-silviu-busoi/'> + <img src='http://www.europarl.europa.eu/mepphoto/38420.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/cristian-silviu-busoi/'> + Cristian-Silviu BUÅžOI + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Romania/'> + Romania [RO] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/david-casa/'> + <img src='http://www.europarl.europa.eu/mepphoto/28122.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/david-casa/'> + David CASA + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Malta/'> + Malta [MT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/jean-marie-cavada/'> + <img src='http://www.europarl.europa.eu/mepphoto/28206.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/jean-marie-cavada/'> + Jean-Marie CAVADA + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/nikolaos-chountis/'> + <img src='http://www.europarl.europa.eu/mepphoto/26851.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/nikolaos-chountis/'> + Nikolaos CHOUNTIS + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Greece/'> + Greece [GR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Confederal%20Group%20of%20the%20European%20United%20Left%20-%20Nordic%20Green%20Left/'> + <span class="group-icon group-icon-guengl"></span> GUE/NGL + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/michael-cramer/'> + <img src='http://www.europarl.europa.eu/mepphoto/28238.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/michael-cramer/'> + Michael CRAMER + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Romania/'> + Romania [RO] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/bas-eickhout/'> + <img src='http://www.europarl.europa.eu/mepphoto/96725.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/bas-eickhout/'> + Bas EICKHOUT + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Netherlands/'> + Netherlands [NL] - <div class='pagination-block'> + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + </table> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -692,7 +754,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -703,7 +765,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -713,13 +775,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -734,7 +796,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?search=&active_only=1'> current legislature only </a> / all data @@ -747,28 +809,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -776,10 +838,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -791,6 +853,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly.content index 09e3ad59bb30cd19fd2a3c131006fe2c2f1a6271..d9984e38c18eac8ace05c0e371e0bba77e5d6e97 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,21 +90,74 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="joly" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> - </form> - <a href='?search=joly&csv'> - Download data as CSV - </a> - <div class='pagination-block'> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -112,7 +174,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=joly&active_only=0'> all data </a> @@ -124,28 +186,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=joly&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=joly&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=joly&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=joly&paginate_by=96'> 96 </a> @@ -153,10 +215,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=joly&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=joly&display=list'> <i class="fa fa-th-list"></i> </a> @@ -168,71 +230,71 @@ </div> - + - <table class='table'> - <tr> - <th> - Photo - </th> - <th> - Name - </th> - <th> - Chamber - </th> - <th> - Country - </th> - <th> - Group - </th> - <th> - Score - - </th> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/eva-joly/'> - <img src='http://www.europarl.europa.eu/mepphoto/96883.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/eva-joly/'> - Eva JOLY - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> + <table class='table'> + <tr> + <th> + Photo + </th> + <th> + Name + </th> + <th> + Chamber + </th> + <th> + Country + </th> + <th> + Group + </th> + <th> + Score + + </th> </tr> - - </table> - + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/eva-joly/'> + <img src='http://www.europarl.europa.eu/mepphoto/96883.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/eva-joly/'> + Eva JOLY + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + </table> + - <div class='pagination-block'> + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -249,7 +311,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=joly&active_only=0'> all data </a> @@ -261,28 +323,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=joly&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=joly&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=joly&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=joly&paginate_by=96'> 96 </a> @@ -290,10 +352,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=joly&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=joly&display=list'> <i class="fa fa-th-list"></i> </a> @@ -305,6 +367,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content index 290d214dcf2137e630bbd56a4e10528d1bdfe18c..3cb5bef41b080c32865fd89740f99bddde87ac2c 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,21 +90,74 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + - </form> - <a href='?csv'> - Download data as CSV +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + - </a> - <div class='pagination-block'> + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -114,7 +176,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -124,13 +186,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=2'> + <a aria-label='Last' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -146,7 +208,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -158,28 +220,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -187,10 +249,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -202,7 +264,7 @@ </div> - + <div class='representative_grid'> @@ -1025,7 +1087,7 @@ </div> - <div class='pagination-block'> + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -1044,7 +1106,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -1054,13 +1116,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=2'> + <a aria-label='Last' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -1076,7 +1138,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -1088,28 +1150,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -1117,10 +1179,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -1132,6 +1194,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content index aba16914bd6937a6a51d0e3c74d9286acf416a6d..a2c53d554e530995494f96a0fdd455cd651a684c 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,21 +90,74 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + - </form> - <a href='?csv'> - Download data as CSV +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> + + + - </a> - <div class='pagination-block'> + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -114,7 +176,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -124,13 +186,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=2'> + <a aria-label='Last' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -145,7 +207,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?search=&active_only=1'> current legislature only </a> / all data @@ -158,28 +220,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -187,10 +249,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -202,7 +264,7 @@ </div> - + <div class='representative_grid'> @@ -1025,7 +1087,7 @@ </div> - <div class='pagination-block'> + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> @@ -1044,7 +1106,7 @@ <li> - <a href='?&page=2'> + <a href='?search=&page=2'> 2 </a> @@ -1054,13 +1116,13 @@ <li> - <a aria-label='Next' href='?&page=2'> + <a aria-label='Next' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=2'> + <a aria-label='Last' href='?search=&page=2'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -1075,7 +1137,7 @@ <br /> Display : - <a href='?active_only=1'> + <a href='?search=&active_only=1'> current legislature only </a> / all data @@ -1088,28 +1150,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -1117,10 +1179,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -1132,6 +1194,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content index 3241af3d4288367fa2299675393d7f9f92aaa6a7..294423ff161be09fc9d063aeeeb3ab93a330c695 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,33 +90,86 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> - </form> - <a href='?csv'> - Download data as CSV - </a> - <div class='pagination-block'> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> <li> - <a aria-label='First' href='?&page=1'> + <a aria-label='First' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-circle-left"></i> </a> </li> <li> - <a aria-label='Previous' href='?&page=1'> + <a aria-label='Previous' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-left"></i> </a> @@ -117,7 +179,7 @@ <li> - <a href='?&page=1'> + <a href='?search=&page=1'> 1 </a> @@ -138,7 +200,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -148,13 +210,13 @@ <li> - <a aria-label='Next' href='?&page=3'> + <a aria-label='Next' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -170,7 +232,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -182,28 +244,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -211,10 +273,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -226,479 +288,479 @@ </div> - + - <table class='table'> - <tr> - <th> - Photo - </th> - <th> - Name - </th> - <th> - Chamber - </th> - <th> - Country - </th> - <th> - Group - </th> - <th> - Score - - </th> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/ismail-ertug/'> - <img src='http://www.europarl.europa.eu/mepphoto/96842.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/ismail-ertug/'> - Ismail ERTUG - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">10</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/jose-manuel-fernandes/'> - <img src='http://www.europarl.europa.eu/mepphoto/96899.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/jose-manuel-fernandes/'> - José Manuel FERNANDES - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Portugal/'> - Portugal [PT] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/monika-flasikova-benova/'> - <img src='http://www.europarl.europa.eu/mepphoto/23868.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/monika-flasikova-benova/'> - Monika FLAÅ ÃKOVà BEŇOVà - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Slovakia/'> - Slovakia [SK] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/ashley-fox/'> - <img src='http://www.europarl.europa.eu/mepphoto/96957.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/ashley-fox/'> - Ashley FOX - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/United%20Kingdom/'> - United Kingdom [GB] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - <span class="group-icon group-icon-ecr"></span> ECR - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> + <table class='table'> + <tr> + <th> + Photo + </th> + <th> + Name + </th> + <th> + Chamber + </th> + <th> + Country + </th> + <th> + Group + </th> + <th> + Score + + </th> </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - Eider GARDIAZABAL RUBIAL - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Spain/'> - Spain [ES] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/kinga-gal/'> - <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/kinga-gal/'> - Kinga GÃL - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - Ildikó GÃLL-PELCZ - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/marian-harkin/'> - <img src='http://www.europarl.europa.eu/mepphoto/28116.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/marian-harkin/'> - Marian HARKIN - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Ireland/'> - Ireland [IE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/mary-honeyball/'> - <img src='http://www.europarl.europa.eu/mepphoto/5846.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/mary-honeyball/'> - Mary HONEYBALL - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/United%20Kingdom/'> - United Kingdom [GB] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-danger">-7</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/iliana-iotova/'> - <img src='http://www.europarl.europa.eu/mepphoto/38605.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/iliana-iotova/'> - Iliana IOTOVA - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Bulgaria/'> - Bulgaria [BG] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/liisa-jaakonsaari/'> - <img src='http://www.europarl.europa.eu/mepphoto/96684.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/liisa-jaakonsaari/'> - Liisa JAAKONSAARI - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Finland/'> - Finland [FI] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/yannick-jadot/'> - <img src='http://www.europarl.europa.eu/mepphoto/96740.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/yannick-jadot/'> - Yannick JADOT - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - </table> - + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/ismail-ertug/'> + <img src='http://www.europarl.europa.eu/mepphoto/96842.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/ismail-ertug/'> + Ismail ERTUG + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">10</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/jose-manuel-fernandes/'> + <img src='http://www.europarl.europa.eu/mepphoto/96899.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/jose-manuel-fernandes/'> + José Manuel FERNANDES + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Portugal/'> + Portugal [PT] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/monika-flasikova-benova/'> + <img src='http://www.europarl.europa.eu/mepphoto/23868.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/monika-flasikova-benova/'> + Monika FLAÅ ÃKOVà BEŇOVà + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Slovakia/'> + Slovakia [SK] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/ashley-fox/'> + <img src='http://www.europarl.europa.eu/mepphoto/96957.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/ashley-fox/'> + Ashley FOX + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/United%20Kingdom/'> + United Kingdom [GB] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <span class="group-icon group-icon-ecr"></span> ECR + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + Eider GARDIAZABAL RUBIAL + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Spain/'> + Spain [ES] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/kinga-gal/'> + <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/kinga-gal/'> + Kinga GÃL + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/ildiko-gall-pelcz/'> + <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/ildiko-gall-pelcz/'> + Ildikó GÃLL-PELCZ + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/marian-harkin/'> + <img src='http://www.europarl.europa.eu/mepphoto/28116.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/marian-harkin/'> + Marian HARKIN + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Ireland/'> + Ireland [IE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/mary-honeyball/'> + <img src='http://www.europarl.europa.eu/mepphoto/5846.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/mary-honeyball/'> + Mary HONEYBALL + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/United%20Kingdom/'> + United Kingdom [GB] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-danger">-7</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/iliana-iotova/'> + <img src='http://www.europarl.europa.eu/mepphoto/38605.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/iliana-iotova/'> + Iliana IOTOVA + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Bulgaria/'> + Bulgaria [BG] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/liisa-jaakonsaari/'> + <img src='http://www.europarl.europa.eu/mepphoto/96684.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/liisa-jaakonsaari/'> + Liisa JAAKONSAARI + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Finland/'> + Finland [FI] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/yannick-jadot/'> + <img src='http://www.europarl.europa.eu/mepphoto/96740.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/yannick-jadot/'> + Yannick JADOT + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] - <div class='pagination-block'> + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + </table> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> <li> - <a aria-label='First' href='?&page=1'> + <a aria-label='First' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-circle-left"></i> </a> </li> <li> - <a aria-label='Previous' href='?&page=1'> + <a aria-label='Previous' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-left"></i> </a> @@ -708,7 +770,7 @@ <li> - <a href='?&page=1'> + <a href='?search=&page=1'> 1 </a> @@ -729,7 +791,7 @@ <li> - <a href='?&page=3'> + <a href='?search=&page=3'> 3 </a> @@ -739,13 +801,13 @@ <li> - <a aria-label='Next' href='?&page=3'> + <a aria-label='Next' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-right"></i> </a> </li> <li> - <a aria-label='Last' href='?&page=3'> + <a aria-label='Last' href='?search=&page=3'> <i aria-hidden="true" class="fa fa-chevron-circle-right"></i> </a> @@ -761,7 +823,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -773,28 +835,28 @@ 12 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -802,10 +864,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -817,6 +879,8 @@ </div> + + </div> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist.content index 46dbdc6bb534cb0ca7883d1781c42fe91ab89a24..b6cb3a318c114113da3d7f6d9814030a60cac77d 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist.content @@ -10,10 +10,19 @@ - The Political Memory of </title> - <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.c7d56d0a17c9.css" type="text/css" /> + <link rel="stylesheet" href="/static/collected/libs/bootstrap/dist/css/bootstrap.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/fontawesome/css/font-awesome.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/libs/flag-icon-css/css/flag-icon.min.css" type="text/css" /><link rel="stylesheet" href="/static/collected/CACHE/css/base.540ce621a9a1.css" type="text/css" /> <script type="text/javascript" src="/static/collected/libs/jquery/dist/jquery.js"></script> <script type="text/javascript" src="/static/collected/libs/bootstrap/dist/js/bootstrap.js"></script> + + <link href="/static/collected/autocomplete_light/vendor/select2/dist/css/select2.css" type="text/css" media="all" rel="stylesheet" /> +<link href="/static/collected/autocomplete_light/select2.css" type="text/css" media="all" rel="stylesheet" /> +<script type="text/javascript" src="/static/collected/autocomplete_light/jquery.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/autocomplete.init.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/vendor/select2/dist/js/select2.full.js"></script> +<script type="text/javascript" src="/static/collected/autocomplete_light/select2.js"></script> + + </head> <body > <!-- -load memopol_tags cache --> @@ -81,33 +90,86 @@ - <form action='' method='get'> - <label for='search'> - Search - </label> - <input id='search' type='text' name='search' /> - <input type='submit' value='Go' /> + + + +<form class='filter-form' action='/legislature/representative/' method='get'> + + <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="1">European Parliament [EP]</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_country">Country</label><select class="form-control" id="id_country" name="country" title="Filter"> +<option value="" selected="selected">---------</option> +<option value="106">Austria</option> +<option value="98">Belgium</option> +<option value="117">Bulgaria</option> +<option value="184">Cyprus</option> +<option value="88">Czech Republic</option> +<option value="113">Denmark</option> +<option value="126">Estonia</option> +<option value="115">Finland</option> +<option value="110">France</option> +<option value="22">Germany</option> +<option value="134">Greece</option> +<option value="85">Hungary</option> +<option value="182">Ireland</option> +<option value="100">Italy</option> +<option value="93">Latvia</option> +<option value="145">Lithuania</option> +<option value="112">Luxembourg</option> +<option value="186">Malta</option> +<option value="57">Netherlands</option> +<option value="2">Poland</option> +<option value="109">Portugal</option> +<option value="19">Romania</option> +<option value="169">Slovakia</option> +<option value="120">Slovenia</option> +<option value="91">Spain</option> +<option value="140">Sweden</option> +<option value="33">United Kingdom</option> +</select><span class="help-block">Filter +</span></div> +<div class="form-group has-success"><label class="control-label" for="id_group">Party, committee or delegation</label><select class="form-control" data-autocomplete-light-function="select2" data-autocomplete-light-url="/legislature/autocomplete/group/" id="id_group" name="group" title="Filter"> +<option value="" selected="selected">---------</option> +</select><span class="help-block">Filter +</span></div> + + <div class="form-group"> + <button class='btn btn-primary' type='submit'> + <span class="glyphicon glyphicon-filter"></span> Filter + </button> + </div> + + <div class="form-group"> + <button class='btn btn-default' type='submit' name='csv'> + <span class="glyphicon glyphicon-download-alt"></span> Download as CSV + </button> + </div> + +</form> - </form> - <a href='?csv'> - Download data as CSV - </a> - <div class='pagination-block'> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> <li> - <a aria-label='First' href='?&page=1'> + <a aria-label='First' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-circle-left"></i> </a> </li> <li> - <a aria-label='Previous' href='?&page=1'> + <a aria-label='Previous' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-left"></i> </a> @@ -117,7 +179,7 @@ <li> - <a href='?&page=1'> + <a href='?search=&page=1'> 1 </a> @@ -146,7 +208,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -158,28 +220,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -187,10 +249,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -202,479 +264,479 @@ </div> - + - <table class='table'> - <tr> - <th> - Photo - </th> - <th> - Name - </th> - <th> - Chamber - </th> - <th> - Country - </th> - <th> - Group - </th> - <th> - Score - - </th> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/eva-joly/'> - <img src='http://www.europarl.europa.eu/mepphoto/96883.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/eva-joly/'> - Eva JOLY - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/France/'> - France [FR] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> - <span class="group-icon group-icon-greensefa"></span> Greens/EFA - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/jarosaw-kalinowski/'> - <img src='http://www.europarl.europa.eu/mepphoto/96771.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/jarosaw-kalinowski/'> - JarosÅ‚aw KALINOWSKI - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Poland/'> - Poland [PL] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/andrey-kovatchev/'> - <img src='http://www.europarl.europa.eu/mepphoto/97968.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/andrey-kovatchev/'> - Andrey KOVATCHEV - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Bulgaria/'> - Bulgaria [BG] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/olle-ludvigsson/'> - <img src='http://www.europarl.europa.eu/mepphoto/96673.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/olle-ludvigsson/'> - Olle LUDVIGSSON - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Sweden/'> - Sweden [SE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> + <table class='table'> + <tr> + <th> + Photo + </th> + <th> + Name + </th> + <th> + Chamber + </th> + <th> + Country + </th> + <th> + Group + </th> + <th> + Score + + </th> </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/sirpa-pietikainen/'> - <img src='http://www.europarl.europa.eu/mepphoto/40599.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/sirpa-pietikainen/'> - Sirpa PIETIKÄINEN - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Finland/'> - Finland [FI] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-success">5</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/frederique-ries/'> - <img src='http://www.europarl.europa.eu/mepphoto/4253.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/frederique-ries/'> - Frédérique RIES - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Belgium/'> - Belgium [BE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-success">3</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/birgit-sippel/'> - <img src='http://www.europarl.europa.eu/mepphoto/96932.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/birgit-sippel/'> - Birgit SIPPEL - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Germany/'> - Germany [DE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/charles-tannock/'> - <img src='http://www.europarl.europa.eu/mepphoto/4521.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/charles-tannock/'> - Charles TANNOCK - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/United%20Kingdom/'> - United Kingdom [GB] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - <span class="group-icon group-icon-ecr"></span> ECR - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/ramon-tremosa-i-balcells/'> - <img src='http://www.europarl.europa.eu/mepphoto/97203.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/ramon-tremosa-i-balcells/'> - Ramon TREMOSA i BALCELLS - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Spain/'> - Spain [ES] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/vladimir-urutchev/'> - <img src='http://www.europarl.europa.eu/mepphoto/38601.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/vladimir-urutchev/'> - Vladimir URUTCHEV - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Bulgaria/'> - Bulgaria [BG] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP - </a> - </td> - <td> - <span class="label label-danger">-15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/ivo-vajgl/'> - <img src='http://www.europarl.europa.eu/mepphoto/97019.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/ivo-vajgl/'> - Ivo VAJGL - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Slovenia/'> - Slovenia [SI] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-success">15</span> - - </td> - </tr> - - <tr class='representative_item active'> - <td class='photo'> - <a href='/legislature/representative/cecilia-wikstrom/'> - <img src='http://www.europarl.europa.eu/mepphoto/96677.jpg' width='80' /> - - </a> - </td> - <td> - <a href='/legislature/representative/cecilia-wikstrom/'> - Cecilia WIKSTRÖM - - </a> - </td> - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - European Parliament [EP] - - </a> - </td> - <td> - <a href='/legislature/representative/country/Sweden/'> - Sweden [SE] - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-alde"></span> ALDE - </a> - </td> - <td> - <span class="label label-danger">-7</span> - - </td> - </tr> - - </table> - + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/eva-joly/'> + <img src='http://www.europarl.europa.eu/mepphoto/96883.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/eva-joly/'> + Eva JOLY + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/France/'> + France [FR] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Greens/European%20Free%20Alliance/'> + <span class="group-icon group-icon-greensefa"></span> Greens/EFA + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/jarosaw-kalinowski/'> + <img src='http://www.europarl.europa.eu/mepphoto/96771.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/jarosaw-kalinowski/'> + JarosÅ‚aw KALINOWSKI + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Poland/'> + Poland [PL] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/andrey-kovatchev/'> + <img src='http://www.europarl.europa.eu/mepphoto/97968.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/andrey-kovatchev/'> + Andrey KOVATCHEV + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Bulgaria/'> + Bulgaria [BG] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/olle-ludvigsson/'> + <img src='http://www.europarl.europa.eu/mepphoto/96673.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/olle-ludvigsson/'> + Olle LUDVIGSSON + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Sweden/'> + Sweden [SE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/sirpa-pietikainen/'> + <img src='http://www.europarl.europa.eu/mepphoto/40599.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/sirpa-pietikainen/'> + Sirpa PIETIKÄINEN + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Finland/'> + Finland [FI] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-success">5</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/frederique-ries/'> + <img src='http://www.europarl.europa.eu/mepphoto/4253.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/frederique-ries/'> + Frédérique RIES + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Belgium/'> + Belgium [BE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-success">3</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/birgit-sippel/'> + <img src='http://www.europarl.europa.eu/mepphoto/96932.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/birgit-sippel/'> + Birgit SIPPEL + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Germany/'> + Germany [DE] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/charles-tannock/'> + <img src='http://www.europarl.europa.eu/mepphoto/4521.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/charles-tannock/'> + Charles TANNOCK + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/United%20Kingdom/'> + United Kingdom [GB] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <span class="group-icon group-icon-ecr"></span> ECR + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + <img src='http://www.europarl.europa.eu/mepphoto/97203.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/ramon-tremosa-i-balcells/'> + Ramon TREMOSA i BALCELLS + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Spain/'> + Spain [ES] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/vladimir-urutchev/'> + <img src='http://www.europarl.europa.eu/mepphoto/38601.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/vladimir-urutchev/'> + Vladimir URUTCHEV + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Bulgaria/'> + Bulgaria [BG] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP + </a> + </td> + <td> + <span class="label label-danger">-15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/ivo-vajgl/'> + <img src='http://www.europarl.europa.eu/mepphoto/97019.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/ivo-vajgl/'> + Ivo VAJGL + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Slovenia/'> + Slovenia [SI] + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-success">15</span> + + </td> + </tr> + + <tr class='representative_item active'> + <td class='photo'> + <a href='/legislature/representative/cecilia-wikstrom/'> + <img src='http://www.europarl.europa.eu/mepphoto/96677.jpg' width='80' /> + + </a> + </td> + <td> + <a href='/legislature/representative/cecilia-wikstrom/'> + Cecilia WIKSTRÖM + + </a> + </td> + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + European Parliament [EP] + + </a> + </td> + <td> + <a href='/legislature/representative/country/Sweden/'> + Sweden [SE] - <div class='pagination-block'> + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <span class="group-icon group-icon-alde"></span> ALDE + </a> + </td> + <td> + <span class="label label-danger">-7</span> + + </td> + </tr> + + </table> + + + <div class='pagination-block'> <nav> <ul class='pagination pagination-sm'> <li> - <a aria-label='First' href='?&page=1'> + <a aria-label='First' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-circle-left"></i> </a> </li> <li> - <a aria-label='Previous' href='?&page=1'> + <a aria-label='Previous' href='?search=&page=1'> <i aria-hidden="true" class="fa fa-chevron-left"></i> </a> @@ -684,7 +746,7 @@ <li> - <a href='?&page=1'> + <a href='?search=&page=1'> 1 </a> @@ -713,7 +775,7 @@ Display : current legislature only / - <a href='?active_only=0'> + <a href='?search=&active_only=0'> all data </a> @@ -725,28 +787,28 @@ 24 ( - <a href='?paginate_by=12'> + <a href='?search=&paginate_by=12'> 12 </a> / - <a href='?paginate_by=24'> + <a href='?search=&paginate_by=24'> 24 </a> / - <a href='?paginate_by=48'> + <a href='?search=&paginate_by=48'> 48 </a> / - <a href='?paginate_by=96'> + <a href='?search=&paginate_by=96'> 96 </a> @@ -754,10 +816,10 @@ ) <span class='grid-list-selector'> - <a href='?display=grid'> + <a href='?search=&display=grid'> <i class="fa fa-th"></i> </a> - <a href='?display=list'> + <a href='?search=&display=list'> <i class="fa fa-th-list"></i> </a> @@ -769,6 +831,8 @@ </div> + + </div> diff --git a/memopol/tests/test_group_list.py b/memopol/tests/test_group_list.py index aef6d4eebdf57746da75063240bc0f7ede2a667e..cb1d686b61614c7f0f01bcf4035ff66e7d801f0c 100644 --- a/memopol/tests/test_group_list.py +++ b/memopol/tests/test_group_list.py @@ -55,3 +55,24 @@ class GroupListTest(ResponseDiffMixin, TestCase): # 1 query for committees # 1 query for pagination self.group_test('committee', 0, 2) + + def group_ac_test(self, q, numQueries): + if q: + url = '/legislature/autocomplete/group/?q=%s' % q + else: + url = '/legislature/autocomplete/group/?' + + # setup session variables + self.client.get('%s&active_only=0' % url) + + self.responsediff_test(url, numQueries) + + def test_autocomplete(self): + # 1 query for count + # 1 query for groups + self.group_ac_test(None, 2) + + def test_autocomplete_query(self): + # 1 query for count + # 1 query for groups + self.group_ac_test('development', 2) diff --git a/memopol/tests/test_representatives_list.py b/memopol/tests/test_representatives_list.py index 6bbe9ea7765028b944633821b5711d64cf8077dc..17b666ba2f46f2f5e9906eef3d0e3bb52856ff55 100644 --- a/memopol/tests/test_representatives_list.py +++ b/memopol/tests/test_representatives_list.py @@ -39,9 +39,11 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase): self.client.get('%s&paginate_by=%s&display=%s&active_only=%s' % (url, paginate_by, display, active_only)) - with self.assertNumQueries(3): + with self.assertNumQueries(5): """ - A count for pagination + - One query for chambers (filters) + - One query for countries (filters) - One query for representative + score - One query for mandates (including country + main_mandate) """ @@ -50,6 +52,20 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase): expected = Response.for_test(self) expected.assertNoDiff(self.response) + def filter_test(self, num_queries, search='', country='', chamber='', + group=''): + url = '%s?search=%s&country=%s&chamber=%s&group=%s' % (self.url, + search, country, chamber, group) + + # Cancel out one-time queries (session) + self.client.get('%s&paginate_by=12&active_only=1' % url) + + with self.assertNumQueries(num_queries): + self.response = self.client.get(url) + + expected = Response.for_test(self) + expected.assertNoDiff(self.response) + def test_page1_paginateby12_active_displaylist(self): self.functional_test(1, 12, 1, 'list') @@ -70,3 +86,54 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase): def test_page2_paginateby12_displaylist(self): self.functional_test(2, 12, 1, 'list') + + def test_filter_search(self): + """ + - A count for pagination + - One query for representative + score + - One query for mandates (including country + main_mandate) + - One query for chambers (filters) + - One query for countries (filters) + """ + self.filter_test(5, 'am') + + def test_filter_country(self): + """ + 5 same queries as test_filter_search plus: + - One query for the country + """ + self.filter_test(6, '', 110) + + def test_filter_chamber(self): + """ + 5 same queries as test_filter_search plus: + - One query for the chamber + """ + self.filter_test(6, '', '', 1) + + def test_filter_group(self): + """ + 5 same queries as test_filter_search plus: + - One query for the group + - One query to display the group name (DAL select2 widget) + """ + self.filter_test(7, '', '', '', 17) + + def test_filter_multiple(self): + """ + 5 same queries as test_filter_search plus: + - One query for the country + - One query for the chamber + - One query for the group + - One query to display the group name (DAL select2 widget) + """ + self.filter_test(9, 'e', 110, 1, 17) + + def test_filter_notfound(self): + """ + Same queries as test_filter_search minus those two : + - One query for representative + score + - One query for mandates (including country + main_mandate) + (as the first count query returns 0) + """ + self.filter_test(3, 'non-existing-rep-name') diff --git a/memopol/urls.py b/memopol/urls.py index 5f6e885fb6f5123cb3022d0f60f568a5c5257b30..848cb768ba9f5f24caf1faa7eba52e6571a14767 100644 --- a/memopol/urls.py +++ b/memopol/urls.py @@ -6,10 +6,11 @@ from django.views import generic from views.dossier_ac import DossierAutocomplete, ProposalAutocomplete from views.dossier_detail import DossierDetail from views.dossier_list import DossierList +from views.group_ac import GroupAutocomplete from views.group_list import GroupList from views.representative_detail import RepresentativeDetail from views.representative_list import RepresentativeList -from views.redirects import RedirectGroupList +from views.redirects import RedirectGroupList, RedirectGroupRepresentativeList import api @@ -20,12 +21,12 @@ urlpatterns = [ url( r'^legislature/representative/(?P<group_kind>\w+)/(?P<chamber>.+)/' + r'(?P<group>.+)/$', - RepresentativeList.as_view(), + RedirectGroupRepresentativeList.as_view(), name='representative-list' ), url( r'^legislature/representative/(?P<group_kind>\w+)/(?P<group>.+)/$', - RepresentativeList.as_view(), + RedirectGroupRepresentativeList.as_view(), name='representative-list' ), url( @@ -58,6 +59,11 @@ urlpatterns = [ RedirectGroupList.as_view(), name='group-list-redirect' ), + url( + r'^legislature/autocomplete/group/$', + GroupAutocomplete.as_view(), + name='group-autocomplete', + ), url( r'^votes/dossier/$', DossierList.as_view(), diff --git a/memopol/views/group_ac.py b/memopol/views/group_ac.py new file mode 100644 index 0000000000000000000000000000000000000000..9d7abc58e413d5b20c0d681684b87cafe89d3d3f --- /dev/null +++ b/memopol/views/group_ac.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +from core.views import ActiveLegislatureMixin + +from dal.autocomplete import Select2QuerySetView + +import datetime + +from django.db.models import Q + +from representatives.models import Group + + +class GroupAutocomplete(Select2QuerySetView, ActiveLegislatureMixin): + + def get_queryset(self): + qs = Group.objects.distinct().exclude(kind__in=['chamber', 'country']) + + if self.get_active_only(): + qs = qs.filter( + Q(mandates__end_date__gte=datetime.date.today()) | + Q(mandates__end_date__isnull=True) + ) + + if self.q: + qs = qs.filter( + Q(name__icontains=self.q) | + Q(abbreviation__icontains=self.q) + ) + + return qs diff --git a/memopol/views/redirects.py b/memopol/views/redirects.py index 876c7eabd7c83503eb62f1b49b0b1f7ab4d059cb..fa65d39d1c41d97cfefafa6fdf6342183ac07477 100644 --- a/memopol/views/redirects.py +++ b/memopol/views/redirects.py @@ -1,9 +1,30 @@ # coding: utf-8 +from django.core.urlresolvers import reverse from django.views.generic.base import RedirectView +from representatives.models import Group + class RedirectGroupList(RedirectView): permanent = True query_string = True pattern_name = 'group-list' + + +class RedirectGroupRepresentativeList(RedirectView): + permanent = True + + def get_redirect_url(self, *args, **kwargs): + if kwargs['group_kind'] == 'chamber': + chamber = Group.objects.get(kind='chamber', name=kwargs['group']) + return '%s?chamber=%s' % (reverse('representative-list'), + chamber.pk) + elif kwargs['group_kind'] == 'country': + country = Group.objects.get(kind='country', name=kwargs['group']) + return '%s?country=%s' % (reverse('representative-list'), + country.pk) + else: + group = Group.objects.get(kind=kwargs['group_kind'], + name=kwargs['group']) + return '%s?group=%s' % (reverse('representative-list'), group.pk) diff --git a/memopol/views/representative_list.py b/memopol/views/representative_list.py index be0fc0bece5f4c0be993537800afcd6711d1dea3..b5efe7232c3d65eee5a1482c0b8d16ebb0d72065 100644 --- a/memopol/views/representative_list.py +++ b/memopol/views/representative_list.py @@ -3,14 +3,11 @@ from core.views import GridListMixin, PaginationMixin, CSVDownloadMixin, \ ActiveLegislatureMixin -import datetime - -from django.db import models -from django.utils.text import slugify from django.views import generic -from representatives.models import Group, Representative +from representatives.models import Representative +from ..filters import RepresentativeFilter from .representative_mixin import RepresentativeViewMixin @@ -20,10 +17,12 @@ class RepresentativeList(CSVDownloadMixin, GridListMixin, PaginationMixin, csv_name = 'representatives' queryset = Representative.objects.select_related('score') + current_filter = None def get_context_data(self, **kwargs): c = super(RepresentativeList, self).get_context_data(**kwargs) + c['filter'] = self.current_filter c['object_list'] = [ self.add_representative_country_and_main_mandate(r) for r in c['object_list'] @@ -31,46 +30,16 @@ class RepresentativeList(CSVDownloadMixin, GridListMixin, PaginationMixin, return c - def search_filter(self, qs): - search = self.request.GET.get('search', None) - if search: - qs = qs.filter(slug__icontains=slugify(search)) - return qs - - def group_filter(self, qs): - group_kind = self.kwargs.get('group_kind', None) - chamber = self.kwargs.get('chamber', None) - group = self.kwargs.get('group', None) - today = datetime.date.today() - - if group_kind and group: - if group.isnumeric(): - group_qs = Group.objects.filter( - id=int(group) - ) - else: - group_qs = Group.objects.filter( - name=group, - kind=group_kind - ) - - if chamber: - group_qs = group_qs.filter(chamber__name=chamber) - - qs = qs.filter( - models.Q(mandates__end_date__gte=today) | - models.Q(mandates__end_date__isnull=True), - mandates__group__in=group_qs - ) - - return qs + def rep_filter(self, qs): + f = RepresentativeFilter(self.request.GET, queryset=qs) + self.current_filter = f + return f.qs def get_queryset(self): qs = super(RepresentativeList, self).get_queryset() if self.get_active_only(): qs = qs.filter(active=True) - qs = self.group_filter(qs) - qs = self.search_filter(qs) + qs = self.rep_filter(qs) qs = self.prefetch_for_representative_country_and_main_mandate(qs) return qs diff --git a/static/scss/base.scss b/static/scss/base.scss index f8cff323c3006bca2ce5f360c464acaace53b4df..f6d87193b51457d21aa99042480ef79e9280dabe 100644 --- a/static/scss/base.scss +++ b/static/scss/base.scss @@ -7,6 +7,7 @@ @import 'positions'; @import 'chambers'; @import 'groups'; +@import 'filter'; @import 'external'; body { diff --git a/static/scss/filter.scss b/static/scss/filter.scss new file mode 100644 index 0000000000000000000000000000000000000000..7d0209fe829ec59d4dd7ae0545bbacbc382e5fc1 --- /dev/null +++ b/static/scss/filter.scss @@ -0,0 +1,70 @@ +@mixin bootstrap-shadow($color:#66afe9) { + border-color: #66afe9; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px $color; + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px $color; +} + +.filter-form { + display: flex; + flex-flow: row wrap; + justify-content: flex-start; + align-items: flex-end; + + .form-group { + display: flex; + flex-flow: column nowrap; + + margin: 0 .5em 0 0; + + .help-block { + display: none; + } + + .btn { + margin-top: .5em; + } + + /* Override bootstrap has-success color */ + + .control-label { + color: #555; + } + + .form-control { + border-color: #ccc; + + &:focus { + @include bootstrap-shadow(); + } + } + + /* Override select2 */ + .select2-container { + .select2-selection { + border-color: #ccc !important; + height: 34px; + + .select2-selection__rendered { + line-height: 34px; + } + + .select2-selection__arrow { + height: 32px; + } + } + + &.select2-container--focus, + &.select2-container--open { + @include bootstrap-shadow(); + } + } + } +} + +.no-results { + margin-top: 1em; + font-size: larger; + font-weight: bold; + color: #555; + margin: 2em 0; +} \ No newline at end of file diff --git a/templates/representatives/_filter_form.haml b/templates/representatives/_filter_form.haml new file mode 100644 index 0000000000000000000000000000000000000000..cebb07f28b8f3f8e735d8e0ac65c7070f6d36052 --- /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 + %button{'type': 'submit', 'name': 'csv', 'class': 'btn btn-default'} + {% bootstrap_icon "download-alt" %} Download as CSV + - endbuttons diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml index 9f75d0e5f91ac9fee8431ab7ee154eb87e5001c5..d745a7b8c7b28fdf727c4d37126cebdf98ca89d0 100644 --- a/templates/representatives/representative_list.haml +++ b/templates/representatives/representative_list.haml @@ -4,60 +4,64 @@ - load memopol_tags - load representatives_recommendations_tags +- block head + + {{ filter.form.media }} + - block content - block search - %form{action:'', method:'get'} - %label{for:'search'} - - trans 'Search' - %input{id:"search", type:"text", name:"search"} - %input{type:"submit", value:"Go"} - - %a{href:"?{% if request.GET.search %}search={{ request.GET.search }}&{% endif %}csv"} - - trans 'Download data as CSV' - - - include 'core/blocks/pagination.html' - - - block list - - %table.table - %tr - %th - - trans 'Photo' - %th - - trans 'Name' - %th - - trans 'Chamber' - %th - - trans 'Country' - %th - - trans 'Group' - %th - - trans 'Score' - - - for representative in object_list - %tr.representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'} - %td.photo - %a{'href': "{% url 'representative-detail' representative.slug %}"} - %img{'src': '={representative.photo}', 'width': '80'}/ - - %td - %a{'href': "{% url 'representative-detail' representative.slug %}"} - = representative.full_name - - %td - %a{'href': "{% chamber_url representative.chamber %}"} - = representative.chamber - - %td - %a{'href': "{% country_url representative.country %}"} - = representative.country - - %td - %a{'href': "{% group_url representative.main_mandate.group %}"} - = representative.main_mandate.group|group_icon - %td - = representative.score.score|score_label - - - include 'core/blocks/pagination.html' + {% url 'representative-list' as action_url %} + - include 'representatives/_filter_form.html' with action=action_url form=filter.form qs=request.GET.urlencode + + - if object_list|length == 0 + + .no-results="No matching representatives found :(" + + - else + + - include 'core/blocks/pagination.html' + + - block list + + %table.table + %tr + %th + - trans 'Photo' + %th + - trans 'Name' + %th + - trans 'Chamber' + %th + - trans 'Country' + %th + - trans 'Group' + %th + - trans 'Score' + + - for representative in object_list + %tr.representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'} + %td.photo + %a{'href': "{% url 'representative-detail' representative.slug %}"} + %img{'src': '={representative.photo}', 'width': '80'}/ + + %td + %a{'href': "{% url 'representative-detail' representative.slug %}"} + = representative.full_name + + %td + %a{'href': "{% chamber_url representative.chamber %}"} + = representative.chamber + + %td + %a{'href': "{% country_url representative.country %}"} + = representative.country + + %td + %a{'href': "{% group_url representative.main_mandate.group %}"} + = representative.main_mandate.group|group_icon + %td + = representative.score.score|score_label + + - include 'core/blocks/pagination.html'