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

This commit is contained in:
Yan
2017-11-21 17:33:00 +06:30
5 changed files with 98 additions and 80 deletions

View File

@@ -22,9 +22,7 @@ $(function() {
product = data; product = data;
for(var field in product) { for(var field in product) {
console.log(product[field].name);
if (product[field].unit_price > 0) { if (product[field].unit_price > 0) {
console.log("hi");
qty = 1; qty = 1;
options = []; options = [];
item_attributes = []; item_attributes = [];
@@ -97,12 +95,19 @@ $(function() {
var menu_items_list = $('.menu_items_list'); var menu_items_list = $('.menu_items_list');
menu_items_list.empty(); menu_items_list.empty();
menu_items = data.menu_items; menu_items = data.menu_items;
console.log(menu_items);
for(var field in menu_items) { for(var field in menu_items) {
if (menu_items[field].is_sub_item == false) { if (menu_items[field].is_sub_item == false) {
instances = menu_items[field].instances ; instances = menu_items[field].instances ;
if (!instances.length > 0) {
swal("Hello Please Check!","doesn't not have instance item in this menu items ("+ menu_items[field].name+")","warning");
}
if (instances.length > 0) {
qty = 1; qty = 1;
options = []; options = [];
price = 0;
if (JSON.stringify(menu_items[field].item_sets)!='[]') { if (JSON.stringify(menu_items[field].item_sets)!='[]') {
fa_plus = ''; fa_plus = '';
@@ -135,7 +140,6 @@ $(function() {
code = instances[i].code; code = instances[i].code;
} }
}); });
} }
if (menu_items[field].image) { if (menu_items[field].image) {
@@ -177,6 +181,9 @@ $(function() {
+'</div>'; +'</div>';
$('.menu_items_list').append(row); $('.menu_items_list').append(row);
} }
//end instances in menu-items alest 1 instance
}
//end is_sub_item false
} }
} }
}); });

View File

@@ -187,7 +187,7 @@
</div> </div>
</div> </div>
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 200 : 160%>"> <div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 200 : 160%>">
<div class="card-text order-info" > <div class="card-text" >
<table class="table table-striped" id="order-items-table"> <table class="table table-striped" id="order-items-table">
<thead> <thead>
<tr> <tr>

View File

@@ -162,7 +162,7 @@
</div> </div>
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 240 : 160%>"> <div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 240 : 160%>">
<div class="card-text order-info"> <div class="card-text">
<table class="table table-striped" id="order-items-table"> <table class="table table-striped" id="order-items-table">
<thead> <thead>
<tr> <tr>

View File

@@ -16,7 +16,13 @@
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 "> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10"> <div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Foreigner</label> <label class="p-l-10">Foreigner</label>
<input type="text" class="form-control" name="survey[foreigner][]"> <!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][]" style="height: " >
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 "> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
@@ -30,7 +36,6 @@
<button type="button" class="btn btn-success" id="addForeigner">Add</button> <button type="button" class="btn btn-success" id="addForeigner">Add</button>
</div> </div>
</div> </div>
<div class="hidden" id="newTemplate" > <div class="hidden" id="newTemplate" >
</div> </div>
@@ -100,7 +105,13 @@
var text_box = '<div id="newRow" class="row clearfix">' var text_box = '<div id="newRow" class="row clearfix">'
+'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">' +'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">'
+'<div class="form-group p-l-10 p-r-10">' +'<div class="form-group p-l-10 p-r-10">'
+' <input type="text" class="form-control" name="survey[foreigner][]">' +' <select class="form-control col-md-12 selectpicker show-tick" '
+' name="survey[foreigner][]" style="height: " >'
+'<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>'
+'<option value="<%= ct.value %>">'
+'<%= ct.name %></option>'
+'<%end %>'
+'</select>'
+'</div>' +'</div>'
+'</div>' +'</div>'
+'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">' +'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">'

View File

@@ -15,7 +15,7 @@
<i class="material-icons">access_time</i> <i class="material-icons">access_time</i>
</span> </span>
<% if !@dining_charge.minimum_free_time.nil?%> <% if !@dining_charge.minimum_free_time.nil?%>
<input type="text" name="dining_charge[minimum_free_time]" value="<%= @dining_charge.minimum_free_time.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)..."> <input type="text" name="dining_charge[minimum_free_time]" value="<%= @dining_charge.minimum_free_time.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)...">
<% else %> <% else %>
<input type="text" name="dining_charge[minimum_free_time]" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)..."> <input type="text" name="dining_charge[minimum_free_time]" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)...">
<% end %> <% end %>
@@ -28,7 +28,7 @@
<i class="material-icons">access_time</i> <i class="material-icons">access_time</i>
</span> </span>
<% if !@dining_charge.charge_block.nil?%> <% if !@dining_charge.charge_block.nil?%>
<input type="text" name="dining_charge[charge_block]" value="<%= @dining_charge.charge_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)..."> <input type="text" name="dining_charge[charge_block]" value="<%= @dining_charge.charge_block.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)...">
<% else %> <% else %>
<input type="text" name="dining_charge[charge_block]" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)..."> <input type="text" name="dining_charge[charge_block]" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)...">
<% end %> <% end %>
@@ -43,7 +43,7 @@
<i class="material-icons">access_time</i> <i class="material-icons">access_time</i>
</span> </span>
<% if !@dining_charge.time_rounding_block.nil?%> <% if !@dining_charge.time_rounding_block.nil?%>
<input type="text" name="dining_charge[time_rounding_block]" value="<%= @dining_charge.time_rounding_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Rounding Time..."> <input type="text" name="dining_charge[time_rounding_block]" value="<%= @dining_charge.time_rounding_block.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Rounding Time...">
<% else %> <% else %>
<input type="text" name="dining_charge[time_rounding_block]" class="timepicker form-control col-md-8" placeholder="Rounding Time..."> <input type="text" name="dining_charge[time_rounding_block]" class="timepicker form-control col-md-8" placeholder="Rounding Time...">
<% end %> <% end %>