Merge remote-tracking branch 'fsmanuel/master' into master.
Updated migration date to today. Conflicts: db/schema.rb
This commit is contained in:
commit
74bfc85562
21 changed files with 269 additions and 88 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -5,11 +5,31 @@
|
|||
= f.input :phone
|
||||
= f.input :password, :required => f.object.new_record?
|
||||
= f.input :password_confirmation
|
||||
.control-group
|
||||
.controls
|
||||
- for setting in User::setting_keys.keys
|
||||
%label.checkbox{:for => "user[setting_attributes][#{setting}]"}
|
||||
= hidden_field_tag "user[setting_attributes][#{setting}]", '0'
|
||||
= check_box_tag "user[setting_attributes][#{setting}]", '1',
|
||||
f.object.settings[setting] == '1' || f.object.settings_default(setting)
|
||||
= User::setting_keys[setting]
|
||||
|
||||
= 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: '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'] }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue