From 72c8fe934ae03009242588435a5884046beb66c3 Mon Sep 17 00:00:00 2001
From: Nicolas Joyard <joyard.nicolas@gmail.com>
Date: Sat, 11 Jun 2016 10:46:37 +0200
Subject: [PATCH] Use memopol tags; add country flag to country page

---
 memopol/templatetags/memopol_tags.py                 | 4 ----
 templates/representatives/_representative_block.haml | 1 -
 templates/representatives/group_list.haml            | 3 ++-
 templates/representatives/representative_detail.haml | 2 --
 templates/representatives/representative_grid.haml   | 1 -
 templates/representatives/representative_list.haml   | 1 -
 templates/representatives_votes/dossier_detail.haml  | 2 +-
 7 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/memopol/templatetags/memopol_tags.py b/memopol/templatetags/memopol_tags.py
index a7522a26..d7a853bf 100644
--- a/memopol/templatetags/memopol_tags.py
+++ b/memopol/templatetags/memopol_tags.py
@@ -21,10 +21,6 @@ def fix_url(url):
     return re.sub('^(https?://)?', 'https://', url.strip())
 
 
-def cssify(string):
-    return re.sub('[^a-z_-]', '', string.lower())
-
-
 @register.filter
 def twitter_link(url):
     furl = fix_url(url)
diff --git a/templates/representatives/_representative_block.haml b/templates/representatives/_representative_block.haml
index a49830eb..87cc39be 100644
--- a/templates/representatives/_representative_block.haml
+++ b/templates/representatives/_representative_block.haml
@@ -1,5 +1,4 @@
 - load memopol_tags
-- load representatives_tags
 - load representatives_recommendations_tags
 - load humanize
 
diff --git a/templates/representatives/group_list.haml b/templates/representatives/group_list.haml
index d2201929..26ca8927 100644
--- a/templates/representatives/group_list.haml
+++ b/templates/representatives/group_list.haml
@@ -1,7 +1,6 @@
 - extends 'base.html'
 
 - load memopol_tags
-- load representatives_tags
 
 - block content
 
@@ -25,6 +24,8 @@
             %a{'href': "{% group_url group %}"}=
               - if group.kind == 'chamber'
                 = group|chamber_icon
+              - elif group.kind == 'country'
+                = group|country_flag
               - elif group.kind == 'group'
                 = group|group_long_icon
               - else
diff --git a/templates/representatives/representative_detail.haml b/templates/representatives/representative_detail.haml
index d2818765..57a2241b 100644
--- a/templates/representatives/representative_detail.haml
+++ b/templates/representatives/representative_detail.haml
@@ -2,8 +2,6 @@
 
 - load humanize
 - load memopol_tags
-- load representatives_tags
-- load representatives_votes_tags
 - load representatives_recommendations_tags
 
 - block head
diff --git a/templates/representatives/representative_grid.haml b/templates/representatives/representative_grid.haml
index 2680906b..0812dcbd 100644
--- a/templates/representatives/representative_grid.haml
+++ b/templates/representatives/representative_grid.haml
@@ -1,7 +1,6 @@
 - extends 'representatives/representative_list.html'
 
 - load memopol_tags
-- load representatives_tags
 - load representatives_recommendations_tags
 
 - block list
diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml
index 4badc2c2..9f75d0e5 100644
--- a/templates/representatives/representative_list.haml
+++ b/templates/representatives/representative_list.haml
@@ -2,7 +2,6 @@
 
 - load i18n
 - load memopol_tags
-- load representatives_tags
 - load representatives_recommendations_tags
 
 - block content
diff --git a/templates/representatives_votes/dossier_detail.haml b/templates/representatives_votes/dossier_detail.haml
index 2734ac69..6c043157 100644
--- a/templates/representatives_votes/dossier_detail.haml
+++ b/templates/representatives_votes/dossier_detail.haml
@@ -1,7 +1,7 @@
 - extends "base.html"
 
 - load i18n
-- load representatives_votes_tags
+- load memopol_tags
 
 - block content
 
-- 
GitLab