Files
sx-fc/app/views/origami/commissions/index.html.erb
2017-08-22 09:51:08 +06:30

45 lines
1.3 KiB
Plaintext

<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>Commissions</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commission_path ,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Product Name</th>
<th>Amount</th>
<th>Commission type</th>
<th>Active</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissions.each do |commission| %>
<tr>
<td>
<% if Product.exists? %>
<% product = Product.find(commission.product_id) %>
<%= product.name %>
<% end %>
</td>
<td><%= commission.amount %></td>
<td><%= commission.commission_type %></td>
<td><%= commission.is_active %></td>
<td><%= link_to 'Show', origami_commission_path(commission) %></td>
<td><%= link_to 'Edit', edit_origami_commission_path(commission) %></td>
<td><%= link_to 'Destroy', origami_commission_path(commission), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>