add javascript translations, darken background and other confirm
This commit is contained in:
@@ -185,10 +185,10 @@ window.Quser=
|
||||
$.get('/user/table_info.json?table_id='+table.table_id, (res)->
|
||||
if res.current_table_id
|
||||
if res.other_supplier
|
||||
#TODO cannot do something with other supplier when list is active
|
||||
redirect_to 'user_root', {message: 'table_is_from_other_supplier'}
|
||||
else if res.current_table_id == table.table_id
|
||||
#nothing has changed, show product list
|
||||
window.location = '/user/list_products'
|
||||
redirect_to 'list_products'
|
||||
else if res.current_table_id != table.table_id
|
||||
if res.occupied
|
||||
redirect_to 'user_root', {message: 'table_is_occupied'}
|
||||
@@ -200,11 +200,18 @@ window.Quser=
|
||||
redirect_to 'user_root', {message: 'supplier_is_closed'}
|
||||
else
|
||||
#TODO Offer to move table
|
||||
$.post('/user/move_table', {table_id: table.table_id}, (res2)->
|
||||
if res2.occupied
|
||||
alert('Cannot move to occupied table')
|
||||
else
|
||||
window.location = '/user/list_products'
|
||||
Qwaiter.confirm(
|
||||
ok: ->
|
||||
$.post('/user/move_table', {table_id: table.table_id}, (res2)->
|
||||
if res2.occupied
|
||||
alert('Cannot move to occupied table')
|
||||
else
|
||||
redirect_to 'list_products', {message: 'moved_to_another_table'}
|
||||
)
|
||||
cancel: ->
|
||||
redirect_to 'list_products'
|
||||
title: t('confirmations.move_to_another_table_title')
|
||||
content: t('confirmations.move_to_another_table')
|
||||
)
|
||||
else
|
||||
if res.occupied
|
||||
|
||||
Reference in New Issue
Block a user