Commit e68955b4fcea3b85b3838cb50507a9e3dd5acb5c
1 parent
fb1c8506
Exists in
master
and in
4 other branches
add permission messages to project edit
Showing
1 changed file
with
10 additions
and
6 deletions
Show diff stats
app/views/projects/_form.html.haml
... | ... | @@ -29,11 +29,6 @@ |
29 | 29 | = f.text_field :name, placeholder: "Example Project", class: "span5" |
30 | 30 | |
31 | 31 | |
32 | - - unless @repository.heads.empty? | |
33 | - .clearfix | |
34 | - = f.label :default_branch, "Default Branch" | |
35 | - .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;") | |
36 | - | |
37 | 32 | .clearfix |
38 | 33 | = f.label :description do |
39 | 34 | Project description |
... | ... | @@ -41,6 +36,11 @@ |
41 | 36 | .input |
42 | 37 | = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 |
43 | 38 | |
39 | + - unless @repository.heads.empty? | |
40 | + .clearfix | |
41 | + = f.label :default_branch, "Default Branch" | |
42 | + .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;") | |
43 | + | |
44 | 44 | |
45 | 45 | - if can?(current_user, :change_public_mode, @project) |
46 | 46 | %fieldset.public-mode |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | = f.submit 'Save', class: "btn btn-save" |
105 | 105 | |
106 | 106 | .tab-pane#tab-transfer |
107 | - - if can? current_user, :change_namespace, @project | |
107 | + - if can?(current_user, :change_namespace, @project) | |
108 | 108 | .ui-box.ui-box-danger |
109 | 109 | %h5.title Transfer project |
110 | 110 | .form-holder |
... | ... | @@ -121,6 +121,8 @@ |
121 | 121 | %li You will need to update your local repositories to point to the new location. |
122 | 122 | .form-actions |
123 | 123 | = f.submit 'Transfer', class: "btn btn-remove" |
124 | + - else | |
125 | + %p.nothing_here_message Only project owner can transfer a project | |
124 | 126 | |
125 | 127 | .tab-pane#tab-remove |
126 | 128 | - if can?(current_user, :remove_project, @project) |
... | ... | @@ -133,3 +135,5 @@ |
133 | 135 | %strong Removed project can not be restored! |
134 | 136 | |
135 | 137 | = link_to 'Remove project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small" |
138 | + - else | |
139 | + %p.nothing_here_message Only project owner can remove a project | ... | ... |