From 84570b31864a5c3d5faf73a20c4c85a9d40f7e00 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Wed, 7 Mar 2018 10:10:23 +0000
Subject: [PATCH] Add inactive state to table row

---
 opentech/apply/funds/tables.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/opentech/apply/funds/tables.py b/opentech/apply/funds/tables.py
index 486902e8e..8da4ac194 100644
--- a/opentech/apply/funds/tables.py
+++ b/opentech/apply/funds/tables.py
@@ -26,13 +26,15 @@ class SubmissionsTable(tables.Table):
         fields = ('title', 'status_name', 'stage', 'page', 'round', 'submit_time')
         sequence = ('title', 'status_name', 'stage', 'page', 'round', 'lead', 'submit_time')
         template = 'funds/tables/table.html'
+        row_attrs = {
+            'class': lambda record: '' if record.active else 'is-inactive'
+        }
 
     def render_user(self, value):
         return value.get_full_name()
 
     def render_status_name(self, value, record):
-        state = 'class="not-active"' if not record.active else ''
-        return mark_safe(f'<span { state }>{ value }</span>')
+        return mark_safe(f'<span>{ value }</span>')
 
 
 def get_used_rounds(request):
-- 
GitLab