BigW Consortium Gitlab

Commit 6ff0652e by randx

Admin area -> user form

parent f13bccc1
...@@ -35,11 +35,13 @@ ...@@ -35,11 +35,13 @@
%h3 Latest projects %h3 Latest projects
%hr %hr
- @projects.each do |project| - @projects.each do |project|
%h5 %p
= link_to project.name, [:admin, project] = link_to project.name, [:admin, project]
.span6 .span6
%h3 Latest users %h3 Latest users
%hr %hr
- @users.each do |user| - @users.each do |user|
%h5 %p
= link_to user.name, [:admin, user] = link_to [:admin, user] do
= user.name
%small= user.email
%h3 %h3.page_title
Projects Projects
= link_to 'New Project', new_admin_project_path, class: "btn small right" = link_to 'New Project', new_admin_project_path, class: "btn small right"
%br %br
......
...@@ -2,68 +2,76 @@ ...@@ -2,68 +2,76 @@
= form_for [:admin, @admin_user] do |f| = form_for [:admin, @admin_user] do |f|
-if @admin_user.errors.any? -if @admin_user.errors.any?
#error_explanation #error_explanation
%ul %ul.unstyled.alert.alert-error
- @admin_user.errors.full_messages.each do |msg| - @admin_user.errors.full_messages.each do |msg|
%li= msg %li= msg
.row .row
.span6 .span7
.clearfix .ui-box
= f.label :name %br
.input
= f.text_field :name
%span.help-inline * required
.clearfix
= f.label :email
.input
= f.text_field :email
%span.help-inline * required
%hr
-if f.object.new_record?
.clearfix
= f.label :admin, class: "checkbox" do
= f.check_box :force_random_password, {}, true, nil
%span Generate random password
%div.password-fields
.clearfix .clearfix
= f.label :password = f.label :name
.input= f.password_field :password, disabled: f.object.force_random_password .input
= f.text_field :name
%span.help-inline * required
.clearfix .clearfix
= f.label :password_confirmation = f.label :email
.input= f.password_field :password_confirmation, disabled: f.object.force_random_password .input
%hr = f.text_field :email
.clearfix %span.help-inline * required
= f.label :skype %hr
.input= f.text_field :skype -if f.object.new_record?
.clearfix .clearfix
= f.label :linkedin = f.label :force_random_password do
.input= f.text_field :linkedin %span Generate random password
.clearfix .input= f.check_box :force_random_password, {}, true, nil
= f.label :twitter
.input= f.text_field :twitter %div.password-fields
.span6 .clearfix
.clearfix = f.label :password
= f.label :projects_limit .input= f.password_field :password, disabled: f.object.force_random_password
.input= f.text_field :projects_limit, class: "small_input" .clearfix
= f.label :password_confirmation
.input= f.password_field :password_confirmation, disabled: f.object.force_random_password
%hr
.clearfix
= f.label :skype
.input= f.text_field :skype
.clearfix
= f.label :linkedin
.input= f.text_field :linkedin
.clearfix
= f.label :twitter
.input= f.text_field :twitter
.span5
.ui-box
%br
.clearfix
= f.label :projects_limit
.input= f.number_field :projects_limit
.alert
.clearfix .clearfix
%p Make the user a GitLab administrator. = f.label :admin do
= f.label :admin, class: "checkbox" do %strong.cred Administrator
= f.check_box :admin .input= f.check_box :admin
%span Administrator - unless @admin_user.new_record?
- unless @admin_user.new_record? %hr
.alert.alert-error .padded.cred
- if @admin_user.blocked - if @admin_user.blocked
%span %span
= link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" This user is blocked and is not able to login to GitLab
This user is blocked and is not able to login to GitLab .clearfix
- else = link_to 'Unblock User', unblock_admin_user_path(@admin_user), method: :put, class: "btn small right"
%span - else
= link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" %span
Blocked users will be removed from all projects & will not be able to login to GitLab. Blocked users will be removed from all projects & will not be able to login to GitLab.
.clearfix
= link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small right danger"
.row
.span6
.span6
.actions .actions
= f.submit 'Save', class: "btn primary" = f.submit 'Save', class: "btn primary"
- if @admin_user.new_record? - if @admin_user.new_record?
......
%h3= @admin_user.name %h3.page_title #{@admin_user.name} → Edit user
%hr %hr
= render 'form' = render 'form'
%h3 %h3.page_title
Users Users
= link_to 'New User', new_admin_user_path, class: "btn small right" = link_to 'New User', new_admin_user_path, class: "btn small right"
%br %br
......
%h2 New user %h3.page_title New user
%hr %br
= render 'form' = render 'form'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment