Show More
Commit Description:
manage
Commit Description:
manage
File last commit:
Show/Diff file:
Action:
app/views/user_admin/index.html.haml | 91 lines | 3.9 KiB | text/x-haml | HamlLexer |
use datatable
r694 %h1 Users
- bootstrap: user admin quick add
r571
user admin
r875 .card.border-success.mb-3
.card-header.text-bg-success.border-success
- bootstrap: user admin quick add
r571 Quick Add
DRY problem select
r874 .card-body
user admin
r875 = form_with url: user_admin_index_path, scope: :user, class: 'row row-cols-lg-auto g-3 align-items-center' do |f|
DRY problem select
r874 .col-12
user admin
r875 = f.text_field 'login', :size => 10,class: 'form-control', placeholder: 'login'
- bootstrap: user admin quick add
r571 .form-group
user admin
r875 = f.text_field 'full_name', :size => 10,class: 'form-control', placeholder: 'full name'
- bootstrap: user admin quick add
r571 .form-group
user admin
r875 = f.password_field 'password', :size => 10,class: 'form-control', placeholder: 'password'
- bootstrap: user admin quick add
r571 .form-group
user admin
r875 = f.password_field 'password_confirmation', :size => 10,class: 'form-control', placeholder: 'password confirmation'
- bootstrap: user admin quick add
r571 .form-group
user admin
r875 = f.text_field 'email', :size => 10,class: 'form-control', placeholder: 'email'
=submit_tag "Create", class: 'btn btn-success align-items-bottom'
- bootstrap: user admin quick add
r571
user admin
r875 .card.border-success.mb-3
.card-header.text-bg-success.border-success
- countdown timer
r572 Import from site management
user admin
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'
- panel the main page...
r577
- countdown timer
r572
- panel the main page...
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 '}
user admin
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 '}
- panel the main page...
r577
- if GraderConfiguration.multicontests?
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 %br/
- panel the main page...
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'
add datatable...
r691 %table.table.table-hover.table-condense.datatable
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
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
- fix link to user stat from user admin...
r611 %td= link_to user.login, stat_user_path(user)
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 %td= user.full_name
%td= user.email
%td= user.remark
change _url to _path when using toggle_button so that protocol is preserved
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}")
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 %td= user.last_ip
manage
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'
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 %br/
- panel the main page...
r577 = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '}
= link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '}
add datatable...
r691
:javascript
user admin
r875 $(document).on('import-map-loaded',(e) => {
$('.datatable').DataTable({
'pageLength': 50
});
})