Scan of occupied table, make mustache and do something with assets path for local android spinner

User event order added for multiple users
This commit is contained in:
2012-12-07 16:10:51 +01:00
parent 578f6ad696
commit 26877732b9
7 changed files with 37 additions and 17 deletions
@@ -64,7 +64,8 @@ var $translations = {
title: 'Join request',
body: '%{email} wants to join the table',
reject: 'Reject',
approve: 'Approve'
approve: 'Approve',
waiting_for_confirmation: 'Waiting for approval of the person on this table...'
},
move_table: {
cannot_move_to_occupied_table: 'You cannot move to an occupied table',
@@ -98,7 +99,8 @@ var $translations = {
title: 'Lijst deling',
body: '%{email} wil ook op jouw lijst bestellen',
reject: 'Afwijzen',
approve: 'Toestaan'
approve: 'Toestaan',
waiting_for_confirmation: 'Wachten op toestemming van huidige gebruikers om hier te kunnen bestellen...'
},
move_table: {
cannot_move_to_occupied_table: 'Je kan niet verhuizen naar een tafel die reeds gebruikt wordt.',
+6 -4
View File
@@ -36,6 +36,9 @@ class Quser
redirect_to 'list_products', message: 'join_request_approved'
else if(e.event == 'join_request_rejected')
redirect_to 'user_root', message: 'join_request_rejected'
else if(e.event == 'new_order')
$('#active-list-table tbody').append @mustache('#active-list-order-template', new Order(e.data.order))
$('.list-total-amount').html(currency(e.data.total_amount))
console.log(e)
false
home_loader: ->
@@ -226,13 +229,12 @@ class Quser
Mustache.to_html($(selector).html(), locs)
build_list_table: (body, foot, res) ->
body.find('tr').remove()
foot.find('tr').remove()
if !res.orders && !res.orders.length
Qwaiter.alert('No orders in list')
return
m_obj = res
body.append @mustache('#active-list-order-template', new Order(order)) for order in m_obj.orders
foot.append @mustache('#active-list-orders-footer-template', m_obj)
$('.list-total-amount').html(currency(m_obj.total_amount))
order_selected_products: ()->
return if $.isEmptyObject(window.active_products_list)
@@ -370,8 +372,8 @@ class Quser
$('.form-actions').remove()
cont = $('#join-occupied-table-progress-container')
cont.html('')
cont.append $('<img src="/assets/spinner.gif" />')
cont.append $('<p>Waiting for approval of the person on this table</p>')
cont.append $($('<img />').attr('src', "#{$asset_path}spinner.gif"))
cont.append $($('<p>').html(t('join_request.waiting_for_confirmation')))
$.post(data_host + '/user/join_occupied_table', $.extend({table_id: table_id}, authentication_object))
#setInterval('Quser.check_if_can_join_occupied_table("'+table_id+'")', 7500)
add_product: (product_id, count) ->