Commit 55582047413c639a4843f52f9869fafc01bf6522
1 parent
f230591b
Exists in
master
and in
4 other branches
Improve UI for Project settings page
Showing
1 changed file
with
58 additions
and
45 deletions
Show diff stats
app/views/projects/edit.html.haml
1 | 1 | .project-edit-container |
2 | 2 | .project-edit-errors |
3 | 3 | .project-edit-content |
4 | - .ui-box.white | |
5 | - .title | |
6 | - %strong= @project.name | |
7 | - project settings: | |
4 | + %div | |
5 | + %h3.page-title | |
6 | + Project settings: | |
7 | + %p.light Some settings like transferring project are hidden inside danger area below | |
8 | + %hr | |
8 | 9 | .form-holder |
9 | 10 | = form_for(@project, remote: true) do |f| |
10 | 11 | %fieldset |
... | ... | @@ -100,56 +101,68 @@ |
100 | 101 | .form-actions |
101 | 102 | = f.submit 'Save changes', class: "btn btn-save" |
102 | 103 | |
103 | - - if can?(current_user, :change_namespace, @project) | |
104 | + | |
105 | + | |
106 | + %center.light.prepend-top-20.padded | |
107 | + %h3 | |
108 | + %i.icon-warning-sign | |
109 | + Dangerous settings | |
110 | + %p Project settings below may result in data loss! | |
111 | + = link_to '#', class: 'btn js-toggle-visibility-link' do | |
112 | + Show it to me | |
113 | + %i.icon-chevron-down | |
114 | + | |
115 | + .js-toggle-visibility-container.hide | |
116 | + - if can?(current_user, :change_namespace, @project) | |
117 | + .ui-box.ui-box-danger | |
118 | + .title Transfer project | |
119 | + .errors-holder | |
120 | + .form-holder | |
121 | + = form_for(@project, url: transfer_project_path(@project), remote: true, html: { class: 'transfer-project' }) do |f| | |
122 | + .control-group | |
123 | + = f.label :namespace_id do | |
124 | + %span Namespace | |
125 | + .controls | |
126 | + .control-group | |
127 | + = f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} | |
128 | + %ul | |
129 | + %li Be careful. Changing project namespace can have unintended side effects | |
130 | + %li You can transfer project only to namespaces you can manage | |
131 | + %li You will need to update your local repositories to point to the new location. | |
132 | + .form-actions | |
133 | + = f.submit 'Transfer', class: "btn btn-remove" | |
134 | + - else | |
135 | + %p.nothing_here_message Only project owner can transfer a project | |
136 | + | |
104 | 137 | .ui-box.ui-box-danger |
105 | - .title Transfer project | |
138 | + .title Rename repository | |
106 | 139 | .errors-holder |
107 | 140 | .form-holder |
108 | - = form_for(@project, url: transfer_project_path(@project), remote: true, html: { class: 'transfer-project' }) do |f| | |
141 | + = form_for(@project) do |f| | |
109 | 142 | .control-group |
110 | - = f.label :namespace_id do | |
111 | - %span Namespace | |
143 | + = f.label :path do | |
144 | + %span Path | |
112 | 145 | .controls |
113 | 146 | .control-group |
114 | - = f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} | |
147 | + = f.text_field :path | |
115 | 148 | %ul |
116 | - %li Be careful. Changing project namespace can have unintended side effects | |
117 | - %li You can transfer project only to namespaces you can manage | |
149 | + %li Be careful. Rename of project repo can have unintended side effects | |
118 | 150 | %li You will need to update your local repositories to point to the new location. |
119 | 151 | .form-actions |
120 | - = f.submit 'Transfer', class: "btn btn-remove" | |
121 | - - else | |
122 | - %p.nothing_here_message Only project owner can transfer a project | |
123 | - | |
124 | - .ui-box.ui-box-danger | |
125 | - .title Rename repository | |
126 | - .errors-holder | |
127 | - .form-holder | |
128 | - = form_for(@project) do |f| | |
129 | - .control-group | |
130 | - = f.label :path do | |
131 | - %span Path | |
132 | - .controls | |
133 | - .control-group | |
134 | - = f.text_field :path | |
135 | - %ul | |
136 | - %li Be careful. Rename of project repo can have unintended side effects | |
137 | - %li You will need to update your local repositories to point to the new location. | |
138 | - .form-actions | |
139 | - = f.submit 'Rename', class: "btn btn-remove" | |
140 | - | |
141 | - - if can?(current_user, :remove_project, @project) | |
142 | - .ui-box.ui-box-danger | |
143 | - .title Remove project | |
144 | - .ui-box-body | |
145 | - %p | |
146 | - Remove of project will cause removing repository and all related resources like issues, merge requests etc. | |
147 | - %p | |
148 | - %strong Removed project can not be restored! | |
149 | - | |
150 | - = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove btn-small" | |
151 | - - else | |
152 | - %p.nothing_here_message Only project owner can remove a project | |
152 | + = f.submit 'Rename', class: "btn btn-remove" | |
153 | + | |
154 | + - if can?(current_user, :remove_project, @project) | |
155 | + .ui-box.ui-box-danger | |
156 | + .title Remove project | |
157 | + .ui-box-body | |
158 | + %p | |
159 | + Remove of project will cause removing repository and all related resources like issues, merge requests etc. | |
160 | + %br | |
161 | + %strong Removed project can not be restored! | |
162 | + | |
163 | + = link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove" | |
164 | + - else | |
165 | + %p.nothing_here_message Only project owner can remove a project | |
153 | 166 | |
154 | 167 | .save-project-loader.hide |
155 | 168 | %center | ... | ... |