foreman/app/views/users/_form.html.erb @ 1ba8458a
7e1f0c79 | Daniel Lobato | <%= javascript 'users' %>
|
|
3f300fae | Amos Benari | <%= form_for @user do |f| %>
|
|
05ab4c16 | Ohad Levy | <%= base_errors_for @user %>
|
|
7e1f0c79 | Daniel Lobato | <ul class='nav nav-tabs' data-tabs='tabs'>
|
|
<li class='active'><a href='#primary' data-toggle='tab'><%= _('User') %></a></li>
|
|||
<% unless @editing_self || @user.admin? %>
|
|||
611f5bff | Amos Benari | <% if show_location_tab? %>
|
|
7e1f0c79 | Daniel Lobato | <li><a href='#locations' data-toggle='tab'><%= _('Locations') %></a></li>
|
|
611f5bff | Amos Benari | <% end %>
|
|
<% if show_organization_tab? %>
|
|||
7e1f0c79 | Daniel Lobato | <li><a href='#organizations' data-toggle='tab'><%= _('Organizations') %></a></li>
|
|
611f5bff | Amos Benari | <% end %>
|
|
7e1f0c79 | Daniel Lobato | <li><a href='#roles' data-toggle='tab'><%= _('Roles') %></a></li>
|
|
4d4557e9 | Joseph Magen | <% end %>
|
|
e1f867f0 | Ohad Levy | </ul>
|
|
7e1f0c79 | Daniel Lobato | <div class='tab-content'>
|
|
<div class='tab-pane active' id='primary'>
|
|||
e1f867f0 | Ohad Levy | ||
7e1f0c79 | Daniel Lobato | <%= text_f f, :login, :disabled => f.object.login == 'admin' %>
|
|
74e0b0e3 | Lukas Zapletal | <%= text_f f, :firstname %>
|
|
<%= text_f f, :lastname %>
|
|||
<%= text_f f, :mail %>
|
|||
e1f867f0 | Ohad Levy | ||
936bab04 | Joseph Magen | <% if SETTINGS[:locations_enabled] %>
|
|
7e1f0c79 | Daniel Lobato | <%= select_f f, :default_location_id, (@user.admin? ? Location.all : @user.locations), :id, :title,
|
|
{ :include_blank => true }, { :label => _('Default location') } %>
|
|||
<% end %>
|
|||
936bab04 | Joseph Magen | <% if SETTINGS[:organizations_enabled] %>
|
|
7e1f0c79 | Daniel Lobato | <%= select_f f, :default_organization_id,(@user.admin? ? Organization.all : @user.organizations), :id, :title,
|
|
{ :include_blank => true }, { :label => _('Default organization') } %>
|
|||
<% end %>
|
|||
05ab4c16 | Ohad Levy | ||
7e1f0c79 | Daniel Lobato | <%= selectable_f(f, :locale, FastGettext.human_available_locales,
|
|
{ :include_blank => _('Browser locale') } , { :label => _('Language') } ) %>
|
|||
<%= select_f(f, :auth_source_id, AuthSource.all.delete_if { |a| a.to_label.nil? } , :id,
|
|||
:to_label, { :include_blank => true } ,
|
|||
{ :onchange => 'auth_source_selected()',
|
|||
:label => _('Authorized by') } ) unless @editing_self %>
|
|||
<div id='password' <%= display? !@user.manage_password? %>>
|
|||
<%= password_f f, :password, :label => _('Password') %>
|
|||
<%= password_f f, :password_confirmation, :label => _('Verify') %>
|
|||
e1f867f0 | Ohad Levy | </div>
|
|
22a48ce1 | Amos Benari | </div>
|
|
7e1f0c79 | Daniel Lobato | <% unless @editing_self || @user.admin? %>
|
|
<div class='tab-pane' id='roles'>
|
|||
bae665de | Marek Hulan | <%= checkbox_f f, :admin if User.current.can_change_admin_flag? %>
|
|
7e1f0c79 | Daniel Lobato | <%= multiple_checkboxes f, :roles, @user, Role.givable.for_current_user,
|
|
{ :label => _('Roles') } %>
|
|||
22a48ce1 | Amos Benari | </div>
|
|
05ab4c16 | Ohad Levy | ||
611f5bff | Amos Benari | <% if show_location_tab? %>
|
|
7e1f0c79 | Daniel Lobato | <div class='tab-pane' id='locations'>
|
|
<%= location_selects(f, @user.used_or_selected_location_ids,
|
|||
{ :disabled => @user.used_location_ids,
|
|||
1ba8458a | Dominic Cleal | :label => :none } ,
|
|
7e1f0c79 | Daniel Lobato | { :onchange => 'taxonomy_added(this, "location")' } ) %>
|
|
611f5bff | Amos Benari | </div>
|
|
<% end %>
|
|||
e1f867f0 | Ohad Levy | ||
611f5bff | Amos Benari | <% if show_organization_tab? %>
|
|
7e1f0c79 | Daniel Lobato | <div class='tab-pane' id='organizations'>
|
|
<%= organization_selects(f, @user.used_or_selected_organization_ids,
|
|||
{ :disabled => @user.used_organization_ids,
|
|||
1ba8458a | Dominic Cleal | :label => :none },
|
|
7e1f0c79 | Daniel Lobato | { :onchange => 'taxonomy_added(this, "organization")' } ) %>
|
|
611f5bff | Amos Benari | </div>
|
|
<% end %>
|
|||
e1f867f0 | Ohad Levy | <% end %>
|
|
</div>
|
|||
7e1f0c79 | Daniel Lobato | ||
05ab4c16 | Ohad Levy | <%= submit_or_cancel f %>
|
|
4d4557e9 | Joseph Magen | <% end %>
|