From c48ce138f377767f1d8ac53ff38263bdb04efa6d Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 18 Jun 2013 12:20:26 +0200 Subject: [PATCH] cleanup of profile layout --- app/views/shared/_user_form_fields.html.haml | 59 +++++++++----------- config/locales/de.yml | 4 +- config/locales/en.yml | 4 +- 3 files changed, 28 insertions(+), 39 deletions(-) diff --git a/app/views/shared/_user_form_fields.html.haml b/app/views/shared/_user_form_fields.html.haml index 0cfc5473..bfd27f49 100644 --- a/app/views/shared/_user_form_fields.html.haml +++ b/app/views/shared/_user_form_fields.html.haml @@ -6,37 +6,30 @@ = f.input :password, :required => f.object.new_record? = f.input :password_confirmation -.settings - %h4 - =t 'simple_form.labels.settings.settings_groups' - = f.simple_fields_for :settings_attributes do |s| - - .settings-group += f.simple_fields_for :settings_attributes do |s| + = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile| + = profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language'] + + .settings + .settings-group + = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile| + %div{class: 'control-group h_wrapper'} - %h5{class: 'control-label'} - = t 'simple_form.labels.settings.settings_group.profile' - - = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile| - = profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language'] - = 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'] } - = profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] } - - .settings-group - %div{class: 'control-group'} - %h5{class: 'control-label'} - =t 'simple_form.labels.settings.settings_group.messages' - - = s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages| - = messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] } - - .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'] } - \ No newline at end of file + %h5{class: 'controls'} + = 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'] } + = profile.input 'email_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['email_is_public'] } + = profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] } + + .settings-group + %div{class: 'control-group'} + %h5{class: 'controls'} + = t 'simple_form.labels.settings.settings_group.messages' + + = s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |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| + = 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'] } + diff --git a/config/locales/de.yml b/config/locales/de.yml index 87e5e592..7990d756 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1621,10 +1621,8 @@ de: one: Arbeitsgruppe other: Arbeitsgruppen settings: - settings_groups: Einstellungen settings_group: - profile: Porfil - notify: Benachrichtigungen + privacy: messages: Nachrichten profile: language: Sprache diff --git a/config/locales/en.yml b/config/locales/en.yml index 4974d16a..bc1f5e33 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1624,10 +1624,8 @@ en: one: Workgroup other: Workgroups settings: - settings_groups: Preferences settings_group: - profile: Porfile - notify: Notifications + privacy: Privacy messages: Messages profile: language: Language