Merge branch 'master' of git://github.com/bennibu/foodsoft

This commit is contained in:
sandoz 2009-03-23 23:58:10 +01:00
commit 3a8de36ca6
44 changed files with 110 additions and 85 deletions

View file

@ -2,7 +2,7 @@ class MessagesController < ApplicationController
# Renders the "inbox" action.
def index
@messages = Message.public.all :order => 'created_at DESC', :limit => 100
@messages = Message.public.paginate :page => params[:page], :per_page => 20, :order => 'created_at DESC'
end
# Creates a new message object.

View file

@ -103,7 +103,7 @@ class TasksController < ApplicationController
# Shows all tasks, which are already done
def archive
@tasks = Task.done
@tasks = Task.done.paginate :page => params[:page], :per_page => 30
end
# shows workgroup (normal group) to edit weekly_tasks_template

View file

@ -21,8 +21,8 @@ module ApplicationHelper
update = options[:update] || nil
# Translations
previous_label = '&laquo; ' + _('Previous')
next_label = _('Next') + ' &raquo;'
previous_label = '&laquo; ' + "Vorherige"
next_label = "Nächste" + ' &raquo;'
# Merge other url-options for will_paginate
params = params.merge({:per_page => per_page})
will_paginate collection, { :params => params, :remote => true, :update => update,
@ -49,7 +49,7 @@ module ApplicationHelper
links << per_page
end
end
return _('Per page: ') + links.join(" ")
return "Pro Seite: " + links.join(" ")
end
def sort_td_class_helper(param)

View file

@ -77,6 +77,16 @@ class OrderArticle < ActiveRecord::Base
units += ((remainder > 0) && (remainder + tolerance >= unit_size) ? 1 : 0)
end
# Calculate price for ordered quantity.
def total_price
units_to_order * price.price
end
# Calculate gross price for ordered qunatity.
def total_gross_price
units_to_order * price.gross_price
end
def ordered_quantities_equal_to_group_orders?
(units_to_order * price.unit_quantity) == group_orders_sum[:quantity]
end

View file

@ -21,7 +21,7 @@ class Task < ActiveRecord::Base
belongs_to :workgroup
named_scope :non_group, :conditions => { :workgroup_id => nil, :done => false }
named_scope :done, :conditions => {:done => true}, :order => "due_date ASC"
named_scope :done, :conditions => {:done => true}, :order => "due_date DESC"
named_scope :upcoming, lambda { |*args| {:conditions => ["done = 0 AND due_date = ?", (args.first || 7.days.from_now)]} }
# form will send user in string. responsibilities will added later

View file

@ -1,14 +1,14 @@
- title "Administration"
%p
%i Hier kannst Du die Gruppen und Benutzer der Foodsoft verwalten.
%i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten.
.left_column{:style => "width:48%"}
.box_title
%h2 Neuste Benutzer
%h2 Neuste Benutzerinnen
.column_content
%table
%tr
%th Nick
%th Benutzername
%th Name
%th Erstellt am
- for user in @users
@ -27,7 +27,7 @@
.column_content
%table
%tr
%th Name
%th Gruppenname
%th Typ
%th Mitglieder
- for group in @groups

View file

@ -13,7 +13,7 @@
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
%span{:style => "float:left"}
Lieferant wechseln:
Lieferantin wechseln:
- form_tag do
= select_tag :switch_supplier, |
options_for_select( Supplier.all(:order => 'name').collect {|s| [s.name, url_for(supplier_articles_path(s))] }, |

View file

@ -1,7 +1,7 @@
- title "Lieferung bearbeiten"
%p
%b Lieferant:
%b Lieferantin:
= @supplier.name
%p
%b Rechnungsbetrag:

View file

@ -1,7 +1,7 @@
- title "Lieferung anzeigen"
%p
%b Lieferant:
%b Lieferantin:
=h @delivery.supplier.name
%p
%b Geliefert am:

View file

@ -10,8 +10,8 @@
%th Nr.
%th Menge
%th GebGr * Einheit
%th netto
%th brutto
%th Netto
%th Brutto
%th MwSt
%th Pfand
%th{:colspan => "2"}

View file

@ -32,7 +32,7 @@
%tfoot
%tr{:class => cycle('even', 'odd', :name => 'results')}
%td
%td{:style => "width:8em"} Summe
%td{:style => "width:8em"} Summe (FC-Preis)
%td{:id => "group_orders_sum_quantity_#{order_article.id}"}
= order_article.group_orders_sum[:quantity]
%td{:id => "group_orders_sum_price_#{order_article.id}", :class => "currency"}

View file

@ -8,8 +8,14 @@
- unless order_article.ordered_quantities_equal_to_group_orders?
%span{:style => "color:red;font-weight: bold"} !
%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s
%td= number_to_currency(order_article.price.price, :unit => "")
%td= number_to_currency(order_article.price.gross_price, :unit => "")
%td
= number_to_currency(order_article.price.price, :unit => ""), |
"/ ", |
number_to_currency(order_article.total_price, :unit => "") |
%td
= number_to_currency(order_article.price.gross_price, :unit => ""), |
"/ ", |
number_to_currency(order_article.total_gross_price, :unit => "") |
%td= order_article.price.tax
%td= order_article.price.deposit
%td

View file

@ -8,7 +8,7 @@
%abbr{:title=>"Anzahl gelieferter Gebinde"} Menge
%th Einheit
%th GebGr
%th netto
%th Netto
%th MwSt.
%th Pfand
%tr

View file

@ -9,7 +9,7 @@
%tr
%th Datum
%th Betrag
%th Lieferant
%th Lieferantin
%th
%tbody
- for invoice in @unpaid_invoices
@ -48,7 +48,7 @@
%table.list
%thead
%tr
%th Lieferant
%th Lieferantin
%th Ende
%th Betrag(FC)
%th

View file

@ -8,7 +8,7 @@
- if @invoice.order
%p= "Diese Rechnung ist mit einer #{link_to "Bestellung", @invoice.order} verknüpft."
%p
Lieferant
Lieferantin
%br/
= f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] }
%p

View file

@ -4,7 +4,7 @@
<thead>
<tr>
<th>Nummer</th>
<th>Lieferant</th>
<th>Lieferantin</th>
<th>Datum</th>
<th>Bezahlt am</th>
<th>Betrag</th>

View file

@ -1,7 +1,7 @@
- title "Rechnung #{@invoice.number}"
%p
%b Lieferant:
%b Lieferantin:
=h @invoice.supplier.name
- if @invoice.delivery
%p

View file

@ -10,7 +10,7 @@
%table.list
%thead
%tr
%th Nick
%th Benutzername
%th Name
%th Email
%th Telefon

View file

@ -1,12 +1,14 @@
.single_column{:style => "width:50em"}
.single_column{:style => "width:55em"}
.box_title
%h2= @group.name
%h2= workgroup.name
.column_content
= render :partial => 'shared/group', :locals => { :group => @group }
= render :partial => 'shared/group', :locals => { :group => workgroup }
%p
= link_to _("Show all tasks"), :controller => "tasks", :action => "workgroup", :id => @group
= link_to "Alle Aufgaben zeigen", :controller => "tasks", :action => "workgroup", :id => workgroup
|
- if @group.member?(@current_user)
= link_to _("Edit group"), :action => "edit_group", :id => @group
= link_to "Mitgliedern eine Nachricht schicken", :controller => 'messages', :action => 'group', :id => workgroup
- if workgroup.member?(@current_user)
|
= link_to _('Send members a message'), :controller => 'messages', :action => 'group', :id => @group
= link_to "Gruppe bearbeiten", :action => "edit_group", :id => workgroup
|
= link_to "Mitglieder bearbeiten", :action => "memberships", :id => workgroup

View file

@ -14,7 +14,7 @@
- unless params[:sort_by_ordergroups]
#user_filter{:style => "float:left; margin-right:2em;"}
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_name'} Suche in Name :
%label{:for => 'article_name'} Suche nach Name:
= text_field_tag("query", params['query'], :size => 10 )
= observe_field 'query', :frequency => 2, |
@ -25,7 +25,7 @@
:with => 'query', |
:method => :get |
=_ "Sort by Ordergroups :"
=_ "Nach Bestellgruppen sortieren:"
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();"
#users

View file

@ -6,9 +6,7 @@
%br/
Wenn du einer Gruppe beitreten willst, dann schreib doch den Mitgliedern eine Nachricht.
- unless @groups.empty?
-for @group in @groups
= render :partial => "workgroup"
= render :partial => "workgroup", :collection => @groups

View file

@ -7,8 +7,8 @@
<div class="left_column" style="width: 60%;">
<div class="box_title">
<h2>
Nickname: <%= h @user.nick %>
<small>(Mitglied seit: <%= distance_of_time_in_words(Time.now, @user.created_on) -%>)</small>#
<%= h @user.nick %>
<small>(Mitglied seit: <%= distance_of_time_in_words(Time.now, @user.created_on) -%>)</small>
</h2>
</div>
<div class="column_content">
@ -29,8 +29,8 @@
<p>
<%= membership.group.name %>
<% if membership.group.type != 'Ordergroup' %>
(<%= link_to _("Cancel membership"), { :action => 'cancel_membership', :membership_id => membership },
:confirm => _("Are you sure to cancel this membership?"), :method => :post %>)
(<%= link_to _("Mitgliedschaft beenden"), { :action => 'cancel_membership', :membership_id => membership },
:confirm => _("Bist Du sicher, dass Du Deine Mitgliedschaft beenden willst?"), :method => :post %>)
<% end %>
</p>
<% end %>

View file

@ -2,5 +2,7 @@
%p= link_to('Neue Nachricht', :action => 'new')
%div{:style => "text-align:right"}= will_paginate @messages
#messages
= render :partial => 'messages', :locals => { :subject_length => 130 }

View file

@ -8,7 +8,7 @@
%tr{:valign => "top"}
%td{:width => "60%"}
%p
%b Lieferant:
%b Lieferantin:
=h @order.name
%p
%b Ende:

View file

@ -3,7 +3,7 @@
%table.list
%thead
%tr
%th Lieferant
%th Lieferantin
%th Ende
%th Summe
%tbody

View file

@ -15,7 +15,7 @@
%tr{:valign => "top"}
%td{:style => "width:50%"}
%p
Lieferant:
Lieferantin:
%b=h @order.name
- unless @order.note.blank?
%p

View file

@ -6,7 +6,7 @@
.column_content
= form.hidden_field :supplier_id
%p
Lieferant:
Lieferantin:
= @order.name
%p
Notiz

View file

@ -3,7 +3,7 @@
%thead
%tr
%th[sort_td_class_helper "supplier"]
= sort_link_helper "Lieferant", "supplier"
= sort_link_helper "Lieferantin", "supplier"
%th Start
%th[sort_td_class_helper "ends"]
= sort_link_helper "Ende", "ends"

View file

@ -5,7 +5,7 @@
- form_tag do
Neue Bestellung anlegen für
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
%option{:selected => 'selected'} Lieferant auswählen...
%option{:selected => 'selected'} Lieferantin auswählen...
= options_for_suppliers_to_select
%br/
.left_column{:style => "width:55em"}
@ -16,7 +16,7 @@
%table.list
%thead
%tr
%th Lieferant
%th Lieferantin
%th Ende
%th Notiz
%th{:colspan => "2"}

View file

@ -15,7 +15,7 @@
%p
%b{:style => "color:red"} Bestellung wurde noch nicht abgerechnet.
%p
Lieferant:
Lieferantin:
%b=h @order.name
- unless @order.note.empty?
%p

View file

@ -4,5 +4,5 @@
= link_to h(@current_user.nick), my_profile_path, { :title => _("User Settings") }
- if APP_CONFIG[:homepage]
%li= link_to APP_CONFIG[:name], APP_CONFIG[:homepage], { :title => _("Go to your FoodCoop-Hompage") }
%li= link_to _("Help"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
%li= link_to _("Hilfe"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
%li= link_to _("Logout"), :controller => '/login', :action => 'logout'

View file

@ -5,7 +5,7 @@
%table.list
%thead
%tr
%th Lieferant
%th Lieferantin
%th Ende
%th Wer hat bestellt?
%th Summe

View file

@ -2,34 +2,34 @@
<table style="float:left;width:52%;">
<tr>
<td><%= @form.label :nick %></td>
<td><%= @form.label :nick, "Benutzername" %></td>
<td><%= @form.text_field :nick %></td>
</tr>
<tr>
<td><%= @form.label :first_name %></td>
<td><%= @form.label :first_name, "Vorname" %></td>
<td><%= @form.text_field :first_name %></td>
</tr>
<tr>
<td><%= @form.label :last_name %></td>
<td><%= @form.label :last_name, "Nachname" %></td>
<td><%= @form.text_field :last_name %></td>
</tr>
<tr>
<td><%= @form.label :email %></td>
<td><%= @form.label :email, "E-Mail" %></td>
<td><%= @form.text_field :email %></td>
</tr>
<tr>
<td><%= @form.label :phone %></td>
<td><%= @form.label :phone, "Telefon" %></td>
<td><%= @form.text_field :phone %></td>
</tr>
<tr>
<td/>
</tr>
<tr>
<td><%= @form.label :password, "Password" %></td>
<td><%= @form.label :password, "Passwort" %></td>
<td><%= @form.password_field :password %></td>
</tr>
<tr>
<td><%= @form.label :password_confirmation, "Password confirmation" %></td>
<td><%= @form.label :password_confirmation, "Passwort-Wiederholung" %></td>
<td><%= @form.password_field :password_confirmation %></td>
</tr>
</table>

View file

@ -1,7 +1,7 @@
- remote_form_for stock_article, :url => add_stock_article_stock_takings_path do |form|
= form.error_messages
%p
Lieferant
Lieferantin
%br/
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
%p

View file

@ -11,7 +11,7 @@
%table.list{:style => "width:30em"}
%tr
%th Artikel
%th Lieferant
%th Lieferantin
%th Einheit
%th Menge
- for stock_change in @stock_taking.stock_changes.all :include => :stock_article

View file

@ -1,7 +1,7 @@
- form_for stock_article do |form|
= form.error_messages
%p
Lieferant
Lieferantin
%br/
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
%p

View file

@ -30,7 +30,7 @@
%th davon bestellt
%th Einheit
%th Preis
%th Lieferant
%th Lieferantin
%th Kategorie
%th
%tbody

View file

@ -2,7 +2,7 @@
.left_column{:style => "width:60%"}
.box_title
%h2 Lieferanten
%h2 Lieferantinnen
.column_content
%p
%i
@ -10,13 +10,13 @@
= link_to 'neue Lieferantin', new_supplier_path
oder
= link_to 'importiere', shared_suppliers_suppliers_path
aus der externen ArtikelDatenbank.
aus der externen Artikeldatenbank.
%table.list
%thead
%tr
%th Name
%th Telefon
%th KundenNr
%th Kunden-Nr
%th
%th
%th
@ -38,7 +38,7 @@
%tr
%th Datum
%th Betrag
%th Lieferant
%th Lieferantin
- for delivery in @deliveries
%tr
%td= link_to delivery.delivered_on, [delivery.supplier, delivery]

View file

@ -6,7 +6,7 @@
.column_content
- if shared_supplier = @supplier.shared_supplier
%p
%strong Der Lieferant ist mit der externen ArtikleDatenbank verknüpft.
%strong Die Lieferantin ist mit der externen Artikledatenbank verknüpft.
%table{:style => "width:40em"}
%tr

View file

@ -1,6 +1,8 @@
- title "Aufgabenarchiv"
= render :partial => "nav"
= will_paginate @orders
%br/
%table{:style => "width: 76%"}
%tr
%th Fälligkeitsdatum

View file

@ -12,14 +12,14 @@
- if @group.weekly_task
%table.list
%tr
%th= _('Date')
%th= _('Who will make it?')
%th= _('Accept task')
%th Datum
%th Wer machts?
%th Aufgabe übernehmen
- i = 0
- for nextTask in @group.next_weekly_tasks
- for next_task in @group.next_weekly_tasks
%tr{:class => cycle("even","odd")}
%td= nextTask.strftime("%a, %d.%m.%Y")
- if task = @group.tasks.find(:first, :conditions => ["due_date = ? AND name = ?",nextTask.strftime("%Y-%m-%d"),@group.task_name])
%td= I18n.l next_task, :format => "%a, %d.%m.%Y"
- if task = @group.tasks.find(:first, :conditions => ["due_date = ? AND name = ?",next_task.strftime("%Y-%m-%d"),@group.task_name])
- unless task.users.empty?
- owner = Array.new
- task.assignments.each do |ass|
@ -30,27 +30,27 @@
- owner << nick
%td
= owner.join(", ")
%small= link_to _('more'), :action => "edit", :id => task
%small= link_to "mehr", :action => "edit", :id => task
- else
%td
= link_to _('Assign people'), :action => "edit", :id => task
= link_to "Verantwortliche zuweisen", :action => "edit", :id => task
%td
- unless task.is_accepted?(@current_user)
%span{:style => "float:left"}= button_to _('Accept task'), :controller => "tasks", :action => "accept", :id => task
= button_to _('Reject task'), :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
%span{:style => "float:left"}= button_to "Aufgabe übernehmen", :controller => "tasks", :action => "accept", :id => task
= button_to "Aufgabe ablehnen", :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
- else
%td= link_to _('Assign people'), :action => "new", :id => @group, :task_from_now => i
%td= link_to "Verantwortliche zuweisen", :action => "new", :id => @group, :task_from_now => i
%td
- i += 1
%br/
- else
= _('No weekly tasks defined yet')
Noch keine Wochenaufgaben angelegt.
- if @current_user.member_of?(@group) or @current_user.role_admin?
= link_to _('Edit weekly tasks'), :controller => "foodcoop", :action => "edit_group", :id => @group
= link_to "Wochenaufgaben bearbeiten", :controller => "foodcoop", :action => "edit_group", :id => @group
.left_column{:style => "width:75%"}
.box_title
%h2= _('all tasks')
%h2 Alle Aufgaben der Gruppe
.column_content
- @tasks = @group.open_tasks
= render :partial => "list"

View file

@ -56,7 +56,8 @@ input, textarea, select {
border: 1px solid #D7D7D7;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 0.9em;
padding: .2em; }
padding-left: .2em;
padding-right: .2em; }
input:focus, textarea:focus, select:focus {
border-color: #000; }

View file

@ -56,7 +56,8 @@ input, textarea, select {
border: 1px solid #D7D7D7;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 0.9em;
padding: .2em; }
padding-left: .2em;
padding-right: .2em; }
input:focus, textarea:focus, select:focus {
border-color: #000; }
@ -67,7 +68,8 @@ input[type="button"], input[type="submit"], input[type="reset"] {
color: #222222;
padding: 0.1em 0.5em;
font-size: 1em;
font-weight: bold; }
font-weight: bold;
min-width: 34px; }
select {
max-width: 15em; }

View file

@ -66,7 +66,8 @@ input, textarea, select
border: 1px solid #D7D7D7
font-family: verdana, arial, helvetica, sans-serif
font-size: 0.9em
padding: .2em
padding-left: .2em
padding-right: .2em
input:focus, textarea:focus, select:focus
border-color: #000
@ -78,6 +79,7 @@ input[type="button"], input[type="submit"], input[type="reset"]
padding: 0.1em 0.5em
font-size: 1em
font-weight: bold
min-width: 34px
select
max-width: 15em