refactor and fixes for mobile

This commit is contained in:
2012-08-26 20:50:43 +02:00
parent e56badcbf8
commit c087aa0267
16 changed files with 214 additions and 166 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
.phone-wrapper
iframe.phone-content-frame src=phone_root_path
iframe.phone-content-frame src=user_root_path
.tablet-wrapper
iframe.tablet-content-frame src=supplier_root_path
+1 -1
View File
@@ -1,4 +1,4 @@
.page-header= title 'Select Qr code'
ul
ul#qr-list
- for table in @tables
li= link_to image_tag(url_for(qrcode_table_path(table, format: :png))), user_create_list_path(table_id: table.id)
+3 -1
View File
@@ -28,9 +28,11 @@ html lang="en"
span.icon-bar
span.icon-bar
span.icon-bar
a.brand href=phone_root_path Qrammer
a.brand href=user_root_path Qrammer
.container.nav-collapse
ul.nav#top-navigation-list
- if list_open?
li= link_to 'Move table', '#'
li= link_to 'View history', user_history_path
.container
+2 -2
View File
@@ -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);
})
@@ -2,9 +2,6 @@ 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
li= link_to 'Request bill', '#'
li= link_to 'Move table', '#'
li= link_to 'I have a question', '#'
- else
li= link_to 'Join table with Qr scan', '/select_qrcode'
li= link_to 'Subscribe to list', '#'
+4 -24
View File
@@ -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);
})
})