<%= t('page.new', :model => t('activerecord.models.user')) -%>

<%= render 'page/required_field' %> <%= simple_form_for(@user, :validate => true) do |f| -%> <%= f.error_messages -%> <%- if @agent -%>

[P] <%= link_to @agent.full_name, @agent -%>

<%= f.hidden_field :agent_id -%> <%- end -%>
<%= f.label :username -%> <%= f.text_field :username, :class => 'resource_user' -%>
<%= f.label :email -%> <%= f.email_field :email, :class => 'resource_email' -%>
<%= f.label :email_confirmation -%> <%= f.email_field :email_confirmation, :class => 'resource_email' -%>
<%= f.label :user_group_id -%> <%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}) -%>
<%- 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]}) -%>
<%- end -%>
<%= f.label :locale -%> <%= f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]}) -%>
<%= f.label :user_number -%> <%= f.text_field :user_number, :value => "", :class => 'resource_user' -%>
<% if defined?(EnjuSearchLog) %>
<%= f.check_box :save_search_history %> <%= f.label :save_search_history %>
<% end %> <% if defined?(EnjuCirculation) %>
<%= f.check_box :save_checkout_history %> <%= f.label :save_checkout_history %>
<% end %> <% if current_user.has_role?('Librarian') %>
<%= f.label :note -%>
<%= f.text_area :note, :class => 'resource_textarea' -%>
<% end %>
<%= f.submit t('user.sign_up') -%>
<%- end -%> <%= javascript_tag("$(function(){$('#user_username').focus()})") %>