mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 05:34:04 +00:00
implement user creation by admin
This commit is contained in:
parent
f057900fb1
commit
93404d543f
5 changed files with 93 additions and 21 deletions
|
|
@ -1,25 +1,28 @@
|
|||
= semantic_form_for [:admin, @user] do |f|
|
||||
= f.inputs 'Basic Information' do
|
||||
.pull-right
|
||||
%b
|
||||
Confirmed?
|
||||
- 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' }
|
||||
- unless @user.new_record?
|
||||
.pull-right
|
||||
%b
|
||||
Confirmed?
|
||||
- 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' }
|
||||
= f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.'
|
||||
= f.input :name, as: :string
|
||||
= f.input :username, :as => :string if @user.new_record?
|
||||
= f.input :email
|
||||
= f.input :password if @user.new_record?
|
||||
= f.input :affiliation, as: :string
|
||||
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown-editable' } },
|
||||
hint: markdown_hint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue