Only show the message if user is not the owner

Closes #323
This commit is contained in:
Lin Jen-Shin 2016-08-08 20:53:31 +08:00 committed by James Edwards-Jones
parent caedc996bd
commit 0168a24064
1 changed files with 10 additions and 9 deletions

View File

@ -1,11 +1,12 @@
- if can?(current_user, :remove_pages, @project) && @project.pages_deployed?
.panel.panel-default.panel.panel-danger
.panel-heading Remove pages
.errors-holder
.panel-body
%p
Removing the pages will prevent from exposing them to outside world.
.form-actions
= link_to 'Remove pages', namespace_project_pages_path(@project.namespace, @project), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove"
- if can?(current_user, :remove_pages, @project)
- if @project.pages_deployed?
.panel.panel-default.panel.panel-danger
.panel-heading Remove pages
.errors-holder
.panel-body
%p
Removing the pages will prevent from exposing them to outside world.
.form-actions
= link_to 'Remove pages', namespace_project_pages_path(@project.namespace, @project), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove"
- else
.nothing-here-block Only the project owner can remove pages