From 6569579c02104a019532779e7f2b03982a6bd795 Mon Sep 17 00:00:00 2001 From: Manuel Wiedenmann Date: Fri, 14 Jun 2013 22:38:07 +0200 Subject: [PATCH] styles the preferences in user profile --- .../bootstrap_and_overrides.css.less | 18 ++++++++ app/views/shared/_user_form_fields.html.haml | 45 +++++++++++++------ config/locales/de.yml | 5 +++ config/locales/en.yml | 6 ++- 4 files changed, 60 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 52f2f108..0d399fd5 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -208,3 +208,21 @@ tr.unavailable { dt { width: 160px; } dd { margin-left: 170px; } } + +.settings { + .settings-group { + margin-bottom: 10px; + .control-label { + margin: 5px 0 0 0; + } + } + .control-group { + margin-bottom: 5px; + } + .control-group.h_wrapper { + margin-bottom: 5px; + } + .control-group.select { + margin-bottom: 15px + } +} \ No newline at end of file diff --git a/app/views/shared/_user_form_fields.html.haml b/app/views/shared/_user_form_fields.html.haml index 21d5fe2b..0cfc5473 100644 --- a/app/views/shared/_user_form_fields.html.haml +++ b/app/views/shared/_user_form_fields.html.haml @@ -6,18 +6,37 @@ = f.input :password, :required => f.object.new_record? = f.input :password_confirmation -= 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'] - = 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 + %h4 + =t 'simple_form.labels.settings.settings_groups' + = f.simple_fields_for :settings_attributes do |s| - = 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 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'] } - = 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'] } + .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 diff --git a/config/locales/de.yml b/config/locales/de.yml index f618345c..87e5e592 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1621,6 +1621,11 @@ de: one: Arbeitsgruppe other: Arbeitsgruppen settings: + settings_groups: Einstellungen + settings_group: + profile: Porfil + notify: Benachrichtigungen + messages: Nachrichten profile: language: Sprache phone_is_public: Telefon ist für Mitglieder sichtbar diff --git a/config/locales/en.yml b/config/locales/en.yml index f7d7098e..4974d16a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1624,7 +1624,11 @@ en: one: Workgroup other: Workgroups settings: - notify: + settings_groups: Preferences + settings_group: + profile: Porfile + notify: Notifications + messages: Messages profile: language: Language phone_is_public: Phone number is visible for other members.