Files
sx-fc/app/views/settings/commissioners/index.html.erb
2017-08-28 18:17:22 +06:30

45 lines
1.5 KiB
Plaintext

<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= settings_commissioners_path %>">Home</a></li>
<li>Commissioner</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_settings_commissioner_path, :class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Employee Name</th>
<th>Commission type</th>
<th>Joined Date</th>
<th>Resigned Date</th>
<th>Active</th>
<th colspan="4"></th>
</tr>
</thead>
<tbody>
<% @commissioners.each do |commissioner| %>
<tr>
<td><%= commissioner.name %></td>
<td>
<%= commissioner.employee.name rescue '-' %>
</td>
<td><%= commissioner.commission.menu_item.name rescue '-' %></td>
<td><%= commissioner.joined_date.utc.getlocal.strftime('%Y-%b-%d') rescue '-' %></td>
<td><%= commissioner.resigned_date.utc.getlocal.strftime('%Y-%b-%d') rescue '-' %></td>
<td><%= commissioner.is_active %></td>
<td><%= link_to 'Show', settings_commissioner_path(commissioner) %></td>
<td><%= link_to 'Edit', edit_settings_commissioner_path(commissioner) %></td>
<td><%= link_to 'Destroy', settings_commissioner_path(commissioner), method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
</table>
</div>