Restore admin/edit view for users
This commit is contained in:
parent
e0beb2e475
commit
544407a389
3 changed files with 58 additions and 29 deletions
10
app/views/admin/users/edit.html.haml
Normal file
10
app/views/admin/users/edit.html.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.page-header
|
||||||
|
%h1
|
||||||
|
Edit User
|
||||||
|
= form_for [:admin, @user] do |f|
|
||||||
|
= render partial: 'users/form', locals: { f: f, full: true }
|
||||||
|
.form-group
|
||||||
|
.text-right
|
||||||
|
= f.submit nil, class: 'btn btn-primary'
|
||||||
47
app/views/users/_form.html.haml
Normal file
47
app/views/users/_form.html.haml
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
.form-group
|
||||||
|
= f.label :name
|
||||||
|
= f.text_field :name, class: 'form-control'
|
||||||
|
%span.help-block
|
||||||
|
This is your real name
|
||||||
|
.form-group
|
||||||
|
= f.label :nickname
|
||||||
|
= f.text_field :nickname, class: 'form-control'
|
||||||
|
- if full
|
||||||
|
.form-group
|
||||||
|
= f.label :email_public
|
||||||
|
%abbr{title: 'This field is required'}
|
||||||
|
= f.email_field :email, class: 'form-control', placeholder: 'Email'
|
||||||
|
.form-group
|
||||||
|
= f.label :languages
|
||||||
|
= f.select :languages, I18nData.languages.invert, { include_blank: 'Any Language', include_hidden: false }, { multiple: true, class: 'form-control' }
|
||||||
|
.checkbox
|
||||||
|
%label
|
||||||
|
= f.check_box :is_admin
|
||||||
|
is Admin?
|
||||||
|
%span.help-block
|
||||||
|
An admin can create a new conference, manage users and make other users admins.
|
||||||
|
.checkbox
|
||||||
|
%label
|
||||||
|
= f.check_box :is_disabled
|
||||||
|
Disabled
|
||||||
|
.form-group
|
||||||
|
= f.label :avatar
|
||||||
|
%br
|
||||||
|
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded')
|
||||||
|
%span.help-block
|
||||||
|
Change your avatar on
|
||||||
|
= link_to 'gravatar.com', 'https://gravatar.com'
|
||||||
|
.form-group
|
||||||
|
= f.label :affiliation
|
||||||
|
= f.text_field :affiliation, class: 'form-control'
|
||||||
|
%span.help-block
|
||||||
|
The company you work work, the user group you belong to, or nothing at all.
|
||||||
|
.form-group
|
||||||
|
= f.label :biography
|
||||||
|
= f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control'
|
||||||
|
%span.help-block
|
||||||
|
You have used
|
||||||
|
%span#bio_length
|
||||||
|
= @user.biography ? @user.biography.split.length : 0
|
||||||
|
words. Biographies are limited to 150 words.
|
||||||
|
= markdown_hint
|
||||||
|
|
@ -6,35 +6,7 @@
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= form_for(@user) do |f|
|
= form_for(@user) do |f|
|
||||||
.form-group
|
= render partial: 'users/form', locals: { f: f, full: false }
|
||||||
= f.label :name
|
|
||||||
= f.text_field :name, class: 'form-control'
|
|
||||||
%span.help-block
|
|
||||||
This is your real name
|
|
||||||
.form-group
|
|
||||||
= f.label :nickname
|
|
||||||
= f.text_field :nickname, class: 'form-control'
|
|
||||||
.form-group
|
|
||||||
= f.label :avatar
|
|
||||||
%br
|
|
||||||
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded')
|
|
||||||
%span.help-block
|
|
||||||
Change your avatar on
|
|
||||||
= link_to 'gravatar.com', 'https://gravatar.com'
|
|
||||||
.form-group
|
|
||||||
= f.label :affiliation
|
|
||||||
= f.text_field :affiliation, class: 'form-control'
|
|
||||||
%span.help-block
|
|
||||||
The company you work work, the user group you belong to, or nothing at all.
|
|
||||||
.form-group
|
|
||||||
= f.label :biography
|
|
||||||
= f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control'
|
|
||||||
%span.help-block
|
|
||||||
You have used
|
|
||||||
%span#bio_length
|
|
||||||
= @user.biography ? @user.biography.split.length : 0
|
|
||||||
words. Biographies are limited to 150 words.
|
|
||||||
= markdown_hint
|
|
||||||
.form-group
|
.form-group
|
||||||
.text-right
|
.text-right
|
||||||
= f.submit nil, class: 'btn btn-primary'
|
= f.submit nil, class: 'btn btn-primary'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue