diff --git a/app/controllers/ordering_controller.rb b/app/controllers/ordering_controller.rb index 01c14cad..faf3ef02 100644 --- a/app/controllers/ordering_controller.rb +++ b/app/controllers/ordering_controller.rb @@ -169,7 +169,7 @@ class OrderingController < ApplicationController respond_to do |format| format.html # myOrders.haml - format.js { render :partial => "orders" } + format.js { render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true} } end end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index f270b932..d35b243d 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -30,7 +30,7 @@ class OrdersController < ApplicationController format.html format.js do render :update do |page| - page.replace_html 'orders_table', :partial => "list" + page.replace_html 'orders_table', :partial => "orders" end end end diff --git a/app/views/ordering/_orders.html.haml b/app/views/ordering/_orders.html.haml index ba6c3d06..82970631 100644 --- a/app/views/ordering/_orders.html.haml +++ b/app/views/ordering/_orders.html.haml @@ -1,4 +1,4 @@ -- if controller.action_name == 'myOrders' +- if pagination = pagination_links_remote @closed_orders, :per_page => 10, :update => 'closed_orders' %table.list %thead diff --git a/app/views/ordering/index.haml b/app/views/ordering/index.haml index f5c74a69..0bbd3203 100644 --- a/app/views/ordering/index.haml +++ b/app/views/ordering/index.haml @@ -28,7 +28,7 @@ .box_title %h2 Nicht abgerechnete Bestellungen .column_content - = render :partial => "orders", :locals => {:orders => Order.finished_not_closed} + = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} - if @ordergroup.value_of_finished_orders > 0 %p Gesamtsumme: @@ -39,6 +39,6 @@ .box_title %h2 Abgerechnete Bestellungen .column_content - = render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5)} + = render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false} %br/ = link_to "mehr...", :action => "myOrders" \ No newline at end of file diff --git a/app/views/ordering/myOrders.haml b/app/views/ordering/myOrders.haml index 93dc70c9..72f97c11 100644 --- a/app/views/ordering/myOrders.haml +++ b/app/views/ordering/myOrders.haml @@ -7,11 +7,11 @@ .box_title %h2 beendet/nicht abgerechnet .column_content - = render :partial => "orders", :locals => {:orders => Order.finished_not_closed} + = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} .single_column{:style => "width:50em"} .box_title %h2 abgerechnet .column_content #closed_orders - = render :partial => "orders", :locals => {:orders => @closed_orders} + = render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true}