From a0e10141dc362ba965d2c26b923229f752e36ded Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Thu, 12 Feb 2009 21:38:41 +0100 Subject: [PATCH] Translations and other little improvements. --- app/controllers/admin/ordergroups_controller.rb | 3 ++- app/controllers/admin_controller.rb | 2 +- .../finance/transactions_controller.rb | 6 +++--- app/views/articles/index.haml | 4 +--- app/views/finance/balancing/index.haml | 12 ++++++------ app/views/finance/transactions/_ordergroup.haml | 4 ++-- .../finance/transactions/_ordergroups.html.haml | 10 +++++----- app/views/finance/transactions/index.html.haml | 10 +++++----- app/views/finance/transactions/new.html.haml | 16 ++++++++-------- .../transactions/new_collection.html.haml | 14 +++++++------- app/views/shared/_workgroup_members.haml | 2 +- app/views/stock_takings/new.html.haml | 4 ++-- app/views/stockit/index.html.haml | 4 +++- app/views/suppliers/index.haml | 10 ++++++---- app/views/tasks/_form.html.haml | 16 ++++++++-------- app/views/tasks/new.haml | 3 ++- config/routes.rb | 1 + 17 files changed, 63 insertions(+), 58 deletions(-) diff --git a/app/controllers/admin/ordergroups_controller.rb b/app/controllers/admin/ordergroups_controller.rb index 9be8c73e..a35e32fd 100644 --- a/app/controllers/admin/ordergroups_controller.rb +++ b/app/controllers/admin/ordergroups_controller.rb @@ -36,7 +36,8 @@ class Admin::OrdergroupsController < ApplicationController def create @ordergroup = Ordergroup.new(params[:ordergroup]) - + @ordergroup.account_updated = Time.now + if @ordergroup.save flash[:notice] = 'Ordergroup was successfully created.' redirect_to([:admin, @ordergroup]) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 46989e33..e24a1bdd 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -5,7 +5,7 @@ class AdminController < ApplicationController def index @user = self.current_user - @groups = Group.find(:all, :limit => 10, :order => 'created_on DESC') + @groups = Group.find(:all, :limit => 10, :order => 'created_on DESC', :conditions => {:deleted_at => nil}) @users = User.find(:all, :limit => 10, :order => 'created_on DESC') end diff --git a/app/controllers/finance/transactions_controller.rb b/app/controllers/finance/transactions_controller.rb index 56141333..76c96d6d 100644 --- a/app/controllers/finance/transactions_controller.rb +++ b/app/controllers/finance/transactions_controller.rb @@ -86,17 +86,17 @@ class Finance::TransactionsController < ApplicationController def create_collection note = params[:note] - raise "Note is required!" if note.blank? + raise "Notiz wird benötigt!" if note.blank? params[:financial_transactions].each do |trans| # ignore empty amount fields ... unless trans[:amount].blank? Ordergroup.find(trans[:ordergroup_id]).add_financial_transaction trans[:amount], note, @current_user end end - flash[:notice] = 'Saved all transactions successfully' + flash[:notice] = "Alle Transaktionen wurden gespeichert." redirect_to :action => 'index' rescue => error - flash[:error] = "An error occured: " + error.to_s + flash[:error] = "Ein Fehler ist aufgetreten: " + error.to_s redirect_to :action => 'new_collection' end diff --git a/app/views/articles/index.haml b/app/views/articles/index.haml index 705b8850..a7b1b3bc 100644 --- a/app/views/articles/index.haml +++ b/app/views/articles/index.haml @@ -67,7 +67,5 @@ %form{ :action => url_for(update_selected_supplier_articles_path(@supplier)), :method => "post", :id => "articlesInListForm" } #table= render :partial => 'articles' - - %br/ - = link_to "Zurück", :action => 'index' + #edit_article{:style => "display:none"} diff --git a/app/views/finance/balancing/index.haml b/app/views/finance/balancing/index.haml index 9a175937..1f64135a 100644 --- a/app/views/finance/balancing/index.haml +++ b/app/views/finance/balancing/index.haml @@ -1,15 +1,15 @@ %h1 Finanzbereich .left_column{:style => 'width: 50%'} .box_title - %h2 Unpaid invoices + %h2 Unbezahlte Rechnungen .column_content - %p= link_to "Show all invoices", finance_invoices_path + %p= link_to "Zeige alle Rechnungen", finance_invoices_path %table.list %thead %tr - %th Date - %th Amount - %th Supplier + %th Datum + %th Betrag + %th Lieferant %th %tbody - for invoice in @unpaid_invoices @@ -17,7 +17,7 @@ %td= format_date(invoice.date) %td= number_to_currency(invoice.amount) %td=h invoice.supplier.name - %td= link_to "Edit", edit_finance_invoice_path(invoice) + %td= link_to "Bearbeiten", edit_finance_invoice_path(invoice) .box_title %h2 letzte Überweisungen diff --git a/app/views/finance/transactions/_ordergroup.haml b/app/views/finance/transactions/_ordergroup.haml index 5345d963..f8f895ea 100644 --- a/app/views/finance/transactions/_ordergroup.haml +++ b/app/views/finance/transactions/_ordergroup.haml @@ -1,6 +1,6 @@ %tr.transaction %td %select{:name => 'financial_transactions[][ordergroup_id]'} - = options_for_select Ordergroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] } + = options_for_select Ordergroup.without_deleted.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")} \ No newline at end of file + %td= link_to_function icon(:delete), "$(this).up('.transaction').remove()", {:title => "Gruppe enfernen"} \ No newline at end of file diff --git a/app/views/finance/transactions/_ordergroups.html.haml b/app/views/finance/transactions/_ordergroups.html.haml index 9e424151..4a145fb8 100644 --- a/app/views/finance/transactions/_ordergroups.html.haml +++ b/app/views/finance/transactions/_ordergroups.html.haml @@ -1,5 +1,5 @@ %p - = _("Found") + ":" + Gefunden: = @total %p %table{:style => "width:100%"} @@ -12,9 +12,9 @@ %table.list %thead %tr - %th= sort_link_helper _("Name"), "name", @per_page + %th= sort_link_helper "Name", "name", @per_page %th Kontakt - %th= sort_link_helper _("Account balance"), "account_balance", @per_page + %th= sort_link_helper "Kontostand", "account_balance", @per_page %th %tbody - for group in @groups @@ -23,6 +23,6 @@ %td= group.contact %td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance) %td{:class => "actions"} - = link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'new', :id => group}, {:title => _("New transaction")} - = link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'), {:action => 'list', :id => group}, {:title => _("List transactions")} + = link_to image_tag("euro_new.png", :size => "16x16", :alt => "Neue Transaktion", :border => "0"), {:action => 'new', :id => group}, {:title => "Neue Transaktion"} + = link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'), {:action => 'list', :id => group}, {:title => "Kontoauszug"} \ No newline at end of file diff --git a/app/views/finance/transactions/index.html.haml b/app/views/finance/transactions/index.html.haml index c2d2e7e9..690b751a 100644 --- a/app/views/finance/transactions/index.html.haml +++ b/app/views/finance/transactions/index.html.haml @@ -1,16 +1,16 @@ -%h1 Manage accounts +- title "Konten verwalten" %p %i - =_ "To create multiple transactions at once please follow this " - = link_to _("link"), :action => 'new_collection' + Um mehrer Transaktionen auf einmal anzulegen folge bitte diesem + = link_to _("Link"), :action => 'new_collection' .left_column{:style=>"width:50em"} .box_title - %h2=_ "Ordergroups" + %h2 Bestellgruppen .column_content #group_filter %form{:name=>"sform", :action=>"", :style=>"display:inline;"} - %label{:for => 'article_name'}= _("Search in name") + ":" + Suchen im Namen: = text_field_tag("query", params['query'], :size => 10 ) = observe_field 'query', :frequency => 2, | diff --git a/app/views/finance/transactions/new.html.haml b/app/views/finance/transactions/new.html.haml index 0cbeb160..5180527d 100644 --- a/app/views/finance/transactions/new.html.haml +++ b/app/views/finance/transactions/new.html.haml @@ -1,21 +1,21 @@ -%h1 New transaction +- title "Neue Transaktion" .edit_form{ :style => "width:30em" } - - form_for(@financial_transaction, :url => { :action => 'create' }) do |f| + - form_for @financial_transaction, :url => {:action => 'create'} do |f| = f.error_messages = f.hidden_field :ordergroup_id %p - Group: + Bestellgruppe: %b=h @group.name %p - = f.label :amount + Betrag %br/ = f.text_field :amount, :size => 10 %p - = f.label :note + Notiz %br/ = f.text_area :note, :cols => 40, :rows => 5 %p - = submit_tag "Save" - -= link_to "Back", :controller => 'transactions' \ No newline at end of file + = submit_tag "Speichern" + | + = link_to "Abbrechen", :controller => 'transactions' \ No newline at end of file diff --git a/app/views/finance/transactions/new_collection.html.haml b/app/views/finance/transactions/new_collection.html.haml index 8d38bfd8..a2cb0ada 100644 --- a/app/views/finance/transactions/new_collection.html.haml +++ b/app/views/finance/transactions/new_collection.html.haml @@ -1,20 +1,20 @@ -- title _("Update multiple accounts") +- title "Mehrer Konten aktualisieren" - form_tag :action => "create_collection" do %p - %b= _("Note") + ":" + %b Notiz = text_field_tag "note" %p %table#Ordergroups{:style => "width:20em"} %tr - %th=_ "Ordergroup" - %th=_ "Amount" + %th Bestellgruppe + %th Betrag = render :partial => 'ordergroup', :collection => [1, 2, 3] %p - = link_to_function _("Add another ordergroup") do |page| + = link_to_function "Neue Bestellgruppe hinzufügen" do |page| - page.insert_html :bottom, :Ordergroups, :partial => 'ordergroup' %p - = submit_tag _("Save") + = submit_tag "Transaktionen speichern" | - = link_to _("Cancel"), :controller => 'finance/transactions' \ No newline at end of file + = link_to "Abbrechen", :controller => 'finance/transactions' \ No newline at end of file diff --git a/app/views/shared/_workgroup_members.haml b/app/views/shared/_workgroup_members.haml index 6703e1e4..b6410ec7 100644 --- a/app/views/shared/_workgroup_members.haml +++ b/app/views/shared/_workgroup_members.haml @@ -1,5 +1,5 @@ - for group in Group.find :all, :conditions => "type != 'Ordergroup'" - %h4= link_to_function group.name, "Element.toggle('group_#{group.id}')" + %h4= link_to_function group.name, "Element.toggle('workgroup_#{group.id}')" %ul{:style => "display:none"}[group] - for user in group.users.find :all, :order => "nick" %li= user.nick + " (#{user.ordergroup.name if user.ordergroup})" diff --git a/app/views/stock_takings/new.html.haml b/app/views/stock_takings/new.html.haml index 7b14190d..c134e978 100644 --- a/app/views/stock_takings/new.html.haml +++ b/app/views/stock_takings/new.html.haml @@ -3,7 +3,7 @@ .left_column{:style => "width:40em;"} - form_for(@stock_taking) do |f| .box_title - %h2 Lieferung anlegen + %h2 Inventur anlegen .column_content = f.error_messages %p @@ -23,7 +23,7 @@ #stock_changes = render :partial => 'stock_change', :collection => @stock_taking.stock_changes %p - = f.submit "Invenur anlegen" + = f.submit "Inventur anlegen" | = link_to "Abbrechen", stock_takings_path diff --git a/app/views/stockit/index.html.haml b/app/views/stockit/index.html.haml index 4a8f8de1..79a125a2 100644 --- a/app/views/stockit/index.html.haml +++ b/app/views/stockit/index.html.haml @@ -17,7 +17,9 @@ | = link_to_if @current_user.role_orders?, "Lagerbestellung online stellen", {:controller => 'orders', :action => 'new', :supplier_id => 0} | - = link_to "Inventur anlegen", new_stock_taking_path + %b= link_to "Inventur anlegen", new_stock_taking_path + | + = link_to "Inventurübersicht", stock_takings_path #articles{:style => "clear:both;margin-top:1em"} %table.list diff --git a/app/views/suppliers/index.haml b/app/views/suppliers/index.haml index 5e6ad7d2..201cf3d9 100644 --- a/app/views/suppliers/index.haml +++ b/app/views/suppliers/index.haml @@ -1,6 +1,6 @@ - title "Artikeldatenbank" -.left_column{:style => "width:50%"} +.left_column{:style => "width:60%"} .box_title %h2 Lieferanten .column_content @@ -19,20 +19,22 @@ %th KundenNr %th %th + %th %tbody - for supplier in @suppliers %tr{:class => cycle('even','odd', :name => 'suppliers')} %td= link_to h(supplier.name) , supplier %td=h supplier.phone %td=h supplier.customer_number - %td= link_to "Artikel (#{supplier.articles.count})", supplier_articles_path(supplier) + %td= link_to "Artikel (#{supplier.articles.without_deleted.count})", supplier_articles_path(supplier) + %td= link_to "im Lager (#{supplier.stock_articles.without_deleted.count})", stock_articles_path %td= link_to "Lieferungen", supplier_deliveries_path(supplier) -.right_column{:style => "width:47%"} +.right_column{:style => "width:37%"} .box_title %h2 Letzte Lieferungen .column_content - %table{:style => "width:50em"} + %table %tr %th Datum %th Betrag diff --git a/app/views/tasks/_form.html.haml b/app/views/tasks/_form.html.haml index f989960c..4aa53899 100644 --- a/app/views/tasks/_form.html.haml +++ b/app/views/tasks/_form.html.haml @@ -1,30 +1,30 @@ = form.error_messages %p - %b= form.label :name + %b Name %br/ = form.text_field :name %p - %b= form.label :description + %b Beschreibung %br/ = form.text_area :description, :cols => 50, :rows => 10 %p - %b= form.label :user - %small=_ 'tasks can have multiple assignments' + %b Verantwortliche + %small Aufgaben können mehrere Verantwortliche haben /%br/ /= render :partial => "assignments" %p - %small=_ 'use commas to seperate the names' + %small Benutze Kommas um mehrere Benutzerinnen zu trennen %br/ = text_field_with_auto_complete :task, :user_list, {}, {:tokens => ","} %p - %b= form.label :required_users, "How many users are altogether required?" + %b Wieviel Benutzerinnen werden insgesamt benötigt? %br/ = form.text_field :required_users, :size => 3 %p - %b= form.label :workgroup + %b Arbeitsgruppe %br/ = form.select :workgroup_id, Workgroup.all(:order => 'name').collect {|g| [ g.name, g.id ] }, { :include_blank => true } %p - %b= form.label :due_date + %b Fälligkeit %br/ = form.date_select :due_date, :start_year => 2007, :include_blank => true \ No newline at end of file diff --git a/app/views/tasks/new.haml b/app/views/tasks/new.haml index b8e040f3..5fa82df8 100644 --- a/app/views/tasks/new.haml +++ b/app/views/tasks/new.haml @@ -6,6 +6,7 @@ = submit_tag "Aufgabe erstellen" #workgroup_members{:style => "padding-left:41em"} - %h3 Mitglieder der Gruppe + %h3 Mitglieder der Arbeitsgruppen + %i Klicke auf den Gruppennamen um die Mitglieder zu sehen #list = render :partial => "shared/workgroup_members" diff --git a/config/routes.rb b/config/routes.rb index 5c09354c..e44693bc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ ActionController::Routing::Routes.draw do |map| + map.logout '/logout', :controller => 'login', :action => 'logout' map.my_profile '/home/profile', :controller => 'home', :action => 'profile' map.my_ordergroup '/home/ordergroup', :controller => 'home', :action => 'ordergroup' map.my_tasks '/home/tasks', :controller => 'tasks', :action => 'myTasks'