Better background colors

This commit is contained in:
Andrew Tomaka 2015-04-23 15:28:48 -04:00
parent a4c6edfe29
commit 4e4eaf7594
2 changed files with 10 additions and 4 deletions

10
app.rb
View file

@ -27,7 +27,15 @@ end
#HELPERS
def player_style(player)
'background-color:green;color:white;font-weight: bold' if ['greggnic','mafiaman','atomaka'].include?(player)
"background-color:#{players[player]};font-weight: bold" if players.keys.include?(player)
end
def players
{
'greggnic' => '#dff0d8',
'atomaka' => '#d9edf7',
'mafiaman' => '#f2dede'
}
end
def readable_number(value)

View file

@ -1,5 +1,3 @@
<h2>Index</h2>
<table class="table table-striped table-hover table-bordered table-condensed">
<thead>
<tr>
@ -17,7 +15,7 @@
<td style="<%= player_style(raid.defender) %>"><%= raid.defender %></td>
<td class="text-right"><%= readable_number(raid.soldiers) %></td>
<td class="text-right"><%= readable_number(raid.money) %></td>
<td class="text0right"><%= raid.created_at.strftime('%H:%M on %m-%d-%Y') %></td>
<td class="text-right"><%= raid.created_at.strftime('%H:%M on %m-%d-%Y') %></td>
</tr>
<% end %>
</tbody>