cryptobot/app/views/home/partials/_bb_trades.html.erb

32 lines
1.3 KiB
Plaintext

<% if !@bbt_max_lifetime.blank? %>
<h6>Max (<%= @bbt_max_lifetime.date %>): <span class="badge badge-success"><%= '%.2f' % @bbt_max_lifetime.price %></span> Min (<%= @bbt_min_lifetime.date %>): <span class="badge badge-danger"><%= '%.2f' % @bbt_min_lifetime.price %></span></h6>
<% else %>
<h6><span class="badge badge-warning">Brak danych dla tej monety</span></h6>
<% end %>
<% if !@bbt_max_24h.blank? %>
<h6>Max 24h: <span class="badge badge-success"><%= '%.2f' % @bbt_max_24h.price %></span> Min 24h: <span class="badge badge-danger"><%= '%.2f' % @bbt_min_24h.price %></span></h6>
<% else %>
<h6><span class="badge badge-danger">Brak danych z ostatnich 24h</span></h6>
<% end %>
<table class="table table-sm table-dark">
<thead>
<tr>
<th scope="col">tid</th>
<th scope="col">Data</th>
<th scope="col">Cena</th>
<th scope="col">Ilość</th>
<th scope="col">Koszt transakcji</th>
</tr>
</thead>
<tbody>
<% for bbt in @bbt %>
<tr class="<%= bbt.transaction_type == 'buy' ? 'bg-success' : 'bg-danger' %>">
<th scope="row"><%= bbt.tid %></th>
<td><%= bbt.date %></td>
<td><%= '%.2f' % bbt.price %></td>
<td><%= bbt.amount %></td>
<td><%= '%.2f' % (bbt.price * bbt.amount) %></td>
</tr>
<% end %>
</tbody>
</table>