Commit 95e6a5dcd380d738fbf9d959111f049d15ca8d11

Authored by Dmitriy Zaporozhets
1 parent f1266765

Fix admin forms UI

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/views/admin/groups/edit.html.haml
1 %h3.page-title Edit Group 1 %h3.page-title Edit Group
2 %hr 2 %hr
3 -= form_for [:admin, @group] do |f| 3 += form_for [:admin, @group], html: { class: "form-horizontal" } do |f|
4 - if @group.errors.any? 4 - if @group.errors.any?
5 .alert.alert-danger 5 .alert.alert-danger
6 %span= @group.errors.full_messages.first 6 %span= @group.errors.full_messages.first
7 .form-group.group_name_holder 7 .form-group.group_name_holder
8 - = f.label :name do 8 + = f.label :name, class: 'control-label' do
9 Group name 9 Group name
10 .col-sm-10 10 .col-sm-10
11 = f.text_field :name, placeholder: "Example Group", class: "form-control" 11 = f.text_field :name, placeholder: "Example Group", class: "form-control"
12 12
13 .form-group.group-description-holder 13 .form-group.group-description-holder
14 - = f.label :description, "Details" 14 + = f.label :description, "Details", class: 'control-label'
15 .col-sm-10 15 .col-sm-10
16 = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4 16 = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4
17 17
18 .form-group.group_name_holder 18 .form-group.group_name_holder
19 - = f.label :path do 19 + = f.label :path, class: 'control-label' do
20 %span.cred Group path 20 %span.cred Group path
21 .col-sm-10 21 .col-sm-10
22 = f.text_field :path, placeholder: "example-group", class: "form-control danger" 22 = f.text_field :path, placeholder: "example-group", class: "form-control danger"
app/views/admin/groups/new.html.haml
1 %h3.page-title New Group 1 %h3.page-title New Group
2 %hr 2 %hr
3 -= form_for [:admin, @group] do |f| 3 += form_for [:admin, @group], html: { class: 'group-form form-horizontal' } do |f|
4 - if @group.errors.any? 4 - if @group.errors.any?
5 .alert.alert-danger 5 .alert.alert-danger
6 %span= @group.errors.full_messages.first 6 %span= @group.errors.full_messages.first
7 .form-group 7 .form-group
8 - = f.label :name do 8 + = f.label :name, class: 'control-label' do
9 Group name 9 Group name
10 .col-sm-10 10 .col-sm-10
11 - = f.text_field :name, placeholder: "Ex. OpenSource", class: "form-control left" 11 + = f.text_field :name, placeholder: "Ex. OpenSource", class: "form-control"
  12 +
12 .form-group.group-description-holder 13 .form-group.group-description-holder
13 - = f.label :description, "Details" 14 + = f.label :description, "Details", class: 'control-label'
14 .col-sm-10 15 .col-sm-10
15 = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4 16 = f.text_area :description, maxlength: 250, class: "form-control js-gfm-input", rows: 4
16 17
  18 + .form-group
  19 + .col-sm-2
  20 + .col-sm-10
  21 + %ul
  22 + %li A group is a collection of several projects
  23 + %li Groups are private by default
  24 + %li Members of a group may only view projects they have permission to access
  25 + %li Group project URLs are prefixed with the group namespace
  26 + %li Existing projects may be moved into a group
  27 +
17 .form-actions 28 .form-actions
18 = f.submit 'Create group', class: "btn btn-create" 29 = f.submit 'Create group', class: "btn btn-create"
19 30
20 - %hr  
21 - .padded  
22 - %ul  
23 - %li Group is kind of directory for several projects  
24 - %li All created groups are private  
25 - %li People within a group see only projects they have access to  
26 - %li All projects of group will be stored in a group directory  
27 - %li You will be able to move existing projects into group 31 +
app/views/admin/users/_form.html.haml
1 .user_new 1 .user_new
2 - = form_for [:admin, @user] do |f| 2 + = form_for [:admin, @user], html: { class: 'form-horizontal' } do |f|
3 -if @user.errors.any? 3 -if @user.errors.any?
4 #error_explanation 4 #error_explanation
5 %ul.unstyled.alert.alert-danger 5 %ul.unstyled.alert.alert-danger
@@ -9,26 +9,26 @@ @@ -9,26 +9,26 @@
9 %fieldset 9 %fieldset
10 %legend Account 10 %legend Account
11 .form-group 11 .form-group
12 - = f.label :name 12 + = f.label :name, class: 'control-label'
13 .col-sm-10 13 .col-sm-10
14 - = f.text_field :name, required: true, autocomplete: "off" 14 + = f.text_field :name, required: true, autocomplete: "off", class: 'form-control'
15 %span.help-inline * required 15 %span.help-inline * required
16 .form-group 16 .form-group
17 - = f.label :username 17 + = f.label :username, class: 'control-label'
18 .col-sm-10 18 .col-sm-10
19 - = f.text_field :username, required: true, autocomplete: "off" 19 + = f.text_field :username, required: true, autocomplete: "off", class: 'form-control'
20 %span.help-inline * required 20 %span.help-inline * required
21 .form-group 21 .form-group
22 - = f.label :email 22 + = f.label :email, class: 'control-label'
23 .col-sm-10 23 .col-sm-10
24 - = f.text_field :email, required: true, autocomplete: "off" 24 + = f.text_field :email, required: true, autocomplete: "off", class: 'form-control'
25 %span.help-inline * required 25 %span.help-inline * required
26 26
27 - if @user.new_record? 27 - if @user.new_record?
28 %fieldset 28 %fieldset
29 %legend Password 29 %legend Password
30 .form-group 30 .form-group
31 - = f.label :password 31 + = f.label :password, class: 'control-label'
32 .col-sm-10 32 .col-sm-10
33 %strong 33 %strong
34 A temporary password will be generated and sent to user. 34 A temporary password will be generated and sent to user.
@@ -38,48 +38,44 @@ @@ -38,48 +38,44 @@
38 %fieldset 38 %fieldset
39 %legend Password 39 %legend Password
40 .form-group 40 .form-group
41 - = f.label :password  
42 - .col-sm-10= f.password_field :password, disabled: f.object.force_random_password 41 + = f.label :password, class: 'control-label'
  42 + .col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
43 .form-group 43 .form-group
44 - = f.label :password_confirmation  
45 - .col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password 44 + = f.label :password_confirmation, class: 'control-label'
  45 + .col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
46 46
47 %fieldset 47 %fieldset
48 %legend Access 48 %legend Access
49 - .row  
50 - .col-md-8  
51 - .form-group  
52 - = f.label :projects_limit  
53 - .col-sm-10= f.number_field :projects_limit 49 + .form-group
  50 + = f.label :projects_limit, class: 'control-label'
  51 + .col-sm-10= f.number_field :projects_limit, class: 'form-control'
54 52
55 - .form-group  
56 - = f.label :can_create_group  
57 - .col-sm-10= f.check_box :can_create_group 53 + .form-group
  54 + = f.label :can_create_group, class: 'control-label'
  55 + .col-sm-10= f.check_box :can_create_group
58 56
59 - .form-group  
60 - = f.label :admin do  
61 - %strong.cred Administrator  
62 - .col-sm-10= f.check_box :admin  
63 - .col-md-4  
64 - - unless @user.new_record?  
65 - .alert.alert-danger  
66 - - if @user.blocked?  
67 - %p This user is blocked and is not able to login to GitLab  
68 - = link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small"  
69 - - else  
70 - %p Blocked users will be removed from all projects &amp; will not be able to login to GitLab.  
71 - = link_to 'Block User', block_admin_user_path(@user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-small btn-remove" 57 + .form-group
  58 + = f.label :admin, class: 'control-label'
  59 + .col-sm-10= f.check_box :admin
  60 + - unless @user.new_record?
  61 + .alert.alert-danger
  62 + - if @user.blocked?
  63 + %p This user is blocked and is not able to login to GitLab
  64 + = link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small"
  65 + - else
  66 + %p Blocked users will be removed from all projects &amp; will not be able to login to GitLab.
  67 + = link_to 'Block User', block_admin_user_path(@user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-small btn-remove"
72 %fieldset 68 %fieldset
73 %legend Profile 69 %legend Profile
74 .form-group 70 .form-group
75 - = f.label :skype  
76 - .col-sm-10= f.text_field :skype 71 + = f.label :skype, class: 'control-label'
  72 + .col-sm-10= f.text_field :skype, class: 'form-control'
77 .form-group 73 .form-group
78 - = f.label :linkedin  
79 - .col-sm-10= f.text_field :linkedin 74 + = f.label :linkedin, class: 'control-label'
  75 + .col-sm-10= f.text_field :linkedin, class: 'form-control'
80 .form-group 76 .form-group
81 - = f.label :twitter  
82 - .col-sm-10= f.text_field :twitter 77 + = f.label :twitter, class: 'control-label'
  78 + .col-sm-10= f.text_field :twitter, class: 'form-control'
83 79
84 .form-actions 80 .form-actions
85 - if @user.new_record? 81 - if @user.new_record?