removes routes locale constrain and fixes some bugs
This commit is contained in:
parent
60c4c5510a
commit
0061e45198
5 changed files with 185 additions and 187 deletions
|
@ -43,6 +43,7 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
after_save do
|
after_save do
|
||||||
|
return if settings_attributes.nil?
|
||||||
settings_attributes.each do |key, value|
|
settings_attributes.each do |key, value|
|
||||||
value.each do |k, v|
|
value.each do |k, v|
|
||||||
case v
|
case v
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
.well
|
.well
|
||||||
%h4= t '.preference'
|
%h4= t '.preference'
|
||||||
%table.table
|
%table.table
|
||||||
- for setting in User::setting_keys.keys
|
- @user.settings.profile.each do |key, setting|
|
||||||
%tr
|
%tr
|
||||||
%td= User::setting_keys[setting]
|
%td= t("simple_form.labels.settings.profile.#{key}")
|
||||||
%td= @user.settings[setting] == '1' ? t('simple_form.yes') : t('simple_form.no')
|
%td= (setting != true and setting != false) ? setting : (setting === true ? t('simple_form.yes') : t('simple_form.no'))
|
||||||
.span3
|
.span3
|
||||||
.well
|
.well
|
||||||
%h4= t '.groupabos'
|
%h4= t '.groupabos'
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
- for user in @users
|
- for user in @users
|
||||||
%tr
|
%tr
|
||||||
%td= user.nick
|
%td= user.nick
|
||||||
%td= user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '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.emailIsPublic"] == '1'
|
%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.phoneIsPublic"] == '1'
|
%td= user.phone if @current_user.role_admin? || user.settings.profile["phone_is_public"]
|
||||||
%td= user.ordergroup_name
|
%td= user.ordergroup_name
|
||||||
%td= user.workgroups.collect(&:name).join(', ')
|
%td= user.workgroups.collect(&:name).join(', ')
|
||||||
%td= link_to_new_message(message_params: {mail_to: user.id})
|
%td= link_to_new_message(message_params: {mail_to: user.id})
|
||||||
|
|
|
@ -8,8 +8,7 @@ Foodsoft::Application.routes.draw do
|
||||||
|
|
||||||
root :to => redirect("/#{FoodsoftConfig.scope}")
|
root :to => redirect("/#{FoodsoftConfig.scope}")
|
||||||
|
|
||||||
constraints(locale: /[a-z]{2}/) do
|
|
||||||
scope "(:locale)" do
|
|
||||||
scope '/:foodcoop' do
|
scope '/:foodcoop' do
|
||||||
|
|
||||||
# Root path
|
# Root path
|
||||||
|
@ -189,6 +188,4 @@ Foodsoft::Application.routes.draw do
|
||||||
match ':controller(/:action(/:id))(.:format)'
|
match ':controller(/:action(/:id))(.:format)'
|
||||||
|
|
||||||
end # End of /:foodcoop scope
|
end # End of /:foodcoop scope
|
||||||
end # End of /:locale scope
|
|
||||||
end # End of :locale constraints
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue