Merge pull request #1 from foodcoop-adam/extended-i18n

cleanup of profile layout + set session on login
This commit is contained in:
Manuel Wiedenmann 2013-07-18 07:19:20 -07:00
commit 0401572580
4 changed files with 29 additions and 39 deletions

View File

@ -12,6 +12,7 @@ class SessionsController < ApplicationController
session[:locale] = user.locale session[:locale] = user.locale
session[:user_id] = user.id session[:user_id] = user.id
session[:scope] = FoodsoftConfig.scope # Save scope in session to not allow switching between foodcoops with one account session[:scope] = FoodsoftConfig.scope # Save scope in session to not allow switching between foodcoops with one account
session[:locale] = user_settings_language
if session[:return_to].present? if session[:return_to].present?
redirect_to_url = session[:return_to] redirect_to_url = session[:return_to]
session[:return_to] = nil session[:return_to] = nil

View File

@ -6,37 +6,30 @@
= f.input :password, :required => f.object.new_record? = f.input :password, :required => f.object.new_record?
= f.input :password_confirmation = f.input :password_confirmation
.settings = f.simple_fields_for :settings_attributes do |s|
%h4 = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
=t 'simple_form.labels.settings.settings_groups' = profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language']
= f.simple_fields_for :settings_attributes do |s|
.settings
.settings-group .settings-group
= s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
%div{class: 'control-group h_wrapper'} %div{class: 'control-group h_wrapper'}
%h5{class: 'control-label'} %h5{class: 'controls'}
= t 'simple_form.labels.settings.settings_group.profile' = t 'simple_form.labels.settings.settings_group.privacy'
= profile.input 'phone_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['phone_is_public'] }
= s.simple_fields_for :profile, defaults: { inline_label: true } do |profile| = profile.input 'email_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['email_is_public'] }
= profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language'] = profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] }
= profile.input 'phone_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['phone_is_public'] }
= profile.input 'email_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['email_is_public'] } .settings-group
= profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] } %div{class: 'control-group'}
%h5{class: 'controls'}
.settings-group = t 'simple_form.labels.settings.settings_group.messages'
%div{class: 'control-group'}
%h5{class: 'control-label'} = s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
=t 'simple_form.labels.settings.settings_group.messages' = messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }
= s.simple_fields_for :notify, defaults: { inline_label: true, label: false } do |notify|
= s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages| = notify.input 'order_finished', as: :boolean, input_html: { checked: f.object.settings.notify['order_finished'] }
= messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] } = notify.input 'negative_balance', as: :boolean, input_html: { checked: f.object.settings.notify['negative_balance'] }
= notify.input 'upcoming_tasks', as: :boolean, input_html: { checked: f.object.settings.notify['upcoming_tasks'] }
.settings-group
%div{class: 'control-group'}
%h5{class: 'control-label'}
= t 'simple_form.labels.settings.settings_group.notify'
= s.simple_fields_for :notify, defaults: { inline_label: true, label: false } do |notify|
= notify.input 'order_finished', as: :boolean, input_html: { checked: f.object.settings.notify['order_finished'] }
= notify.input 'negative_balance', as: :boolean, input_html: { checked: f.object.settings.notify['negative_balance'] }
= notify.input 'upcoming_tasks', as: :boolean, input_html: { checked: f.object.settings.notify['upcoming_tasks'] }

View File

@ -1621,10 +1621,8 @@ de:
one: Arbeitsgruppe one: Arbeitsgruppe
other: Arbeitsgruppen other: Arbeitsgruppen
settings: settings:
settings_groups: Einstellungen
settings_group: settings_group:
profile: Porfil privacy:
notify: Benachrichtigungen
messages: Nachrichten messages: Nachrichten
profile: profile:
language: Sprache language: Sprache

View File

@ -1624,10 +1624,8 @@ en:
one: Workgroup one: Workgroup
other: Workgroups other: Workgroups
settings: settings:
settings_groups: Preferences
settings_group: settings_group:
profile: Porfile privacy: Privacy
notify: Notifications
messages: Messages messages: Messages
profile: profile:
language: Language language: Language