refactor and fixes for mobile
This commit is contained in:
@@ -13,6 +13,6 @@ table#active-list-table.table.table-striped
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Qrammer.active_user_list('#{session[:active_list_id]}')
|
||||
setInterval( "Qrammer.active_user_list('#{session[:active_list_id]}')", 7500);
|
||||
Quser.load_active_list();
|
||||
setInterval( "Quser.load_active_list()", 7500);
|
||||
})
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
ul.nav.nav-tabs.nav-stacked
|
||||
- if list_open?
|
||||
li= link_to 'Place order', user_list_products_path(supplier_id: active_list.supplier.id)
|
||||
li= link_to 'Active list', user_active_list_path
|
||||
- else
|
||||
li= link_to 'Join table with Qr scan', '/select_qrcode'
|
||||
li= link_to 'Subscribe to list', '#'
|
||||
li= link_to 'Check out menu', '#'
|
||||
@@ -16,7 +16,7 @@ table#active-order-table.table.table-striped.hide
|
||||
tfoot
|
||||
tr
|
||||
td colspan=2
|
||||
button class="btn btn-primary" onClick="Qrammer.handle_active_user_list(function(){Qrammer.order_active_products_list('/order_active_products_list')})" Bestellen
|
||||
button class="btn btn-primary" onClick="Quser.handle_active_list(function(){Quser.order_selected_products()})" Bestellen
|
||||
|
|
||||
button class="btn btn btn-warning" onClick="Qrammer.clear_active_list()" Clear
|
||||
td.currency
|
||||
@@ -25,29 +25,9 @@ table#active-order-table.table.table-striped.hide
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
jQuery(function(){
|
||||
Qrammer.handle_active_user_list(function(){
|
||||
$.get('/user/product_list.json', function(res){
|
||||
window.products = res
|
||||
body = $('#products-table tbody')
|
||||
for(var category in window.products){
|
||||
body.append('<tr><td colspan="3"><h4>'+category+'<h4></td></tr>');
|
||||
var category_ref = window.products[category];
|
||||
for(var iproduct = 0; iproduct < window.products[category].length; iproduct++){
|
||||
var product = window.products[category][iproduct];
|
||||
row = $('<tr></tr>');
|
||||
button = $('<button class="btn btn-mini btn-primary">Add</button>');
|
||||
var callback = (function(prod){
|
||||
return function(){ Qrammer.add_product(prod) }
|
||||
})(product)
|
||||
button.click(callback);
|
||||
row.append('<td>'+product.name+'</td>');
|
||||
row.append('<td>'+Qrammer.currency(product.price)+'</td>');
|
||||
row.append($('<td></td>').append(button));
|
||||
body.append(row);
|
||||
}
|
||||
}
|
||||
})
|
||||
setInterval('Qrammer.handle_active_user_list()', 7500);
|
||||
Quser.handle_active_list(function(){
|
||||
Quser.load_active_list_products();
|
||||
setInterval('Quser.handle_active_list()', 7500);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user