86 lines
3.2 KiB
Plaintext
86 lines
3.2 KiB
Plaintext
|
|
<div class="page-header">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
|
<li class="breadcrumb-item active">Promotion</li>
|
|
<span class="float-right">
|
|
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
|
|
</span>
|
|
</ol>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
|
|
<div class="m-b-10 clearfix">
|
|
<%= link_to t("views.btn.new"),new_settings_promotion_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
|
|
</div>
|
|
<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=""></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.utc.strftime("%I:%M %P") rescue "-" %></td>
|
|
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
|
|
<td><%= pro.promo_day %></td>
|
|
<td>
|
|
<% item = MenuItemInstance.find_by_item_instance_code(pro.original_product)%>
|
|
<% if item.nil? %>
|
|
<%= Product.find_by_item_code(pro.original_product).name rescue "-" %>
|
|
<% else %>
|
|
<%= item.menu_item.name rescue "-" %>
|
|
- <%= item.item_instance_name rescue "-" %>
|
|
<% 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 t("views.btn.edit"), edit_settings_promotion_path(pro) %>
|
|
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%=settings_promotion_path(pro)%>" data-method="delete">
|
|
<%= t("views.btn.delete") %>
|
|
</button>
|
|
|
|
<span class="hidden" id="delete_text">
|
|
<h6>Are you sure you want to delete this row ?</h6>
|
|
<h6>This action can't be undo. </h6>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
|
|
<div class="card">
|
|
<div class="body">
|
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
|
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
|
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|