Commit 44209861e8a3ed4e5d0e0e59823d4bf61c338f1f
1 parent
a8fbda94
Exists in
master
and in
4 other branches
Allow group path renaming. Dont show project transfer if no permissions. More danger messages :)
Showing
4 changed files
with
46 additions
and
23 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/common.scss
@@ -100,6 +100,12 @@ input[type='search'].search-text-input { | @@ -100,6 +100,12 @@ input[type='search'].search-text-input { | ||
100 | border: 1px solid #ccc; | 100 | border: 1px solid #ccc; |
101 | } | 101 | } |
102 | 102 | ||
103 | +input[type='text'].danger { | ||
104 | + background: #F2DEDE!important; | ||
105 | + border-color: #D66; | ||
106 | + text-shadow: 0 1px 1px #fff | ||
107 | +} | ||
108 | + | ||
103 | fieldset legend { font-size: 17px; } | 109 | fieldset legend { font-size: 17px; } |
104 | 110 | ||
105 | /** PAGINATION **/ | 111 | /** PAGINATION **/ |
app/views/admin/groups/edit.html.haml
1 | %h3.page_title Rename Group | 1 | %h3.page_title Rename Group |
2 | %hr | 2 | %hr |
3 | -.alert | ||
4 | - Renaming group can have unintended side effects. | ||
5 | - %br | ||
6 | - Renaming group will rename directory for all related projects | ||
7 | = form_for [:admin, @group] do |f| | 3 | = form_for [:admin, @group] do |f| |
8 | - if @group.errors.any? | 4 | - if @group.errors.any? |
9 | .alert-message.block-message.error | 5 | .alert-message.block-message.error |
@@ -14,6 +10,19 @@ | @@ -14,6 +10,19 @@ | ||
14 | .input | 10 | .input |
15 | = f.text_field :name, placeholder: "Example Group", class: "xxlarge" | 11 | = f.text_field :name, placeholder: "Example Group", class: "xxlarge" |
16 | 12 | ||
13 | + | ||
14 | + | ||
15 | + .clearfix.group_name_holder | ||
16 | + = f.label :path do | ||
17 | + %span.cred Group path is | ||
18 | + .input | ||
19 | + = f.text_field :path, placeholder: "example-group", class: "xxlarge danger" | ||
20 | + %ul.cred | ||
21 | + %li Changing group path can have unintended side effects. | ||
22 | + %li Renaming group path will rename directory for all related projects | ||
23 | + %li It will change web url for access group and group projects. | ||
24 | + %li It will change the git path to repositories under this group. | ||
25 | + | ||
17 | .form-actions | 26 | .form-actions |
18 | - = f.submit 'Rename group', class: "btn save-btn" | 27 | + = f.submit 'Rename group', class: "btn danger" |
19 | = link_to 'Cancel', admin_groups_path, class: "btn cancel-btn" | 28 | = link_to 'Cancel', admin_groups_path, class: "btn cancel-btn" |
app/views/admin/groups/show.html.haml
@@ -33,12 +33,17 @@ | @@ -33,12 +33,17 @@ | ||
33 | = link_to "#", class: "btn btn-small change-owner-link" do | 33 | = link_to "#", class: "btn btn-small change-owner-link" do |
34 | %i.icon-edit | 34 | %i.icon-edit |
35 | Change owner | 35 | Change owner |
36 | - .change-owner-holder.hide | ||
37 | - = form_for [:admin, @group] do |f| | ||
38 | - = f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'} | ||
39 | - = f.submit 'Save', class: "btn btn-small save-btn" | ||
40 | - = link_to "Cancel", "#", class: "btn btn-small change-owner-cancel-link" | ||
41 | 36 | ||
37 | + %tr.change-owner-holder.hide | ||
38 | + %td.bgred | ||
39 | + %b.cred | ||
40 | + New Owner: | ||
41 | + %td.bgred | ||
42 | + = form_for [:admin, @group] do |f| | ||
43 | + = f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'} | ||
44 | + %div | ||
45 | + = f.submit 'Change Owner', class: "btn danger" | ||
46 | + = link_to "Cancel", "#", class: "btn change-owner-cancel-link" | ||
42 | %fieldset | 47 | %fieldset |
43 | %legend Projects (#{@group.projects.count}) | 48 | %legend Projects (#{@group.projects.count}) |
44 | %table | 49 | %table |
app/views/projects/_form.html.haml
@@ -17,19 +17,6 @@ | @@ -17,19 +17,6 @@ | ||
17 | .controls | 17 | .controls |
18 | = text_field_tag :ppath, @project.path_to_repo, class: "xxlarge", readonly: true | 18 | = text_field_tag :ppath, @project.path_to_repo, class: "xxlarge", readonly: true |
19 | 19 | ||
20 | - .control-group | ||
21 | - = f.label :namespace_id do | ||
22 | - %span Namespace | ||
23 | - .controls | ||
24 | - - if can? current_user, :change_namespace, @project | ||
25 | - = f.select :namespace_id, namespaces_options(@project.namespace_id || Namespace::global_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} | ||
26 | - | ||
27 | - %span.cred Be careful. Changing project namespace can have unintended side effects | ||
28 | - - else | ||
29 | - %a.btn.disabled= @project.namespace.try(:human_name) || "/" | ||
30 | - | ||
31 | - %span.cred Only owner can change project namespace. | ||
32 | - | ||
33 | 20 | ||
34 | - unless @project.heads.empty? | 21 | - unless @project.heads.empty? |
35 | .clearfix | 22 | .clearfix |
@@ -63,6 +50,22 @@ | @@ -63,6 +50,22 @@ | ||
63 | = f.check_box :wiki_enabled | 50 | = f.check_box :wiki_enabled |
64 | %span.descr Pages for project documentation | 51 | %span.descr Pages for project documentation |
65 | 52 | ||
53 | + | ||
54 | + - if can? current_user, :change_namespace, @project | ||
55 | + %fieldset.features | ||
56 | + %legend Transfer: | ||
57 | + .control-group | ||
58 | + = f.label :namespace_id do | ||
59 | + %span Namespace | ||
60 | + .controls | ||
61 | + = f.select :namespace_id, namespaces_options(@project.namespace_id || Namespace::global_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} | ||
62 | + %br | ||
63 | + %ul.prepend-top-10.cred | ||
64 | + %li Be careful. Changing project namespace can have unintended side effects | ||
65 | + %li You can transfer project only to namespaces you can manage | ||
66 | + %li You will need to update your local repositories to point to the new location. | ||
67 | + | ||
68 | + | ||
66 | %br | 69 | %br |
67 | 70 | ||
68 | .actions | 71 | .actions |