fix flow to work

This commit is contained in:
2012-08-24 16:51:29 +02:00
parent 4765608e2d
commit 1259d5d937
11 changed files with 52 additions and 20 deletions
+6 -6
View File
@@ -33,15 +33,15 @@ table#active-order-table.table.table-striped.hide
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;
var product = window.products[category][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)
var callback = (function(prod){
return function(){ Qrammer.add_product(prod) }
})(product)
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>'+product.name+'</td>');
row.append('<td>'+Qrammer.currency(product.price)+'</td>');
row.append($('<td></td>').append(button));
body.append(row);
}
+4 -4
View File
@@ -29,10 +29,10 @@ html lang="en"
span.icon-bar
span.icon-bar
a.brand href=supplier_root_path Qrammer
.container.nav-collapse-disabled
ul.nav#top-navigation-list
li= link_to t('supplier.menu.active_orders', orders: Order.model_name.human_plural), supplier_orders_path
li= link_to t('supplier.menu.active_lists', lists: List.model_name.human_plural), supplier_lists_path
ul.nav#top-navigation-list
li= link_to t('supplier.menu.active_orders', orders: Order.model_name.human_plural), supplier_orders_path
li= link_to t('supplier.menu.active_lists', lists: List.model_name.human_plural), supplier_lists_path
.container.nav-collapse
.container
+3 -3
View File
@@ -4,10 +4,10 @@
= 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'
.control-group class=(@list.errors[:needs_help].any? ? 'error' : nil)
= f.label :needs_help, class: 'control-label'
.controls
= f.check_box :need_help, class: 'check_box'
= f.check_box :needs_help, class: 'check_box'
.control-group class=(@list.errors[:needs_payment].any? ? 'error' : nil)
= f.label :needs_payment, class: 'control-label'
.controls
+2 -2
View File
@@ -5,7 +5,7 @@ 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_help)
th= model_class.human_attribute_name(:needs_payment)
th= model_class.human_attribute_name(:closed_at)
th= Table.model_name.human
@@ -15,7 +15,7 @@ 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_help
td= list.needs_payment
td= list.closed_at
td= link_to_if list.table.present?, list.table.try(:number), list.table
+2 -2
View File
@@ -4,8 +4,8 @@
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_help)
dd= @list.needs_help
dt= model_class.human_attribute_name(:needs_payment)
dd= @list.needs_payment
dt= model_class.human_attribute_name(:closed_at)
+1 -1
View File
@@ -1,4 +1,4 @@
.page-header= title 'Active lists'
.page-header= title t('supplier.active_lists.title', lists: List.model_name.human_plural)
table#active-lists-table.table.table-striped
thead
tr