Small bugfix in shared view. Translations on start-page.

This commit is contained in:
Benjamin Meichsner 2009-02-06 21:18:20 +01:00
parent 96442477d1
commit 24b66ee8d4
4 changed files with 22 additions and 21 deletions

View File

@ -14,13 +14,13 @@ class LoginController < ApplicationController
self.return_to = nil self.return_to = nil
current_user = nil current_user = nil
reset_session reset_session
flash[:notice] = _("Logged out.") flash[:notice] = "Abgemeldet"
render :action => 'login' render :action => 'login'
end end
# Displays a "denied due to insufficient privileges" message and provides the login form. # Displays a "denied due to insufficient privileges" message and provides the login form.
def denied 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' render :action => 'login'
end end
@ -39,7 +39,7 @@ class LoginController < ApplicationController
end end
else else
current_user = nil current_user = nil
flash[:error] = _("Sorry, login is not possible.") flash[:error] = "Tschuldige, die Anmeldung war nicht erfolgreich. Bitte erneut versuchen."
end end
end end

View File

@ -6,11 +6,11 @@
.right_column{:style => "width:70%"} .right_column{:style => "width:70%"}
- unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0 - unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0
.box_title .box_title
%h2=_ "Tasks" %h2 Aufgaben
.column_content .column_content
-unless @next_tasks.empty? -unless @next_tasks.empty?
%div{:style => "float:left, margin-bottom:2em"} %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"} %table{:style => "width:25em"}
-for task in @next_tasks -for task in @next_tasks
%tr %tr
@ -19,13 +19,13 @@
%b= task.name %b= task.name
- unless @unaccepted_tasks.empty? - unless @unaccepted_tasks.empty?
%h3=_ "Accept tasks" %h3 Aufgaben übernehmen
= _("Your are responsible for a few tasks.") Du bis für Aufgaben verantwortlich.
= link_to _("Accept/Reject tasks"), :controller => "tasks", :action => "myTasks" = link_to "Aufgaben übernehmen/ablehnen", my_tasks_path
- unless @unassigned_tasks_number == 0 - unless @unassigned_tasks_number == 0
%h3=_ "Unassigned tasks" %h3 Offene Aufgaben
= _("There are") + " #{@unassigned_tasks_number} " + link_to(_("unassigned task(s)"), :controller => "tasks") = "Es gibt #{@unassigned_tasks_number} #{link_to 'offene Aufage(n)', :controller => 'tasks'}"
%p{:style => "clear:both"}= link_to _("My tasks"), :controller => "tasks", :action => "myTasks" %p{:style => "clear:both"}= link_to "Meine Aufgaben", my_tasks_path
- if @ordergroup - if @ordergroup
// Current orders // Current orders
@ -40,23 +40,23 @@
- if @ordergroup - if @ordergroup
// Ordergroup overview // Ordergroup overview
.box_title .box_title
%h2=_ "My ordergroup" %h2 Meine Bestellgruppe
.column_content .column_content
%p %p
%b= @ordergroup.name %b= @ordergroup.name
| |
=_ "Account balance:" Kontostand:
= number_to_currency(@ordergroup.account_balance) = number_to_currency(@ordergroup.account_balance)
%span{:style => "color:grey"} %span{:style => "color:grey"}
(zuletzt aktualisiert vor (zuletzt aktualisiert vor
= distance_of_time_in_words(Time.now, @ordergroup.account_updated) + ")" = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + "(n))"
%h3=_ "Last transactions" %h3 Letzte Transaktionen
%table %table
%tr %tr
%th=_ "When" %th Wann
%th=_ "Who" %th Wer
%th=_ "Note" %th Notiz
%th=_ "Amount" %th Betrag
- for ft in @ordergroup.financial_transactions.all(:limit => 5) - for ft in @ordergroup.financial_transactions.all(:limit => 5)
%tr{:class => cycle('even','odd')} %tr{:class => cycle('even','odd')}
%td= format_time(ft.created_on) %td= format_time(ft.created_on)
@ -65,4 +65,4 @@
- color = ft.amount < 0 ? 'red' : 'black' - color = ft.amount < 0 ? 'red' : 'black'
%td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount) %td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount)
%br/ %br/
= link_to _("more ..."), :action => "myOrdergroup" = link_to _("mehr ..."), my_ordergroup_path

View File

@ -2,7 +2,7 @@
%tr %tr
%td Beschreibung: %td Beschreibung:
%td=h group.description %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 %tr
%td Kontakt: %td Kontakt:
%td=h group.contact %td=h group.contact

View File

@ -1,6 +1,7 @@
ActionController::Routing::Routes.draw do |map| ActionController::Routing::Routes.draw do |map|
map.my_profile '/home/profile', :controller => 'home', :action => 'profile' 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.my_tasks '/home/tasks', :controller => 'tasks', :action => 'myTasks'
map.resources :orders, :member => { :finish => :post, :add_comment => :post } map.resources :orders, :member => { :finish => :post, :add_comment => :post }