order product fixes

This commit is contained in:
2012-12-07 16:49:23 +01:00
parent 118afb7da9
commit b5ddd448b2
3 changed files with 6 additions and 6 deletions
+1 -2
View File
@@ -238,9 +238,8 @@ class Quser
order_selected_products: ()->
return if $.isEmptyObject(window.active_products_list)
return unless Qstorage.table_id
h = {}
h['table_id'] = Qstorage.table_id
h['table_id'] = Qstorage.getItem('table_id') if Qstorage.getItem('table_id')
for product_id, number of window.active_products_list
h['products['+product_id+']'] = number
$.post(data_host + '/user/order_selected_products', $.extend(h, authentication_object), ((res) => @handle_response(res)), 'json')
+2 -1
View File
@@ -254,9 +254,10 @@ class UserController < ApplicationController
if list.present?
@list = list
else
render json: js_alert('table_not_found') and return unless params[:table_id].present?
@table = Table.find(params[:table_id])
if @table.occupied?
#TODO handle placint order on occupied table
render json: js_alert('table_is_occupied')
else
if @list = List.from_table( @table, current_user )
else
+3 -3
View File
@@ -12,9 +12,9 @@
tr
td= slider_image
#active-order-container
script#products-category-template[type="text/html"]= render 'products_category.mustache'
script#products-category-for-order-template[type="text/html"]= render 'products_category_for_order.mustache'
script#active-order-template[type="text/html"]= render 'active_order.mustache'
script#products-category-template[type="text/html"]= mustache_template 'products_category'
script#products-category-for-order-template[type="text/html"]= mustache_template 'products_category_for_order'
script#active-order-template[type="text/html"]= mustache_template 'active_order'
- content_for :footer do
javascript:
jQuery(function(){