Fixed some wrong links in startpage. Added gettext-help for controllers.

This commit is contained in:
Benjamin Meichsner 2009-02-01 23:09:03 +01:00
parent 7f09bb55e4
commit d75c206db5
6 changed files with 40 additions and 30 deletions

View File

@ -24,7 +24,7 @@ class FoodcoopController < ApplicationController
end
# if somebody uses the search field:
conditions = "first_name LIKE '%#{params[:query]}%' OR last_name LIKE '%#{params[:query]}%'" unless params[:query].blank?
conditions = ["first_name LIKE ? OR last_name LIKE ?", "%#{params[:query]}%", "%#{params[:query]}%"] unless params[:query].blank?
@total = User.count(:conditions => conditions)
@users = User.paginate(:page => params[:page], :per_page => @per_page, :conditions => conditions, :order => "nick", :include => :groups)
@ -54,12 +54,13 @@ class FoodcoopController < ApplicationController
def invite
@invite = Invite.new
end
# Sends an email
def send_invitation
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
if @invite.save
flash[:notice] = format('Es wurde eine Einladung an %s geschickt.', @invite.email)
redirect_to(:action => 'index')
redirect_to root_path
else
render :action => 'invite'
end

View File

@ -35,7 +35,7 @@ class LoginController < ApplicationController
self.return_to = nil
redirect_to redirect
else
redirect_to :controller => 'index'
redirect_to root_path
end
else
current_user = nil

View File

@ -20,9 +20,10 @@
= observe_field 'query', :frequency => 2, |
:before => "Element.show('loader')", |
:success => "Element.hide('loader')", |
:url => {:action => 'foodcoop_members'}, |
:url => {:action => 'members'}, |
:update => :users, |
:with => 'query' |
:with => 'query', |
:method => :get |
=_ "Sort by Ordergroups :"
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do

View File

@ -1,43 +1,43 @@
%h2= _('Go to ...')
%h2 Direkt zu ...
%ul
%li
= _('FoodCoop')
Foodcoop
%ul
%li= link_to _("Member list"), :controller => "index", :action => "foodcoop_members"
%li= link_to _("My tasks"), :controller => "tasks", :action => "myTasks"
%li= link_to _("Write message"), :controller => "messages", :action => "new"
%li= link_to "Mitglieder", :controller => "foodcoop", :action => "members"
%li= link_to "Meine Aufgaben", :controller => "home", :action => "tasks"
%li= link_to "Nachricht schreiben", :controller => "messages", :action => "new"
// Orders
- hasOrdergroup = !@current_user.ordergroup.nil?
- hasOrdersRole = @current_user.role_orders?
- if hasOrdergroup || hasOrdersRole
- has_ordergroup = !@current_user.ordergroup.nil?
- has_orders_role = @current_user.role_orders?
- if has_ordergroup || has_orders_role
%li
= _("Orders")
Bestellungen
%ul
- if hasOrdergroup
%li= link_to _('Order summary'), :controller => "ordering"
- if hasOrdersRole
%li= link_to _('Finish order'), :controller => 'orders'
- if has_ordergroup
%li= link_to "Bestellübersicht", :controller => "ordering"
- if has_orders_role
%li= link_to "Bestellungen beenden", :controller => 'orders'
// Articles
- if @current_user.role_article_meta? || @current_user.role_suppliers?
%li
= _("Artcle management")
Artikelverwaltung
%ul
%li= link_to _("Refresh articles"), :controller => "articles", :action => 'list'
%li= link_to _("Suppliers"), :controller => 'suppliers', :action => 'list'
%li= link_to "Artikel aktualisieren", suppliers_path
%li= link_to "Lieferanten verwalten", suppliers_path
// Finance
- if @current_user.role_finance?
%li
= _('Financial management')
Finanzbereich
%ul
%li= link_to _("Update account balances"), :controller => 'finance', :action => 'new_transactions'
%li= link_to _('Cancel orders'), :controller => 'finance'
%li= link_to "Konten aktualisieren", :controller => 'finance/transactions', :action => 'new_collection'
%li= link_to "Bestellungen abrechnen", finance_root_path
// Administration
- if @current_user.role_admin?
%li
= _('Administration')
Administration
%ul
%li= link_to _("New ordergroup"), :controller => "admin", :action => "newOrdergroup"
%li= link_to _("New user"), :controller => "admin", :action => "newUser"
%li= link_to "Neue Bestellgruppe", new_admin_ordergroup_path
%li= link_to "Neues Mitglied", new_admin_user_path

View File

@ -23,8 +23,8 @@ development: &defaults
# Config for the exception_notification plugin
notification:
error_recipients:
- benni@dresdener27.de
sender_address: FoodSoft Error <foodsoft@foodcoops.net>
- admin@myfoodcoop.org
sender_address: FoodSoft Error <foodsoft@myfoodcoop.org>
email_prefix: "[FoodSoft]"
# Access to sharedLists, the external article-database

View File

@ -15,4 +15,12 @@ module ActiveRecord
text
end
end
end
end
module ActionController
class Base
def _(text)
text
end
end
end