From da580a2a9c5de51ac4c7dda91628f79d515f26b9 Mon Sep 17 00:00:00 2001 From: Nicolas Joyard <joyard.nicolas@gmail.com> Date: Fri, 15 Apr 2016 15:56:13 +0200 Subject: [PATCH] Add chamber to group lists --- memopol/urls.py | 4 ++++ templates/representatives/group_list.haml | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/memopol/urls.py b/memopol/urls.py index cf8d2b7e..333ffb38 100644 --- a/memopol/urls.py +++ b/memopol/urls.py @@ -10,6 +10,10 @@ admin.autodiscover() urlpatterns = [ # Project-specific overrides + url( + r'^legislature/representative/(?P<group_kind>\w+)/(?P<chamber>.+)/(?P<group>.+)/$', + views.RepresentativeList.as_view(), + ), url( r'^legislature/representative/(?P<group_kind>\w+)/(?P<group>.+)/$', views.RepresentativeList.as_view(), diff --git a/templates/representatives/group_list.haml b/templates/representatives/group_list.haml index 382336ca..bf7fc5a8 100644 --- a/templates/representatives/group_list.haml +++ b/templates/representatives/group_list.haml @@ -4,8 +4,12 @@ %table.table - for group in object_list %tr + - if group.kind != 'country' and group.kind != 'chamber' + %td + %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=group.chamber.name %}"}= group.chamber.name + %td - %a{'href': '{{ group.get_absolute_url }}'}w + %a{'href': '{{ group.get_absolute_url }}'} - if group.abbreviation ={group.abbreviation} %td -- GitLab