From 24b66ee8d421861c11d516991369b38cf1e642a8 Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Fri, 6 Feb 2009 21:18:20 +0100 Subject: [PATCH] Small bugfix in shared view. Translations on start-page. --- app/controllers/login_controller.rb | 6 ++--- app/views/home/index.html.haml | 34 ++++++++++++++--------------- app/views/shared/_group.html.haml | 2 +- config/routes.rb | 1 + 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index a39815a6..6d47d4fe 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -14,13 +14,13 @@ class LoginController < ApplicationController self.return_to = nil current_user = nil reset_session - flash[:notice] = _("Logged out.") + flash[:notice] = "Abgemeldet" render :action => 'login' end # Displays a "denied due to insufficient privileges" message and provides the login form. def denied - flash[:error] = _("You are not authorized to do this. Please log in as another user or go back.") + flash[:error] = "Du bist nicht berechtigt diese Seite zu besuchen. Bitte als berechtige Benutzerin anmelden oder zurück gehen." render :action => 'login' end @@ -39,7 +39,7 @@ class LoginController < ApplicationController end else current_user = nil - flash[:error] = _("Sorry, login is not possible.") + flash[:error] = "Tschuldige, die Anmeldung war nicht erfolgreich. Bitte erneut versuchen." end end diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 36a51aab..e4622142 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -6,11 +6,11 @@ .right_column{:style => "width:70%"} - unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0 .box_title - %h2=_ "Tasks" + %h2 Aufgaben .column_content -unless @next_tasks.empty? %div{:style => "float:left, margin-bottom:2em"} - %h3=_ "Your tasks for the upcoming week:" + %h3 Deine Aufgaben für die nächste Woche: %table{:style => "width:25em"} -for task in @next_tasks %tr @@ -19,13 +19,13 @@ %b= task.name - unless @unaccepted_tasks.empty? - %h3=_ "Accept tasks" - = _("Your are responsible for a few tasks.") - = link_to _("Accept/Reject tasks"), :controller => "tasks", :action => "myTasks" + %h3 Aufgaben übernehmen + Du bis für Aufgaben verantwortlich. + = link_to "Aufgaben übernehmen/ablehnen", my_tasks_path - unless @unassigned_tasks_number == 0 - %h3=_ "Unassigned tasks" - = _("There are") + " #{@unassigned_tasks_number} " + link_to(_("unassigned task(s)"), :controller => "tasks") - %p{:style => "clear:both"}= link_to _("My tasks"), :controller => "tasks", :action => "myTasks" + %h3 Offene Aufgaben + = "Es gibt #{@unassigned_tasks_number} #{link_to 'offene Aufage(n)', :controller => 'tasks'}" + %p{:style => "clear:both"}= link_to "Meine Aufgaben", my_tasks_path - if @ordergroup // Current orders @@ -40,23 +40,23 @@ - if @ordergroup // Ordergroup overview .box_title - %h2=_ "My ordergroup" + %h2 Meine Bestellgruppe .column_content %p %b= @ordergroup.name | - =_ "Account balance:" + Kontostand: = number_to_currency(@ordergroup.account_balance) %span{:style => "color:grey"} (zuletzt aktualisiert vor - = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + ")" - %h3=_ "Last transactions" + = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + "(n))" + %h3 Letzte Transaktionen %table %tr - %th=_ "When" - %th=_ "Who" - %th=_ "Note" - %th=_ "Amount" + %th Wann + %th Wer + %th Notiz + %th Betrag - for ft in @ordergroup.financial_transactions.all(:limit => 5) %tr{:class => cycle('even','odd')} %td= format_time(ft.created_on) @@ -65,4 +65,4 @@ - color = ft.amount < 0 ? 'red' : 'black' %td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount) %br/ - = link_to _("more ..."), :action => "myOrdergroup" \ No newline at end of file + = link_to _("mehr ..."), my_ordergroup_path \ No newline at end of file diff --git a/app/views/shared/_group.html.haml b/app/views/shared/_group.html.haml index 48973fec..18dcb60b 100644 --- a/app/views/shared/_group.html.haml +++ b/app/views/shared/_group.html.haml @@ -2,7 +2,7 @@ %tr %td Beschreibung: %td=h group.description - - if @current_user.role_admin? or @current_user.role_finance? + - if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?) %tr %td Kontakt: %td=h group.contact diff --git a/config/routes.rb b/config/routes.rb index 91771919..eeb93e1d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ ActionController::Routing::Routes.draw do |map| 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' map.resources :orders, :member => { :finish => :post, :add_comment => :post }