From 1f7ddd6105813436d5f111597dfc27a98af2eced Mon Sep 17 00:00:00 2001
From: Nicolas Joyard <joyard.nicolas@gmail.com>
Date: Thu, 9 Jun 2016 08:18:36 +0200
Subject: [PATCH] Display inactive rep picture in grayscale

---
 static/scss/legislature.scss                        | 13 +++++++++++++
 .../representatives/_representative_block.haml      |  2 +-
 templates/representatives/representative_grid.haml  |  2 +-
 templates/representatives/representative_list.haml  |  4 ++--
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/static/scss/legislature.scss b/static/scss/legislature.scss
index 1c8c30db..8ea30ef4 100644
--- a/static/scss/legislature.scss
+++ b/static/scss/legislature.scss
@@ -65,4 +65,17 @@
             text-indent: 10px;
         }
     }
+}
+
+.representative_item.inactive,
+.representative.inactive {
+    .photo img {
+        -webkit-filter: greyscale(1);
+        -moz-filter: grayscale(1);
+        -ms-filter: grayscale(1);
+        -o-filter: grayscale(1);
+        filter: grayscale(1);
+
+        opacity: 0.5;
+    }
 }
\ No newline at end of file
diff --git a/templates/representatives/_representative_block.haml b/templates/representatives/_representative_block.haml
index 429e2834..a49830eb 100644
--- a/templates/representatives/_representative_block.haml
+++ b/templates/representatives/_representative_block.haml
@@ -3,7 +3,7 @@
 - load representatives_recommendations_tags
 - load humanize
 
-.representative
+.representative{'class': '{{ representative.active|yesno:"active,inactive" }}' }
 
   %h1.name<
     ={representative.full_name}
diff --git a/templates/representatives/representative_grid.haml b/templates/representatives/representative_grid.haml
index bc50ad49..2680906b 100644
--- a/templates/representatives/representative_grid.haml
+++ b/templates/representatives/representative_grid.haml
@@ -8,7 +8,7 @@
 
   .representative_grid
     - for representative in object_list
-      .representative_item
+      .representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'}
         %p.photo
           %a{'href': "{% url 'representative-detail' representative.slug %}"}
             %img{'src': '={representative.photo}', 'width': '80'}/
diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml
index af5c9621..4badc2c2 100644
--- a/templates/representatives/representative_list.haml
+++ b/templates/representatives/representative_list.haml
@@ -38,8 +38,8 @@
           - trans 'Score'
 
       - for representative in object_list
-        %tr
-          %td
+        %tr.representative_item{'class': '{{ representative.active|yesno:"active,inactive" }}'}
+          %td.photo
             %a{'href': "{% url 'representative-detail' representative.slug %}"}
               %img{'src': '={representative.photo}', 'width': '80'}/
 
-- 
GitLab