Promotion CRUD
This commit is contained in:
58
app/views/settings/promotions/index.html.erb
Normal file
58
app/views/settings/promotions/index.html.erb
Normal file
@@ -0,0 +1,58 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li>Promotions</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_promotion_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Promotion Code</th>
|
||||
<th>Start Date</th>
|
||||
<th>End Date</th>
|
||||
<th>Start Time</th>
|
||||
<th>End Time</th>
|
||||
<th>Promotion Day</th>
|
||||
<th>Original Product</th>
|
||||
<th>Created By</th>
|
||||
<th>Created At</th>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @promotions.each do |pro| %>
|
||||
<tr>
|
||||
<td><%= link_to pro.promo_code, settings_promotion_path(pro) %></td>
|
||||
<td><%= pro.promo_start_date %></td>
|
||||
<td><%= pro.promo_end_date %></td>
|
||||
<td><%= pro.promo_start_hour.strftime("%I:%M %P") rescue "-" %></td>
|
||||
<td><%= pro.promo_end_hour.strftime("%I:%M %P") rescue "-" %></td>
|
||||
<td><%= pro.promo_day %></td>
|
||||
<td>
|
||||
<% if MenuItem.exists?(pro.original_product) %>
|
||||
<%= MenuItem.find(pro.original_product).name %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% if Employee.exists?(pro.created_by) %>
|
||||
<td><%= Employee.find(pro.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= pro.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= pro.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_promotion_path(pro) %></td>
|
||||
<td><%= link_to 'Destroy', settings_promotion_path(pro), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user