<%= tb_form_for @user, :url => path, :remote => true, :data => {:errors => :inline, :success => back_or_default(admin_users_path)}, :html => {:class => 'user-form'} do |f| %> <%= tb_form_error_header(f.object) %> <%= f.tb_sub_title 'User Details' %> <% if !TbCore.config.use_email_as_login %> <%= f.tb_text_field :login %> <% end %> <%= f.tb_text_field :email %> <%= f.tb_text_field :first_name %> <%= f.tb_text_field :last_name %> <%= f.tb_time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones, {:default => Rails.application.config.time_zone} %> <%= render :partial => 'form_additions', :locals => {:f => f} %> <%= f.tb_sub_title 'Credentials' %> <%= f.tb_password_field :password %> <%= f.tb_password_field :password_confirmation %>
<%= link_to 'Generate Password', '#', :class => 'btn btn-default btn-sm btn-generate-password' %>
<%= f.tb_label :requires_password_change %>
<%= f.check_box :requires_password_change %> Require the user changes their password the next time they log in.
<%= label_tag :send_email, 'Send email', :class => 'control-label col-sm-2' %>
<%= check_box_tag :send_email %> Send the user an email containing their password.
<%= f.tb_sub_title 'Permissions' %> <%= f.tb_check_box :super_admin, :help_block => 'The super administrator bypasses all permissions and roles.' %> <%= f.tb_select :spud_role_id, options_from_collection_for_select(SpudRole.all, :id, :name, f.object.spud_role_id), {:include_blank => 'No Role'} %> <%= f.tb_save_buttons('User', @user.new_record? ? admin_users_path : admin_user_path(@user)) %> <% end %>