Commit 5d80858

Stephen Peasley <stephenpeasley@hotmail.com>
2013-06-23 06:13:20
Added colour formatting to neighbourhoods statuses
1 parent 41fb9c9
Changed files (2)
app
assets
views
neighbourhoods
app/assets/stylesheets/neighbourhoods.css.scss
@@ -1,3 +1,15 @@
 // Place all the styles related to the Neighbourhoods controller here.
 // They will automatically be included in application.css.
 // You can use Sass (SCSS) here: http://sass-lang.com/
+
+$green: #00cc33;
+$orange: #cc9900;
+$red: #cc0000;;
+$white: #fff;
+
+body { text-rendering:optimizeLegibility; }
+
+td { color:$white; text-decoration:uppercase;}
+td.evac { background:$red; }
+td.open { background:$green; }
+td.part { background:$orange; }
\ No newline at end of file
app/views/neighbourhoods/index.html.erb
@@ -12,7 +12,15 @@
       <% @neighbourhoods.each do |neighbourhood| %>
       <tr>
         <td><%= neighbourhood.name %></td>
-        <td><%= neighbourhood.status %></td>
+        <% case
+        when neighbourhood.status.starts_with.downcase? == 'evac' %>
+            <td class="evac"><%= neighbourhood.status %></td>  
+        <% when neighbourhood.status.starts_with.downcase? == 'part' %>
+            <td class="part">neighbourhood.status</td>  
+        <% else  %>
+            <td class="open">neighbourhood.status</td>  
+        <% end %>
+        </td>
       </tr>
       <% end %>
       </tbody>