mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
Implemented ability of admins to manually confirm users
This commit is contained in:
parent
6c2dc92b84
commit
c50e8c0466
7 changed files with 90 additions and 16 deletions
|
|
@ -14,12 +14,6 @@
|
|||
- if can? :edit, @user
|
||||
.pull-right
|
||||
= link_to 'Edit', edit_admin_user_path(@user), class: 'btn btn-primary'
|
||||
- if @user.confirmed?
|
||||
%span.label.label-success
|
||||
confirmed
|
||||
- else
|
||||
%span.label.label-warning
|
||||
unconfirmed
|
||||
%table.table
|
||||
- @show_attributes.each do |attr|
|
||||
%tr
|
||||
|
|
@ -32,6 +26,28 @@
|
|||
- elsif attr == 'biography'
|
||||
%td
|
||||
= markdown(@user.biography)
|
||||
- elsif attr == 'email'
|
||||
%td
|
||||
= @user.send(attr)
|
||||
%tr
|
||||
%td
|
||||
%b
|
||||
Confirmed?
|
||||
%td
|
||||
- if can? :toggle_confirmation, @user
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
method: :patch,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: false,
|
||||
data: { size: 'small', on_color: 'success', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
- else
|
||||
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
||||
method: :patch,
|
||||
url: "/admin/users/#{@user.id}/toggle_confirmation?user[to_confirm]=",
|
||||
class: 'switch-checkbox',
|
||||
readonly: true,
|
||||
data: { size: 'small', on_color: 'success', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
- else
|
||||
%td= @user.send(attr)
|
||||
#submissions-content.tab-pane{class: "#{'active' if params[:tab] == 'submissions-content'}"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue