color CCM
This commit is contained in:
parent
ea5c8acc68
commit
e80cf7dbcc
2 changed files with 7 additions and 3 deletions
4
app.rb
4
app.rb
|
@ -26,6 +26,10 @@ post '/' do
|
||||||
end
|
end
|
||||||
|
|
||||||
#HELPERS
|
#HELPERS
|
||||||
|
def player_style(player)
|
||||||
|
'background-color:green;color:white;font-weight: bold' if ['greggnic','mafiaman','atomaka'].include?(player)
|
||||||
|
end
|
||||||
|
|
||||||
def readable_number(value)
|
def readable_number(value)
|
||||||
numbers.each do |number, symbol|
|
numbers.each do |number, symbol|
|
||||||
if value.to_f / number.to_f > 1
|
if value.to_f / number.to_f > 1
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @raids.each do |raid| %>
|
<% @raids.each do |raid| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= raid.attacker %></td>
|
<td style="<%= player_style(raid.attacker) %>"><%= raid.attacker %></td>
|
||||||
<td><%= raid.defender %></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.soldiers) %></td>
|
||||||
<td class="text-right"><%= readable_number(raid.money) %></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>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in a new issue