color CCM

This commit is contained in:
Andrew Tomaka 2015-04-23 15:22:13 -04:00
parent ea5c8acc68
commit e80cf7dbcc
2 changed files with 7 additions and 3 deletions

4
app.rb
View file

@ -26,6 +26,10 @@ post '/' do
end
#HELPERS
def player_style(player)
'background-color:green;color:white;font-weight: bold' if ['greggnic','mafiaman','atomaka'].include?(player)
end
def readable_number(value)
numbers.each do |number, symbol|
if value.to_f / number.to_f > 1

View file

@ -13,11 +13,11 @@
<tbody>
<% @raids.each do |raid| %>
<tr>
<td><%= raid.attacker %></td>
<td><%= raid.defender %></td>
<td style="<%= player_style(raid.attacker) %>"><%= raid.attacker %></td>
<td style="<%= player_style(raid.attacker) %>"><%= raid.defender %></td>
<td class="text-right"><%= readable_number(raid.soldiers) %></td>
<td class="text-right"><%= readable_number(raid.money) %></td>
<td><%= raid.created_at %></td>
<td class="text0right"><%= raid.created_at.strftime('%H:%M on %m-%d-%Y') %></td>
</tr>
<% end %>
</tbody>