trugul-bot/views/index.erb

41 lines
1.4 KiB
Text

<div class="col-md-9">
<div class="pull-right">
<%= will_paginate @raids, renderer: BootstrapPagination::Sinatra %>
</div>
<table class="table table-striped table-hover table-bordered table-condensed">
<thead>
<tr>
<td>Attacker</td>
<td>Defender</td>
<td>Soldiers</td>
<td>Money</td>
<td>Time</td>
</tr>
</thead>
<tbody>
<% @raids.each do |raid| %>
<tr>
<td style="<%= player_style(raid.attacker) %>"><%= raid.attacker %></td>
<td style="<%= player_style(raid.defender) %>"><%= raid.defender %></td>
<td class="text-right"><%= readable_number(raid.soldiers) %></td>
<td class="text-right" style="<%=money_style(raid.money)%>"><%= readable_number(raid.money) %></td>
<td class="text-right"><%= raid.created_at.strftime('%H:%M on %m-%d-%Y') %></td>
</tr>
<% end %>
</tbody>
</table>
<div>
<%= will_paginate @raids, renderer: BootstrapPagination::Sinatra %>
</div>
</div>
<div class="col-md-3">
<div class="well well-lg text-center"><strong><%= Time.now.utc.strftime('%H:%M on %m-%d-%Y') %></strong></div>
<h2>Top 20</h2>
<ul class="list-group">
<% @top20.each do |user| %>
<li class="list-group-item"><%= user[:user] %><span class="pull-right"><small><%= user[:date].strftime('%H:%M on %m-%d-%Y') if user[:date] %></small></li>
<% end %>
</div>