removes routes locale constrain and fixes some bugs

This commit is contained in:
Manuel Wiedenmann 2013-06-06 04:29:53 +02:00
parent 60c4c5510a
commit 0061e45198
5 changed files with 185 additions and 187 deletions

View File

@ -43,6 +43,7 @@ class User < ActiveRecord::Base
end
after_save do
return if settings_attributes.nil?
settings_attributes.each do |key, value|
value.each do |k, v|
case v

View File

@ -20,10 +20,10 @@
.well
%h4= t '.preference'
%table.table
- for setting in User::setting_keys.keys
- @user.settings.profile.each do |key, setting|
%tr
%td= User::setting_keys[setting]
%td= @user.settings[setting] == '1' ? t('simple_form.yes') : t('simple_form.no')
%td= t("simple_form.labels.settings.profile.#{key}")
%td= (setting != true and setting != false) ? setting : (setting === true ? t('simple_form.yes') : t('simple_form.no'))
.span3
.well
%h4= t '.groupabos'

View File

@ -14,9 +14,9 @@
- for user in @users
%tr
%td= user.nick
%td= user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
%td= user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1'
%td= user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1'
%td= user.name if @current_user.role_admin? || user.settings.profile["name_is_public"]
%td= user.email if @current_user.role_admin? || user.settings.profile["email_is_public"]
%td= user.phone if @current_user.role_admin? || user.settings.profile["phone_is_public"]
%td= user.ordergroup_name
%td= user.workgroups.collect(&:name).join(', ')
%td= link_to_new_message(message_params: {mail_to: user.id})

View File

@ -8,8 +8,7 @@ Foodsoft::Application.routes.draw do
root :to => redirect("/#{FoodsoftConfig.scope}")
constraints(locale: /[a-z]{2}/) do
scope "(:locale)" do
scope '/:foodcoop' do
# Root path
@ -189,6 +188,4 @@ Foodsoft::Application.routes.draw do
match ':controller(/:action(/:id))(.:format)'
end # End of /:foodcoop scope
end # End of /:locale scope
end # End of :locale constraints
end