Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-11-07 10:32:48 +06:30
19 changed files with 309 additions and 21 deletions

View File

@@ -0,0 +1,82 @@
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<%= simple_form_for([:settings,@commission],html: { data_name: "assign_product" }) do |f| %>
<%= f.error_notification %>
<%= f.input :product_code, as: :hidden %>
<div class="card">
<div class="header">
Select Menu Items
</div>
<div class="body">
<div class="row">
<% @menu_categories.each do |category|%>
<div class="col-lg-3 col-md-3 col-sm-6">
<div class="card" style="padding-left:5px">
<div class="card-title">
<div> <h5><%= category.name %></h5></div>
<div> <button type="button" data-id="menu_items_category_<%= category.id %>" class="btn btn-info waves-effect processingitems_all" aria-label="Left Align">
<!-- <i class="fa fa-list" aria-hidden="true"></i> -->
<i class="material-icons">list</i>
</button>
<button type="button" data-id="menu_items_category_<%= category.id %>" class="processingitems_clr btn btn-info waves-effect" aria-label="Left Align">
<!-- <i class="fa fa-minus-circle" aria-hidden="true"></i> -->
<i class="material-icons">remove_circle</i>
</button></div>
</div>
<ul class="opi_ul" id="menu_items_category_<%= category.id %>">
<% category.menu_items.each do |item| %>
<% flag = false %>
<% itemsary = JSON.parse(@commission.product_code) %>
<% itemsary.each do |item_code| %>
<% if item_code == item.item_code %>
<% flag = true %>
<% end %>
<% end %>
<% if flag == true %>
<li><div class="processitems opi_default opi_selected" data-id="<%= item.item_code %>"><%= item.name %></div></li>
<% else %>
<li><div class="processitems opi_default" data-id="<%= item.item_code %>"><%= item.name %></div></li>
<% end %>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit "Update",:class => 'btn ccc btn-primary btn-lg waves-effect' %>
</div>
<br>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) <%= t("views.right_panel.detail.select_menu_items") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
2) <button type="button" class="btn btn-info waves-effect processingitems_all"> <i class="material-icons md-18">list </i> </button> - <%= t("views.right_panel.detail.assign_txt") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
3) <button type="button" class="btn btn-info waves-effect processingitems_all"> <i class="material-icons md-18">remove_circle </i></button> - <%= t("views.right_panel.detail.remove_txt") %> <%= t("views.right_panel.detail.menu_item_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.update") %> - <%= t("views.right_panel.detail.update_btn_txt") %> <%= t("views.right_panel.detail.processing_items_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.order_queue_stations_txt") %> <br>
</p>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<h1>Editing Settings Order Queue Station</h1>
<%= render 'form', settings_order_queue_station: @settings_order_queue_station %>
<%= link_to t("views.btn.show"), @settings_order_queue_station %> |
<%= link_to t('.new', :default => t("views.btn.new")), settings_order_queue_stations_path %>

View File

@@ -0,0 +1,46 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Order Queue Stations</li>
<span style="float: right">
<%= link_to t("views.btn.new"),new_settings_order_queue_station_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table">
<thead>
<tr>
<th>Station name</th>
<th>Is active</th>
<th>Print copy</th>
<th>Printer name</th>
<th>Cut per item</th>
<th>Use alternate name</th>
<th>Created by</th>
<th></th>
</tr>
</thead>
<tbody>
<% @settings_order_queue_stations.each do |settings_order_queue_station| %>
<tr>
<td><%= link_to settings_order_queue_station.station_name, settings_order_queue_station_path(settings_order_queue_station) %></td>
<td><%= settings_order_queue_station.is_active %></td>
<td><%= settings_order_queue_station.print_copy %></td>
<td><%= settings_order_queue_station.printer_name %></td>
<td><%= settings_order_queue_station.cut_per_item %></td>
<td><%= settings_order_queue_station.use_alternate_name %></td>
<td><%= settings_order_queue_station.created_by %></td>
<td><%= link_to 'Assign Processing Items', settings_order_queue_station_path(settings_order_queue_station),:class => 'btn btn-success btn-lg waves-effect' %>
<%= link_to t("views.btn.edit"), edit_settings_order_queue_station_path(settings_order_queue_station),:class => 'btn btn-info btn-lg waves-effect' %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @settings_order_queue_stations, partial: 'settings_order_queue_stations/settings_order_queue_station', as: :settings_order_queue_station

View File

@@ -0,0 +1,12 @@
<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_commissions_path %>">Commissions</a></li>
<li class="breadcrumb-item active"><%= @commission.name %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), settings_commissions_path %>
</span>
</ol>
</div>
<br>
<%= render 'form', settings_commission: @commission %>

View File

@@ -0,0 +1,50 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Station name:</strong>
<%= @settings_order_queue_station.station_name %>
</p>
<p>
<strong>Is active:</strong>
<%= @settings_order_queue_station.is_active %>
</p>
<p>
<strong>Processing items:</strong>
<%= @settings_order_queue_station.processing_items %>
</p>
<p>
<strong>Print copy:</strong>
<%= @settings_order_queue_station.print_copy %>
</p>
<p>
<strong>Printer name:</strong>
<%= @settings_order_queue_station.printer_name %>
</p>
<p>
<strong>Font size:</strong>
<%= @settings_order_queue_station.font_size %>
</p>
<p>
<strong>Cut per item:</strong>
<%= @settings_order_queue_station.cut_per_item %>
</p>
<p>
<strong>Use alternate name:</strong>
<%= @settings_order_queue_station.use_alternate_name %>
</p>
<p>
<strong>Created by:</strong>
<%= @settings_order_queue_station.created_by %>
</p>
<%= link_to t("views.btn.edit"), edit_settings_order_queue_station_path(@settings_order_queue_station) %> | <%= link_to t("views.btn.delete"), settings_order_queue_station_path(@settings_order_queue_station), method: :delete, data: { confirm: 'Are you sure?' } %> |
<%= link_to t('.new', :default => t("views.btn.new")), settings_order_queue_stations_path %>

View File

@@ -0,0 +1 @@
json.partial! "settings_order_queue_stations/settings_order_queue_station", settings_order_queue_station: @settings_order_queue_station

View File

@@ -14,7 +14,7 @@
<br/>
<%= f.label :commission_id, 'Commission'%>
<%= f.select :commission_id, Commission.all.map {|l| [l.menu_item.name, l.id]}, { :include_blank => 'Choose Commission Product', :selected => ''}, {class: 'form-control'} %>
<%= f.select :commission_id, Commission.all.map {|l| [l.name, l.id]}, { :include_blank => 'Choose Commission Product', :selected => ''}, {class: 'form-control'} %>
<br/>
<%= f.label :joined_date %><br/>

View File

@@ -6,8 +6,9 @@
<%= f.error_notification %>
<div class="form-inputs">
<%= f.label :product_code, 'Product' %>
<%= f.collection_select :product_code, MenuItem.all.order('name asc'), :id, :name, {prompt: 'Select a Product'}, {class: 'form-control'} %><br/>
<!--<%= f.label :product_code, 'Product' %>
<%= f.collection_select :product_code, MenuItem.all.order('name asc'), :id, :name, {prompt: 'Select a Product'}, {class: 'form-control'} %><br/>-->
<%= f.input :name %>
<%= f.input :commission_type, :collection => ['Percentage','Net Amount'], prompt: 'Select Commission Type', class: 'form-control' %>
<%= f.input :amount %>
<%= f.input :is_active,:class => "filled-in" ,:id => "" %>

View File

@@ -28,12 +28,14 @@
<tbody>
<% @commissions.each do |commission| %>
<tr>
<td><%= commission.menu_item.name rescue '-' %></td>
<td><%= commission.name rescue '-' %></td>
<td><%= commission.commission_type rescue '-' %></td>
<td><%= commission.amount rescue '-' %></td>
<td><%= commission.is_active rescue '-' %></td>
<td><%= link_to t("views.btn.show"), settings_commission_path(commission), :class => "btn btn-info btn-sm waves-effect" %>
<%= link_to t("views.btn.edit"), edit_settings_commission_path(commission), :class => "btn btn-info btn-sm waves-effect" %></td>
<%= link_to t("views.btn.edit"), edit_settings_commission_path(commission), :class => "btn btn-info btn-sm waves-effect" %>
<%= link_to 'Assign Product', new_settings_commission_assign_product_path(commission),:class => 'btn btn-success btn-sm waves-effect' %>
</td>
</tr>
<% end %>
</tbody>

View File

@@ -18,7 +18,7 @@
<tbody>
<tr>
<th style="width:20%"><%= t("views.right_panel.detail.product") %> <%= t("views.right_panel.detail.name_txt2") %></th>
<td><%= @commission.menu_item.name rescue '-' %></td>
<td><%= @commission.name rescue '-' %></td>
</tr>
<tr>
<th style="width:20%"><%= t("views.right_panel.detail.amount") %></th>