backup push

This commit is contained in:
2012-08-24 16:20:03 +02:00
parent e3c189d187
commit 4765608e2d
17 changed files with 172 additions and 56 deletions
+27 -20
View File
@@ -1,3 +1,7 @@
.page-header
h4= t('user.show_products.title', products: Product.model_name.human_plural)
= link_to t('helpers.links.show_active_list', list: List.model_name.human), user_active_list_path, class: ['btn btn']
span#list-needs-help-button
table#products-table.table.table-striped.table-hover
tbody
-# content_for :sidebar do
@@ -12,7 +16,7 @@ table#active-order-table.table.table-striped.hide
tfoot
tr
td colspan=2
button class="btn btn-primary" onClick="Qrammer.order_active_list('/order_active_list')" Bestellen
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 btn-warning" onClick="Qrammer.clear_active_list()" Clear
td.currency
@@ -21,26 +25,29 @@ table#active-order-table.table.table-striped.hide
- content_for :footer do
javascript:
jQuery(function(){
$.get('#{product_list_supplier_path(@supplier, format: :json).html_safe}', 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_index = iproduct;
row = $('<tr></tr>');
button = $('<button class="btn btn-mini btn-primary">Add</button>');
var callback = (function(ref){
return function(){ Qrammer.add_product(ref[product_index]) }
})(category_ref)
button.click(callback);
row.append('<td>'+window.products[category][iproduct].name+'</td>');
row.append('<td>'+Qrammer.currency(window.products[category][iproduct].price)+'</td>');
row.append($('<td></td>').append(button));
body.append(row);
Qrammer.handle_active_user_list(function(){
$.get('#{product_list_supplier_path(@supplier, format: :json).html_safe}', 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_index = iproduct;
row = $('<tr></tr>');
button = $('<button class="btn btn-mini btn-primary">Add</button>');
var callback = (function(ref){
return function(){ Qrammer.add_product(ref[product_index]) }
})(category_ref)
button.click(callback);
row.append('<td>'+window.products[category][iproduct].name+'</td>');
row.append('<td>'+Qrammer.currency(window.products[category][iproduct].price)+'</td>');
row.append($('<td></td>').append(button));
body.append(row);
}
}
}
})
setInterval('Qrammer.handle_active_user_list()', 7500);
})
})
@@ -1,10 +1,13 @@
.page-header
h1 List overview
table#active-list-table.table
h4= t('user.active_list.title', list: List.model_name.human)
= link_to t('helpers.links.place_order'), user_products_path, class: ['btn btn-primary']
span#list-needs-payment-button
span#list-needs-help-button
table#active-list-table.table.table-striped
thead
tr
th Order
th.currency Price
th= Order.model_name.human
th.currency= Product.human_attribute_name(:price)
tbody
tfoot
- content_for :footer do
+8
View File
@@ -4,6 +4,14 @@
= f.label :state, class: 'control-label'
.controls
= f.text_field :state, class: 'text_field'
.control-group class=(@list.errors[:need_help].any? ? 'error' : nil)
= f.label :need_help, class: 'control-label'
.controls
= f.check_box :need_help, class: 'check_box'
.control-group class=(@list.errors[:needs_payment].any? ? 'error' : nil)
= f.label :needs_payment, class: 'control-label'
.controls
= f.check_box :needs_payment, class: 'check_box'
.control-group class=(@list.errors[:closed_at].any? ? 'error' : nil)
= f.label :closed_at, class: 'control-label'
.controls
+5 -1
View File
@@ -5,6 +5,8 @@ div.page-header= title :index, model_class
thead
tr
th= model_class.human_attribute_name(:state)
th= model_class.human_attribute_name(:need_help)
th= model_class.human_attribute_name(:needs_payment)
th= model_class.human_attribute_name(:closed_at)
th= Table.model_name.human
th= model_class.human_attribute_name(:created_at)
@@ -13,8 +15,10 @@ div.page-header= title :index, model_class
- @lists.each do |list|
tr
td= link_to list.state, list
td= list.need_help
td= list.needs_payment
td= list.closed_at
td= link_to list.table.number, list.table
td= link_to_if list.table.present?, list.table.try(:number), list.table
td=l list.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, list], class: 'btn btn-mini'
+4
View File
@@ -4,6 +4,10 @@
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:state)
dd= @list.state
dt= model_class.human_attribute_name(:need_help)
dd= @list.need_help
dt= model_class.human_attribute_name(:needs_payment)
dd= @list.needs_payment
dt= model_class.human_attribute_name(:closed_at)
dd= @list.closed_at
- if @list.table.present?
+2 -1
View File
@@ -9,8 +9,9 @@ table#active-lists-table.table.table-striped
tbody
- content_for :footer do
javascript:
var active_lists_interval;
jQuery(function(){
Qrammer.load_active_lists('#{@supplier.id}')
setInterval( "Qrammer.load_active_lists('#{@supplier.id}')", 7500);
active_lists_interval = setInterval( "Qrammer.load_active_lists('#{@supplier.id}')", 7500);
});