diff --git a/app/controllers/foodcoop_controller.rb b/app/controllers/foodcoop_controller.rb index c2bda96a..e43d4a79 100644 --- a/app/controllers/foodcoop_controller.rb +++ b/app/controllers/foodcoop_controller.rb @@ -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 diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 4b55b946..afde5f48 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -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 diff --git a/app/views/foodcoop/members.html.haml b/app/views/foodcoop/members.html.haml index 1614cc84..5ba99a09 100644 --- a/app/views/foodcoop/members.html.haml +++ b/app/views/foodcoop/members.html.haml @@ -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 diff --git a/app/views/home/_start_nav.haml b/app/views/home/_start_nav.haml index de7a03c5..8fb43efb 100644 --- a/app/views/home/_start_nav.haml +++ b/app/views/home/_start_nav.haml @@ -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" \ No newline at end of file + %li= link_to "Neue Bestellgruppe", new_admin_ordergroup_path + %li= link_to "Neues Mitglied", new_admin_user_path \ No newline at end of file diff --git a/config/app_config.yml.SAMPLE b/config/app_config.yml.SAMPLE index 5417df25..65c7ab59 100644 --- a/config/app_config.yml.SAMPLE +++ b/config/app_config.yml.SAMPLE @@ -23,8 +23,8 @@ development: &defaults # Config for the exception_notification plugin notification: error_recipients: - - benni@dresdener27.de - sender_address: FoodSoft Error + - admin@myfoodcoop.org + sender_address: FoodSoft Error email_prefix: "[FoodSoft]" # Access to sharedLists, the external article-database diff --git a/config/initializers/gettext_helper.rb b/config/initializers/gettext_helper.rb index 55514b58..50aabe6a 100644 --- a/config/initializers/gettext_helper.rb +++ b/config/initializers/gettext_helper.rb @@ -15,4 +15,12 @@ module ActiveRecord text end end -end \ No newline at end of file +end + +module ActionController + class Base + def _(text) + text + end + end +end