Show More
Commit Description:
manage
Commit Description:
manage
References:
File last commit:
Show/Diff file:
Action:
app/views/user_admin/index.html.haml
| 91 lines
| 3.9 KiB
| text/x-haml
| HamlLexer
|
r694 | %h1 Users | |||
r571 | ||||
r875 | .card.border-success.mb-3 | |||
.card-header.text-bg-success.border-success | ||||
r571 | Quick Add | |||
r874 | .card-body | |||
r875 | = form_with url: user_admin_index_path, scope: :user, class: 'row row-cols-lg-auto g-3 align-items-center' do |f| | |||
r874 | .col-12 | |||
r875 | = f.text_field 'login', :size => 10,class: 'form-control', placeholder: 'login' | |||
r571 | .form-group | |||
r875 | = f.text_field 'full_name', :size => 10,class: 'form-control', placeholder: 'full name' | |||
r571 | .form-group | |||
r875 | = f.password_field 'password', :size => 10,class: 'form-control', placeholder: 'password' | |||
r571 | .form-group | |||
r875 | = f.password_field 'password_confirmation', :size => 10,class: 'form-control', placeholder: 'password confirmation' | |||
r571 | .form-group | |||
r875 | = f.text_field 'email', :size => 10,class: 'form-control', placeholder: 'email' | |||
=submit_tag "Create", class: 'btn btn-success align-items-bottom' | ||||
r571 | ||||
r875 | .card.border-success.mb-3 | |||
.card-header.text-bg-success.border-success | ||||
r572 | Import from site management | |||
r875 | .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' | ||||
r577 | ||||
r572 | ||||
r577 | %p | |||
= link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} | ||||
= link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} | ||||
r875 | = 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 '} | ||||
r577 | ||||
- if GraderConfiguration.multicontests? | ||||
r562 | %br/ | |||
r577 | %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' | ||||
r691 | %table.table.table-hover.table-condense.datatable | |||
r562 | %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 | ||||
r611 | %td= link_to user.login, stat_user_path(user) | |||
r562 | %td= user.full_name | |||
%td= user.email | ||||
%td= user.remark | ||||
r600 | %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}") | ||||
r562 | %td= user.last_ip | |||
r877 | %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' | ||||
r562 | %br/ | |||
r577 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} | |||
= link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} | ||||
r691 | ||||
:javascript | ||||
r875 | $(document).on('import-map-loaded',(e) => { | |||
$('.datatable').DataTable({ | ||||
'pageLength': 50 | ||||
}); | ||||
}) | ||||