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

@ -6,7 +6,7 @@
= error_messages_for 'result'
%p
Gruppe:
= @form.select "group_order_result_id", OrderGroup.find(:all, :order => "name").collect {|og| [og.name, og.id] }
= @form.select "group_order_result_id", Ordergroup.find(:all, :order => "name").collect {|og| [og.name, og.id] }
%p
Menge:
= @form.text_field "quantity", :size => 5

View file

@ -35,7 +35,7 @@
- @financial_transactions.each do |ft|
%tr{:class => cycle("even","odd", :name => "financial_transaction")}
%td= format_date(ft.created_on)
%td= ft.order_group.name
%td= ft.ordergroup.name
%td{:style => "width:50%"}=h ft.note
%td{:style => "color:#{ft.amount < 0 ? 'red' : 'black'}", :class => "currency"}= number_to_currency(ft.amount)

View file

@ -7,7 +7,7 @@
<p>Anzahl gefundener Transaktionen: <b><%= @total %></b></p>
<p>
<%= pagination_links_remote @financial_transactions, @per_page, {:sort => params[:sort], :query => params['query']}%>
<%= pagination_links_remote @financial_transactions, :params => {:sort => params[:sort], :query => params['query']}%>
</p>

View file

@ -1,6 +1,6 @@
%tr.transaction
%td
%select{:name => 'financial_transactions[][order_group_id]'}
= options_for_select OrderGroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] }
%select{:name => 'financial_transactions[][ordergroup_id]'}
= options_for_select Ordergroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] }
%td= text_field_tag 'financial_transactions[][amount]'
%td= link_to_function image_tag("b_drop.png", :size => "16x16", :alt => _("Remove"), :border => "0"), "$(this).up('.transaction').remove()", {:title => _("Remove ordergroup")}

View file

@ -5,7 +5,7 @@
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @groups, @per_page, {:sort => params[:sort]}
= pagination_links_remote @groups, :params => {:sort => params[:sort]}
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page

View file

@ -22,4 +22,4 @@
= render :partial => "ordergroups"
%br/
- if @current_user.role_admin?
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrderGroup'
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrdergroup'

View file

@ -3,7 +3,7 @@
.edit_form{ :style => "width:30em" }
- form_for(@financial_transaction, :url => { :action => 'create' }) do |f|
= f.error_messages
= f.hidden_field :order_group_id
= f.hidden_field :ordergroup_id
%p
Group:
%b=h @group.name

View file

@ -5,15 +5,15 @@
%b= _("Note") + ":"
= text_field_tag "note"
%p
%table#OrderGroups{:style => "width:20em"}
%table#Ordergroups{:style => "width:20em"}
%tr
%th=_ "Ordergroup"
%th=_ "Amount"
= render :partial => 'order_group', :collection => [1, 2, 3]
= render :partial => 'ordergroup', :collection => [1, 2, 3]
%p
= link_to_function _("Add another ordergroup") do |page|
- page.insert_html :bottom, :OrderGroups, :partial => 'order_group'
- page.insert_html :bottom, :Ordergroups, :partial => 'ordergroup'
%p
= submit_tag _("Save")
|