<%= f.label :username -%>
<%= user.username -%>
<%= f.label :email -%>
<%= f.email_field :email, :class => 'resource_email' -%>
<%= t('simple_form.required.mark') %>
<%= f.label :current_password -%>
<%= f.password_field :current_password, :class => 'resource_email', :autocomplete => 'off' -%>
<%= f.label :password -%>
<%= f.password_field :password, :class => 'resource_email', :autocomplete => 'off' -%>
<%= f.label :password_confirmation -%>
<%= f.password_field :password_confirmation, :class => 'resource_email', :autocomplete => 'off' -%>
<%= f.label :expired_at -%>
<%- if current_user.has_role?('Librarian') -%>
<%= f.text_field :expired_at, :value => user.expired_at.try(:strftime, "%Y-%m-%d"), :class => 'date_text_field', :placeholder => "#{t('page.example')}: 2011-04-12"-%>
<%- else -%>
<%= l(user.expired_at) if user.expired_at -%>
<%- end -%>
<%= f.check_box :locked, :disabled => 'disabled' -%>
<%= f.label :locked -%>
<%= f.label t('activerecord.models.user_group') -%>
<%- if current_user.has_role?('Librarian') -%>
<%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}) -%>
<% else %>
<%= current_user.user_group.display_name.localize %>
<% end %>
<%= f.label t('activerecord.models.role') -%>
<%- if current_user.has_role?('Administrator') and current_user != user -%>
<%= f.fields_for :user_has_role do |u| %>
<%= u.select :role_id, @roles.collect{|r| [r.display_name.localize, r.id]} %>
<% end %>
<% else %>
<%= current_user.role.display_name.localize %>
<% end %>
<%= f.label :user_number -%>
<%- if current_user.has_role?('Librarian') -%>
<%= f.text_field :user_number, :class => 'resource_user_number' -%>
<%- else -%>
<%= user.user_number -%>
<%- end -%>
<%- if current_user.has_role?('Librarian') -%>
<%= f.label t('activerecord.models.library') -%>
<%= f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
<%= f.label t('role.required_role') -%>
<%= f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]}) -%>
<%- end -%>
<%= f.label :locale -%>
<%= f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]}) -%>