update admin bsb

This commit is contained in:
Aung Myo
2017-10-20 17:02:49 +06:30
parent 9dac7198e9
commit f0494307f6
20 changed files with 232 additions and 96 deletions

View File

@@ -1,5 +1,10 @@
<%= simple_nested_form_for([:settings,@promotion]) do |f| %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<%= simple_nested_form_for([:settings,@promotion]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
@@ -147,6 +152,19 @@
<%= f.button :submit %>
</div>
<% end %>
</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>
<script>

View File

@@ -1,10 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_promotions_path %>">Promotions</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', promotion: @promotion %>
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_products_path %>">Products</a></li>
<li class="breadcrumb-item active">New</li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), settings_products_path %>
</span>
</ol>
</div>
<%= render 'form', promotion: @promotion %>

View File

@@ -1,62 +1,85 @@
<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("views.btn.new"),new_settings_promotion_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
<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>
<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>
<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? %>
<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 %>
<% else %>
<%= item.menu_item.name rescue "-" %>
- <%= item.item_instance_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>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>
<% else %>
<td><%= pro.created_by %></td>
<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 %>
<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) %></td>
<td><%= link_to t("views.btn.delete"), settings_promotion_path(pro), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</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>

View File

@@ -1,14 +1,15 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_promotions_path %>">Promotions</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', promotion: @promotion %>
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_products_path %>">Products</a></li>
<li class="breadcrumb-item active">New</li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), settings_products_path %>
</span>
</ol>
</div>
<%= render 'form', promotion: @promotion %>
<script>
var r_id = Math.random().toString(36).slice(5);
if(r_id.length > 16){