Commit e68955b4fcea3b85b3838cb50507a9e3dd5acb5c

Authored by Dmitriy Zaporozhets
1 parent fb1c8506

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,11 +29,6 @@
29 = f.text_field :name, placeholder: "Example Project", class: "span5" 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 .clearfix 32 .clearfix
38 = f.label :description do 33 = f.label :description do
39 Project description 34 Project description
@@ -41,6 +36,11 @@ @@ -41,6 +36,11 @@
41 .input 36 .input
42 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 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 - if can?(current_user, :change_public_mode, @project) 45 - if can?(current_user, :change_public_mode, @project)
46 %fieldset.public-mode 46 %fieldset.public-mode
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 = f.submit 'Save', class: "btn btn-save" 104 = f.submit 'Save', class: "btn btn-save"
105 105
106 .tab-pane#tab-transfer 106 .tab-pane#tab-transfer
107 - - if can? current_user, :change_namespace, @project 107 + - if can?(current_user, :change_namespace, @project)
108 .ui-box.ui-box-danger 108 .ui-box.ui-box-danger
109 %h5.title Transfer project 109 %h5.title Transfer project
110 .form-holder 110 .form-holder
@@ -121,6 +121,8 @@ @@ -121,6 +121,8 @@
121 %li You will need to update your local repositories to point to the new location. 121 %li You will need to update your local repositories to point to the new location.
122 .form-actions 122 .form-actions
123 = f.submit 'Transfer', class: "btn btn-remove" 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 .tab-pane#tab-remove 127 .tab-pane#tab-remove
126 - if can?(current_user, :remove_project, @project) 128 - if can?(current_user, :remove_project, @project)
@@ -133,3 +135,5 @@ @@ -133,3 +135,5 @@
133 %strong Removed project can not be restored! 135 %strong Removed project can not be restored!
134 136
135 = link_to 'Remove project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small" 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