Fixed some wrong links in startpage. Added gettext-help for controllers.
This commit is contained in:
parent
7f09bb55e4
commit
d75c206db5
6 changed files with 40 additions and 30 deletions
|
@ -24,7 +24,7 @@ class FoodcoopController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
# if somebody uses the search field:
|
# 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)
|
@total = User.count(:conditions => conditions)
|
||||||
@users = User.paginate(:page => params[:page], :per_page => @per_page, :conditions => conditions, :order => "nick", :include => :groups)
|
@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
|
def invite
|
||||||
@invite = Invite.new
|
@invite = Invite.new
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sends an email
|
# Sends an email
|
||||||
def send_invitation
|
def send_invitation
|
||||||
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
|
@invite = Invite.new(:user => @current_user, :group => @group, :email => params[:invite][:email])
|
||||||
if @invite.save
|
if @invite.save
|
||||||
flash[:notice] = format('Es wurde eine Einladung an %s geschickt.', @invite.email)
|
flash[:notice] = format('Es wurde eine Einladung an %s geschickt.', @invite.email)
|
||||||
redirect_to(:action => 'index')
|
redirect_to root_path
|
||||||
else
|
else
|
||||||
render :action => 'invite'
|
render :action => 'invite'
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,7 @@ class LoginController < ApplicationController
|
||||||
self.return_to = nil
|
self.return_to = nil
|
||||||
redirect_to redirect
|
redirect_to redirect
|
||||||
else
|
else
|
||||||
redirect_to :controller => 'index'
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
current_user = nil
|
current_user = nil
|
||||||
|
|
|
@ -20,9 +20,10 @@
|
||||||
= observe_field 'query', :frequency => 2, |
|
= observe_field 'query', :frequency => 2, |
|
||||||
:before => "Element.show('loader')", |
|
:before => "Element.show('loader')", |
|
||||||
:success => "Element.hide('loader')", |
|
:success => "Element.hide('loader')", |
|
||||||
:url => {:action => 'foodcoop_members'}, |
|
:url => {:action => 'members'}, |
|
||||||
:update => :users, |
|
:update => :users, |
|
||||||
:with => 'query' |
|
:with => 'query', |
|
||||||
|
:method => :get |
|
||||||
|
|
||||||
=_ "Sort by Ordergroups :"
|
=_ "Sort by Ordergroups :"
|
||||||
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
|
- form_tag({:action => "members"}, :method => "get", :style=>"display:inline;") do
|
||||||
|
|
|
@ -1,43 +1,43 @@
|
||||||
%h2= _('Go to ...')
|
%h2 Direkt zu ...
|
||||||
%ul
|
%ul
|
||||||
%li
|
%li
|
||||||
= _('FoodCoop')
|
Foodcoop
|
||||||
%ul
|
%ul
|
||||||
%li= link_to _("Member list"), :controller => "index", :action => "foodcoop_members"
|
%li= link_to "Mitglieder", :controller => "foodcoop", :action => "members"
|
||||||
%li= link_to _("My tasks"), :controller => "tasks", :action => "myTasks"
|
%li= link_to "Meine Aufgaben", :controller => "home", :action => "tasks"
|
||||||
%li= link_to _("Write message"), :controller => "messages", :action => "new"
|
%li= link_to "Nachricht schreiben", :controller => "messages", :action => "new"
|
||||||
|
|
||||||
// Orders
|
// Orders
|
||||||
- hasOrdergroup = !@current_user.ordergroup.nil?
|
- has_ordergroup = !@current_user.ordergroup.nil?
|
||||||
- hasOrdersRole = @current_user.role_orders?
|
- has_orders_role = @current_user.role_orders?
|
||||||
- if hasOrdergroup || hasOrdersRole
|
- if has_ordergroup || has_orders_role
|
||||||
%li
|
%li
|
||||||
= _("Orders")
|
Bestellungen
|
||||||
%ul
|
%ul
|
||||||
- if hasOrdergroup
|
- if has_ordergroup
|
||||||
%li= link_to _('Order summary'), :controller => "ordering"
|
%li= link_to "Bestellübersicht", :controller => "ordering"
|
||||||
- if hasOrdersRole
|
- if has_orders_role
|
||||||
%li= link_to _('Finish order'), :controller => 'orders'
|
%li= link_to "Bestellungen beenden", :controller => 'orders'
|
||||||
// Articles
|
// Articles
|
||||||
- if @current_user.role_article_meta? || @current_user.role_suppliers?
|
- if @current_user.role_article_meta? || @current_user.role_suppliers?
|
||||||
%li
|
%li
|
||||||
= _("Artcle management")
|
Artikelverwaltung
|
||||||
%ul
|
%ul
|
||||||
%li= link_to _("Refresh articles"), :controller => "articles", :action => 'list'
|
%li= link_to "Artikel aktualisieren", suppliers_path
|
||||||
%li= link_to _("Suppliers"), :controller => 'suppliers', :action => 'list'
|
%li= link_to "Lieferanten verwalten", suppliers_path
|
||||||
|
|
||||||
// Finance
|
// Finance
|
||||||
- if @current_user.role_finance?
|
- if @current_user.role_finance?
|
||||||
%li
|
%li
|
||||||
= _('Financial management')
|
Finanzbereich
|
||||||
%ul
|
%ul
|
||||||
%li= link_to _("Update account balances"), :controller => 'finance', :action => 'new_transactions'
|
%li= link_to "Konten aktualisieren", :controller => 'finance/transactions', :action => 'new_collection'
|
||||||
%li= link_to _('Cancel orders'), :controller => 'finance'
|
%li= link_to "Bestellungen abrechnen", finance_root_path
|
||||||
|
|
||||||
// Administration
|
// Administration
|
||||||
- if @current_user.role_admin?
|
- if @current_user.role_admin?
|
||||||
%li
|
%li
|
||||||
= _('Administration')
|
Administration
|
||||||
%ul
|
%ul
|
||||||
%li= link_to _("New ordergroup"), :controller => "admin", :action => "newOrdergroup"
|
%li= link_to "Neue Bestellgruppe", new_admin_ordergroup_path
|
||||||
%li= link_to _("New user"), :controller => "admin", :action => "newUser"
|
%li= link_to "Neues Mitglied", new_admin_user_path
|
|
@ -23,8 +23,8 @@ development: &defaults
|
||||||
# Config for the exception_notification plugin
|
# Config for the exception_notification plugin
|
||||||
notification:
|
notification:
|
||||||
error_recipients:
|
error_recipients:
|
||||||
- benni@dresdener27.de
|
- admin@myfoodcoop.org
|
||||||
sender_address: FoodSoft Error <foodsoft@foodcoops.net>
|
sender_address: FoodSoft Error <foodsoft@myfoodcoop.org>
|
||||||
email_prefix: "[FoodSoft]"
|
email_prefix: "[FoodSoft]"
|
||||||
|
|
||||||
# Access to sharedLists, the external article-database
|
# Access to sharedLists, the external article-database
|
||||||
|
|
|
@ -15,4 +15,12 @@ module ActiveRecord
|
||||||
text
|
text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module ActionController
|
||||||
|
class Base
|
||||||
|
def _(text)
|
||||||
|
text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue