Merge branch 'oqs' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(".nav-completed").on("click", function(){
|
$(".nav-completed").on("click", function(){
|
||||||
$("#completed").removeClass('hide')
|
$("#completed").removeClass('hide')
|
||||||
$(".oqs_append").addClass('hide')
|
$(".oqs_append").addClass('hide')
|
||||||
@@ -38,8 +36,6 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
show_details(url);
|
show_details(url);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}); //End Click
|
}); //End Click
|
||||||
|
|
||||||
function show_details(url){
|
function show_details(url){
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ $(function(){
|
|||||||
});
|
});
|
||||||
//End menu category Click
|
//End menu category Click
|
||||||
|
|
||||||
$("#set_change_qty").change(function(){
|
|
||||||
qty = $(this).val();
|
|
||||||
price = $("#set_total_price").text();
|
|
||||||
$("#set_total_price").text(qty*price);
|
|
||||||
});
|
|
||||||
|
|
||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_menu_item_list(url_item){
|
function show_menu_item_list(url_item){
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
@@ -107,7 +101,7 @@ $(function(){
|
|||||||
$(document).on('click', '.set_item_box', function(event){
|
$(document).on('click', '.set_item_box', function(event){
|
||||||
$(".instance-list").empty();
|
$(".instance-list").empty();
|
||||||
$(".options-list").empty();
|
$(".options-list").empty();
|
||||||
|
change_qty_plus_minus("set_count","set_plus","set_minus");
|
||||||
data = $(this).parent().children().children('.add_icon');
|
data = $(this).parent().children().children('.add_icon');
|
||||||
|
|
||||||
instances = $(this).data('instance');
|
instances = $(this).data('instance');
|
||||||
@@ -152,8 +146,10 @@ $(function(){
|
|||||||
$('#set_item_instances').text(instances);
|
$('#set_item_instances').text(instances);
|
||||||
$('#set_name').text(data.attr('data-name'));
|
$('#set_name').text(data.attr('data-name'));
|
||||||
$('#set_item_code').text(data.attr('data-item-code'));
|
$('#set_item_code').text(data.attr('data-item-code'));
|
||||||
$('#set_total_price').text(data.attr('data-price'));
|
// $('#set_total_price').text(data.attr('data-price'));
|
||||||
|
$('#set_total_price').text(0);
|
||||||
$('#set_unit_price').text(data.attr('data-price'));
|
$('#set_unit_price').text(data.attr('data-price'));
|
||||||
|
// $('#set_unit_price').text(0);
|
||||||
});
|
});
|
||||||
// click instance for add item set
|
// click instance for add item set
|
||||||
$(document).on('click', '.instance_box', function(event){
|
$(document).on('click', '.instance_box', function(event){
|
||||||
@@ -179,7 +175,8 @@ $(function(){
|
|||||||
sub_total = $('#set_total_price').text();
|
sub_total = $('#set_total_price').text();
|
||||||
name = $(this).data('name');
|
name = $(this).data('name');
|
||||||
price = $(this).data('price');
|
price = $(this).data('price');
|
||||||
qty = $('#set_change_qty').val();
|
// qty = $('#set_change_qty').val();
|
||||||
|
qty = document.getElementById("set_count").value;
|
||||||
total = qty*price;
|
total = qty*price;
|
||||||
var total_price = +sub_total - +total;
|
var total_price = +sub_total - +total;
|
||||||
$(this).removeClass('selected-instance');
|
$(this).removeClass('selected-instance');
|
||||||
@@ -187,21 +184,24 @@ $(function(){
|
|||||||
$(this).removeAttr('data-options');
|
$(this).removeAttr('data-options');
|
||||||
$('#instance_option').text('')
|
$('#instance_option').text('')
|
||||||
}else {
|
}else {
|
||||||
|
|
||||||
sub_total = $('#set_total_price').text();
|
sub_total = $('#set_total_price').text();
|
||||||
name = $(this).data('name');
|
name = $(this).data('name');
|
||||||
price = $(this).data('price');
|
price = $(this).data('price');
|
||||||
qty = $('#set_change_qty').val();
|
// qty = $('#set_change_qty').val();
|
||||||
|
qty = document.getElementById("set_count").value;
|
||||||
total = qty*price;
|
total = qty*price;
|
||||||
var total_price = +sub_total + +total;
|
var total_price = +sub_total + +total;
|
||||||
$(this).addClass('selected-instance');
|
$(this).addClass('selected-instance');
|
||||||
}
|
}
|
||||||
|
$('#set_unit_price').text(price);
|
||||||
$('#set_total_price').text(total_price);
|
$('#set_total_price').text(total_price);
|
||||||
}); //End selecct attribute buttom
|
}); //End selecct attribute buttom
|
||||||
|
|
||||||
// click add order
|
// click add order
|
||||||
$(document).on('click', '.set_order', function(event){
|
$(document).on('click', '.set_order', function(event){
|
||||||
total_price = $('#set_total_price').text();
|
total_price = $('#set_total_price').text();
|
||||||
qty = parseInt($('#set_change_qty').val());
|
qty = parseInt($('#set_count').val());
|
||||||
item_code = $('#set_item_code').text();
|
item_code = $('#set_item_code').text();
|
||||||
item_name = $('#set_name').text();
|
item_name = $('#set_name').text();
|
||||||
|
|
||||||
@@ -253,6 +253,8 @@ $(function(){
|
|||||||
$('.add_to_order').removeAttr('data-attributes');
|
$('.add_to_order').removeAttr('data-attributes');
|
||||||
$('.add_to_order').removeAttr('data-options');
|
$('.add_to_order').removeAttr('data-options');
|
||||||
|
|
||||||
|
change_qty_plus_minus("count","plus","minus");
|
||||||
|
|
||||||
data = $(this).parent().children().children('.add_icon');
|
data = $(this).parent().children().children('.add_icon');
|
||||||
|
|
||||||
$('#total_price').text(data.attr('data-price'));
|
$('#total_price').text(data.attr('data-price'));
|
||||||
@@ -275,19 +277,42 @@ $(function(){
|
|||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
options = value[i];
|
options = value[i];
|
||||||
instance_attributes.push(options);
|
instance_attributes.push(options);
|
||||||
|
// $.ajax({
|
||||||
|
// type: "GET",
|
||||||
|
// url: '../../api/restaurant/menu_item_attributes/'+value[i],
|
||||||
|
// data: {id:value[i]},
|
||||||
|
// success:function(result){
|
||||||
|
|
||||||
|
// options = result["name"];
|
||||||
|
// instance_attributes.push(options);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// selected_arr = []
|
||||||
|
// $(selected_item).each(function(i){
|
||||||
|
// $.ajax({
|
||||||
|
// type: "GET",
|
||||||
|
// url: '../../api/restaurant/menu_item_attributes/'+selected_item[i],
|
||||||
|
// data: {id:selected_item[i]},
|
||||||
|
// success:function(result){
|
||||||
|
// name = result["name"];
|
||||||
|
// selected_arr.push(name);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
for(var field in attributes) {
|
for(var field in attributes) {
|
||||||
value = attributes[field]["values"];
|
value = attributes[field]["values"];
|
||||||
type = attributes[field]["type"]
|
type = attributes[field]["type"]
|
||||||
row = "<h4>"+attributes[field]["type"]+"</h4>"
|
row = "<h4>"+attributes[field]["type"]+"</h4>";
|
||||||
|
|
||||||
$(value).each(function(i){
|
$(value).each(function(i){
|
||||||
disabled = ""
|
disabled = ""
|
||||||
status ="";
|
status ="";
|
||||||
|
if(parseInt(jQuery.inArray(value[i], selected_item)) !== -1){
|
||||||
|
|
||||||
if(parseInt(jQuery.inArray(value[i], selected_item))!== -1){
|
|
||||||
status = "selected-attribute";
|
status = "selected-attribute";
|
||||||
}
|
}
|
||||||
if(parseInt(jQuery.inArray(value[i], instance_attributes)) == -1){
|
if(parseInt(jQuery.inArray(value[i], instance_attributes)) == -1){
|
||||||
@@ -326,6 +351,8 @@ $(function(){
|
|||||||
|
|
||||||
// click select option icon for add
|
// click select option icon for add
|
||||||
$(document).on('click', '.attribute_btn', function(event){
|
$(document).on('click', '.attribute_btn', function(event){
|
||||||
|
|
||||||
|
$('.change_qty').val(1);
|
||||||
value = $(this).data('value');
|
value = $(this).data('value');
|
||||||
type = $(this).data('type');
|
type = $(this).data('type');
|
||||||
instances = $(this).data('instances');
|
instances = $(this).data('instances');
|
||||||
@@ -345,7 +372,7 @@ $(function(){
|
|||||||
|
|
||||||
var selected_attr = get_selected_attributes('selected-attribute');
|
var selected_attr = get_selected_attributes('selected-attribute');
|
||||||
|
|
||||||
qty = $('#change_qty').val();
|
qty = $('.change_qty').val();
|
||||||
|
|
||||||
for(var field in instances) {
|
for(var field in instances) {
|
||||||
item_attr = instances[field].values;
|
item_attr = instances[field].values;
|
||||||
@@ -652,24 +679,72 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Get Selected Class
|
||||||
|
function change_qty_plus_minus(id,plus,minus) {
|
||||||
|
|
||||||
var count = 1;
|
var count = 1;
|
||||||
var countEl = document.getElementById("count");
|
var countEl = document.getElementById(id);
|
||||||
$("#plus").on("click", function(){
|
|
||||||
|
$('#'+plus).on("click", function(){
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
countEl.value = count;
|
countEl.value = count;
|
||||||
|
|
||||||
|
|
||||||
|
if (id == "count") {
|
||||||
price = $("#unit_price").text();
|
price = $("#unit_price").text();
|
||||||
$("#total_price").text(count*price);
|
$("#total_price").text(count*price);
|
||||||
|
}else{
|
||||||
|
var item_row = $('.selected-instance');
|
||||||
|
price = $("#set_unit_price").text();
|
||||||
|
set_total_price = $("#set_total_price").text();
|
||||||
|
|
||||||
|
if (item_row.length > 1) {
|
||||||
|
total = 0 ;
|
||||||
|
$(item_row).each(function(i){
|
||||||
|
total += count * $(item_row[i]).attr('data-price');
|
||||||
|
total_price = total;
|
||||||
});
|
});
|
||||||
$("#minus").on("click", function(){
|
}else{
|
||||||
|
total_price = count*price;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#set_total_price").text(total_price);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#'+minus).on("click", function(){
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
count--;
|
count--;
|
||||||
countEl.value = count;
|
countEl.value = count;
|
||||||
|
|
||||||
|
if (id=="count") {
|
||||||
price = $("#unit_price").text();
|
price = $("#unit_price").text();
|
||||||
$("#total_price").text(count*price);
|
$("#total_price").text(count*price);
|
||||||
|
}else{
|
||||||
|
var item_row = $('.selected-instance');
|
||||||
|
price = $("#set_unit_price").text();
|
||||||
|
set_total_price = $("#set_total_price").text();
|
||||||
|
|
||||||
|
if (item_row.length > 1) {
|
||||||
|
total = 0 ;
|
||||||
|
$(item_row).each(function(i){
|
||||||
|
total += count * $(item_row[i]).attr('data-price');
|
||||||
|
total_price = total;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
total_price = count*price;
|
||||||
|
}
|
||||||
|
$("#set_total_price").text(total_price);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// $("#set_change_qty").change(function(){
|
||||||
|
// qty = $(this).val();
|
||||||
|
// price = $("#set_total_price").text();
|
||||||
|
// $("#set_total_price").text(qty*price);
|
||||||
|
// });
|
||||||
|
|
||||||
// $(".change_qty").change(function(){
|
// $(".change_qty").change(function(){
|
||||||
// qty = $(this).val();
|
// qty = $(this).val();
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
|
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
|
||||||
|
skip_before_action :authenticate
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
def index
|
def index
|
||||||
@menu_attributes = MenuItemAttribute.all
|
@menu_attributes = MenuItemAttribute.all
|
||||||
end
|
end
|
||||||
|
def show
|
||||||
|
@attribute = MenuItemAttribute.find(params[:id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,10 +30,19 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
@booking = nil
|
@booking = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_menu_category ()
|
||||||
|
if (params[:id])
|
||||||
|
#Pull this menu
|
||||||
|
@menu = MenuCategory.find_by_id(params[:id])
|
||||||
|
return @menu
|
||||||
|
else
|
||||||
|
MenuCategory.current_menu
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
Rails.logger.debug "Order Source - " + params[:order_source].to_s
|
Rails.logger.debug "Order Source - " + params[:order_source].to_s
|
||||||
Rails.logger.debug "Table ID - " + params[:table_id].to_s
|
Rails.logger.debug "Table ID - " + params[:table_id].to_s
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
if(@attribute)
|
||||||
|
json.id @attribute.id
|
||||||
|
json.type @attribute.attribute_type
|
||||||
|
json.name @attribute.name
|
||||||
|
json.value @attribute.value
|
||||||
|
else
|
||||||
|
json.success false
|
||||||
|
end
|
||||||
117
app/views/origami/addorders/_menu_item.json.jbuilder
Normal file
117
app/views/origami/addorders/_menu_item.json.jbuilder
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
# Format for attributes json
|
||||||
|
attr_format = []
|
||||||
|
# Format for attributes json
|
||||||
|
if item.item_attributes.count > 0
|
||||||
|
item.item_attributes.each do|attr_id|
|
||||||
|
menu_attr = MenuItemAttribute.find(attr_id)
|
||||||
|
if attr_format.count == 0
|
||||||
|
attr_format.push({ type: menu_attr.attribute_type, values: [menu_attr.name] })
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_format.each do |af|
|
||||||
|
if menu_attr.attribute_type.in? attr_format.map {|k| k[:type]}
|
||||||
|
if menu_attr.attribute_type == af[:type]
|
||||||
|
af[:values].push(menu_attr.name)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
new_attr = {type: menu_attr.attribute_type, values: [ menu_attr.name ] }
|
||||||
|
attr_format.push(new_attr)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Format for option json
|
||||||
|
opt_format = []
|
||||||
|
# Format for attributes json
|
||||||
|
if item.item_options.count > 0
|
||||||
|
item.item_options.each do|opt|
|
||||||
|
menu_opt = MenuItemOption.find(opt)
|
||||||
|
if opt_format.count == 0
|
||||||
|
opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] })
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
|
opt_format.each do |of|
|
||||||
|
if menu_opt.option_type.in? opt_format.map {|k| k[:type]}
|
||||||
|
if menu_opt.option_type == of[:type]
|
||||||
|
of[:values].push(menu_opt.name)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
new_opt = {type: menu_opt.option_type, values: [ menu_opt.name ] }
|
||||||
|
opt_format.push(new_opt)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#Menu Item Information
|
||||||
|
json.id item.id
|
||||||
|
json.code item.item_code
|
||||||
|
json.name item.name
|
||||||
|
json.alt_name item.alt_name
|
||||||
|
json.image item.image_path.url
|
||||||
|
json.description item.description
|
||||||
|
json.information item.information
|
||||||
|
json.type item.type
|
||||||
|
json.account_id item.account_id
|
||||||
|
json.min_qty item.min_qty
|
||||||
|
json.is_available item.is_available
|
||||||
|
json.is_sub_item item.is_sub_item
|
||||||
|
json.unit item.unit
|
||||||
|
|
||||||
|
# Item Sets of Menu Item
|
||||||
|
json.item_sets item.item_sets do |its|
|
||||||
|
json.id its.id
|
||||||
|
json.name its.name
|
||||||
|
json.alt_name its.alt_name
|
||||||
|
json.min_selectable_qty its.min_selectable_qty
|
||||||
|
json.max_selectable_qty its.max_selectable_qty
|
||||||
|
json.instances its.menu_item_instances do |i|
|
||||||
|
json.id i.id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
json.attributes attr_format
|
||||||
|
json.options opt_format
|
||||||
|
# json.min_selectable_item item.min_selectable_item
|
||||||
|
# json.max_selectable_item item.max_selectable_item
|
||||||
|
|
||||||
|
#Item instance
|
||||||
|
# if item.menu_item_instances.count == 1 then
|
||||||
|
# item_instance = item.menu_item_instances[0]
|
||||||
|
# json.price = item_instance.price
|
||||||
|
# json.is_available = item_instance.is_available
|
||||||
|
# json.is_on_promotion = item_instance.is_on_promotion
|
||||||
|
# json.promotion_price = item_instance.promotion_price
|
||||||
|
# json.item_attributes = item_instance.item_attributes
|
||||||
|
|
||||||
|
json.instances item.menu_item_instances do |is|
|
||||||
|
# Convert id to name for attributes
|
||||||
|
instance_attr = []
|
||||||
|
is.item_attributes.each do |ia|
|
||||||
|
mItemAttr = MenuItemAttribute.find(ia).name
|
||||||
|
instance_attr.push(mItemAttr)
|
||||||
|
end
|
||||||
|
|
||||||
|
json.id is.id
|
||||||
|
json.code is.item_instance_code
|
||||||
|
json.name is.item_instance_name
|
||||||
|
json.price is.price
|
||||||
|
json.is_available is.is_available
|
||||||
|
json.is_default is.is_default
|
||||||
|
json.is_on_promotion is.is_on_promotion
|
||||||
|
json.promotion_price is.promotion_price
|
||||||
|
json.values instance_attr
|
||||||
|
# json.item_sets is.item_sets
|
||||||
|
end
|
||||||
|
|
||||||
|
#Child Menu items
|
||||||
|
# if (item.children) then
|
||||||
|
# json.set_items item.children.each do |item|
|
||||||
|
# json.partial! 'api/restaurant/menu/menu_item', item: item
|
||||||
|
# end
|
||||||
|
# end
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<ul class="nav nav-tabs flex-column" role="tablist" >
|
<ul class="nav nav-tabs flex-column" role="tablist" >
|
||||||
<% @menu.each do |menu| %>
|
<% @menu.each do |menu| %>
|
||||||
<li class="nav-item menu_category" data-ref="<%= api_restaurant_menu_category_path menu.id%>">
|
<li class="nav-item menu_category" data-ref="<%= origami_get_menu_category_path menu.id%>">
|
||||||
<p class="hidden menu-id"><%= menu.id %></p>
|
<p class="hidden menu-id"><%= menu.id %></p>
|
||||||
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%></a>
|
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%></a>
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<span class="glyphicon glyphicon-minus"></span>
|
<span class="glyphicon glyphicon-minus"></span>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" value="1" id="count" class="form-control col-md-12 ">
|
<input type="text" value="1" id="count" class="change_qty form-control col-md-12 ">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="button" class="btn btn-success btn-number" value="+" id="plus">
|
<button type="button" class="btn btn-success btn-number" value="+" id="plus">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
@@ -171,10 +171,25 @@
|
|||||||
<div class="row set-item">
|
<div class="row set-item">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<p style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
|
<p style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label class="col-md-6" style="margin-top:5px">Quantity</label>
|
<label class="col-md-6" style="margin-top:5px">Quantity</label>
|
||||||
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="set_change_qty" value="" min="1" max="100">
|
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="set_change_qty" value="" min="1" max="100">
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button type="button" class="btn btn-danger btn-number" value="-" id="set_minus">
|
||||||
|
<span class="glyphicon glyphicon-minus"></span>
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
<input type="text" value="1" id="set_count" class="set_change_qty form-control col-md-12 ">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button type="button" class="btn btn-success btn-number" value="+" id="set_plus">
|
||||||
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="hidden" id="set_unit_price"></p>
|
<p class="hidden" id="set_unit_price"></p>
|
||||||
<p class="hidden" id="set_instance_code"></p>
|
<p class="hidden" id="set_instance_code"></p>
|
||||||
<p class="hidden" id="set_instance_name"></p>
|
<p class="hidden" id="set_instance_name"></p>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
if @menu.menu_items
|
||||||
|
json.menu_items @menu.menu_items do |item|
|
||||||
|
json.partial! 'origami/addorders/menu_item', item: item
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -33,7 +33,7 @@ Rails.application.routes.draw do
|
|||||||
resources :menu, only: [:index, :show]
|
resources :menu, only: [:index, :show]
|
||||||
resources :menu_categories, only: [:index, :show]
|
resources :menu_categories, only: [:index, :show]
|
||||||
resources :menu_items, only: [:index, :show]
|
resources :menu_items, only: [:index, :show]
|
||||||
resources :menu_item_attributes, only: [:index]
|
resources :menu_item_attributes, only: [:index, :show]
|
||||||
resources :menu_item_options, only: [:index]
|
resources :menu_item_options, only: [:index]
|
||||||
resources :menu_sold_out, only: [:index]
|
resources :menu_sold_out, only: [:index]
|
||||||
resources :menu_item_instances, only: [:show]
|
resources :menu_item_instances, only: [:show]
|
||||||
@@ -180,6 +180,7 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
get '/:addorders/:id' => "addorders#detail"
|
get '/:addorders/:id' => "addorders#detail"
|
||||||
post '/:addorders/create' => "addorders#create", :defaults => { :format => 'json' }
|
post '/:addorders/create' => "addorders#create", :defaults => { :format => 'json' }
|
||||||
|
get '/addorders/get_menu_category/:id' => "addorders#get_menu_category",:as => "get_menu_category", :defaults => { :format => 'json' }
|
||||||
|
|
||||||
resources :commissions
|
resources :commissions
|
||||||
resources :commissioners
|
resources :commissioners
|
||||||
|
|||||||
Reference in New Issue
Block a user