|
|
%h1 Users
|
|
|
|
|
|
.card.border-success.mb-3
|
|
|
.card-header.text-bg-success.border-success
|
|
|
Quick Add
|
|
|
.card-body
|
|
|
= form_with url: user_admin_index_path, scope: :user, class: 'row row-cols-lg-auto g-3 align-items-center' do |f|
|
|
|
.col-12
|
|
|
= f.text_field 'login', :size => 10,class: 'form-control', placeholder: 'login'
|
|
|
.form-group
|
|
|
= f.text_field 'full_name', :size => 10,class: 'form-control', placeholder: 'full name'
|
|
|
.form-group
|
|
|
= f.password_field 'password', :size => 10,class: 'form-control', placeholder: 'password'
|
|
|
.form-group
|
|
|
= f.password_field 'password_confirmation', :size => 10,class: 'form-control', placeholder: 'password confirmation'
|
|
|
.form-group
|
|
|
= f.text_field 'email', :size => 10,class: 'form-control', placeholder: 'email'
|
|
|
=submit_tag "Create", class: 'btn btn-success align-items-bottom'
|
|
|
|
|
|
.card.border-success.mb-3
|
|
|
.card-header.text-bg-success.border-success
|
|
|
Import from site management
|
|
|
.card-body
|
|
|
= form_with url: import_user_admin_index_path, :multipart => true do |f|
|
|
|
.row
|
|
|
.col-auto
|
|
|
= f.label :file, 'File:', class: 'col-form-label'
|
|
|
.col-auto
|
|
|
= f.file_field :file, class: 'form-control'
|
|
|
.col-auto
|
|
|
= f.submit 'Submit', class: 'btn btn-secondary'
|
|
|
|
|
|
|
|
|
%p
|
|
|
= link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '}
|
|
|
= link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '}
|
|
|
= link_to 'Bulk Manage', { action: :bulk_manage} , { class: 'btn btn-secondary btn-info'}
|
|
|
= link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-secondary '}
|
|
|
= link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-secondary '}
|
|
|
= link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-secondary '}
|
|
|
= link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-secondary '}
|
|
|
|
|
|
- if GraderConfiguration.multicontests?
|
|
|
%br/
|
|
|
%b Multi-contest:
|
|
|
= link_to '[Manage bulk users in contests]', :action => 'contest_management'
|
|
|
View users in:
|
|
|
- @contests.each do |contest|
|
|
|
= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id
|
|
|
= link_to "[no contest]", :action => 'contests', :id => 'none'
|
|
|
|
|
|
%table.table.table-hover.table-condense.datatable
|
|
|
%thead
|
|
|
%th Login
|
|
|
%th Full name
|
|
|
%th email
|
|
|
%th Remark
|
|
|
%th
|
|
|
Activated
|
|
|
%sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'User has already confirmed the email?' } [?]
|
|
|
%th
|
|
|
Enabled
|
|
|
%sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'Allow the user to login?' } [?]
|
|
|
%th Last IP
|
|
|
%th
|
|
|
%th
|
|
|
%th
|
|
|
%th
|
|
|
- for user in @users
|
|
|
%tr
|
|
|
%td= link_to user.login, stat_user_path(user)
|
|
|
%td= user.full_name
|
|
|
%td= user.email
|
|
|
%td= user.remark
|
|
|
%td= toggle_button(user.activated?, toggle_activate_user_path(user),"toggle_activate_user_#{user.id}")
|
|
|
%td= toggle_button(user.enabled?, toggle_enable_user_path(user),"toggle_enable_user_#{user.id}")
|
|
|
%td= user.last_ip
|
|
|
%td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-secondary btn-sm btn-block'
|
|
|
%td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-secondary btn-sm btn-block'
|
|
|
%td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-secondary btn-sm btn-block'
|
|
|
%td= link_to 'Destroy', {action: :destroy, id: user}, data: {confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-danger btn-sm btn-block'
|
|
|
%br/
|
|
|
= link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '}
|
|
|
= link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '}
|
|
|
|
|
|
:javascript
|
|
|
$(document).on('import-map-loaded',(e) => {
|
|
|
$('.datatable').DataTable({
|
|
|
'pageLength': 50
|
|
|
});
|
|
|
})
|
|
|
|