= f.fields_for :user do |user_form| #left_pane_detail .form-group = user_form.label :username br = profile.user.username .form-group = user_form.label :email br = user_form.text_field :email, class: 'form-control' .form-group = f.label :expired_at br - if current_user.has_role?('Librarian') = f.text_field :expired_at, value: profile.expired_at.try(:strftime, "%Y-%m-%d"), class: 'form-control', placeholder: "#{t('page.example')}: 2011-04-12" - else = l(profile.expired_at) if profile.expired_at .form-group .checkbox-inline = user_form.check_box :locked, disabled: 'disabled' = user_form.label :locked .form-group = user_form.label t('activerecord.models.role') br = user_form.fields_for :user_has_role do |u| - if current_user.has_role?('Administrator') and current_user != profile.user = u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {class: 'form-control'}) - else = u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {disabled: 'disabled', class: 'form-control'}) #right_pane_detail .form-group = f.label :full_name br = f.text_field :full_name, class: 'form-control' .form-group = f.label :full_name_transcription br = f.text_field :full_name_transcription, class: 'form-control' - if current_user.has_role?('Librarian') .form-group = f.label t('activerecord.models.user_group') br = f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}, {}, {class: 'form-control'}) .form-group = f.label :user_number br - if current_user.has_role?('Librarian') = f.text_field :user_number, class: 'form-control' - else = profile.user_number - if current_user.has_role?('Librarian') .form-group = f.label t('activerecord.models.library') br = f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}, {}, {class: 'form-control'}) .form-group = f.label t('role.required_role') br = f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {class: 'form-control'}) .form-group = f.label :locale br = f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]}, {}, {class: 'form-control'})