Second part of admin-namespace-reorder. Also renamed OrderGroup into Ordergroup. More view-sharing between groups is neccessary.

This commit is contained in:
Benjamin Meichsner 2009-01-14 12:46:01 +01:00
parent 2d5dc03b90
commit fadc951208
83 changed files with 410 additions and 518 deletions

View file

@ -1,5 +1,5 @@
- if controller.action_name == 'myOrders'
= pagination_links_remote @bookedOrders, 10, {:show_all => params[:show_all]}
= pagination_links_remote @bookedOrders, :per_page => 10, :params => {:show_all => params[:show_all]}
%table.list
%thead
%tr
@ -16,7 +16,7 @@
%td= format_time(order.order.ends)
%td{:class => "currency"}= number_to_currency(order.price)
- else
// check if the OrderGroup has ordered
// check if the Ordergroup has ordered
- if groupOrder = order.group_order(@orderGroup)
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders')}
%td= link_to order.name, :action => 'my_order_result', :id => order

View file

@ -17,7 +17,7 @@
%td= link_to order.name, :controller => 'ordering', :action => 'order', :id => order
%td=h order.supplier.name
%td=h format_time(order.ends) unless order.ends.nil?
- if (groupOrder = order.group_orders.find(:first, :conditions => ["order_group_id = ?", @orderGroup.id]))
- if (groupOrder = order.group_orders.find(:first, :conditions => ["ordergroup_id = ?", @orderGroup.id]))
- total += groupOrder.price
%td=h groupOrder.updated_by.nil? ? '??' : "#{groupOrder.updated_by.nick} (#{format_time(groupOrder.updated_on)})"
%td= number_to_currency(groupOrder.price)

View file

@ -14,7 +14,7 @@
%td= format_time(order.order.ends)
%td{:class => "currency"}= number_to_currency(order.price)
- else
// check if the OrderGroup has ordered
// check if the Ordergroup has ordered
- if groupOrder = order.group_order(@orderGroup)
%tr{:class=> cycle('even', 'odd', :name => 'finishedOrders')}
%td= link_to order.name, :action => 'my_order_result', :id => order

View file

@ -1,6 +1,6 @@
%h1= _('Order Overview')
// OrderGroups Account Balance
// Ordergroups Account Balance
.left_column{:style => "width:26%"}
.box_title
%h2=h @orderGroup.name

View file

@ -147,7 +147,7 @@
</tr>
<tr>
<td colspan="6"></td>
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @order_group.account_balance - total %></span> <%= L18n.number.currency.format.unit %></strong></td>
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @ordergroup.account_balance - total %></span> <%= L18n.number.currency.format.unit %></strong></td>
</tr>
<tr>
<td style="text-align:left;"><%= link_to_top %></td>
@ -157,7 +157,7 @@
</tfoot>
</table>
</div>
<input type="hidden" id="total_balance" name="total_balance" value="<%= @order_group.account_balance - total %>"/>
<input type="hidden" id="total_balance" name="total_balance" value="<%= @ordergroup.account_balance - total %>"/>
<input type="hidden" name="version" value="<%= @version %>"/>
<% end %>
</div>