gitlab-org--gitlab-foss/app/controllers/projects/pages_controller.rb
Mark Fletcher 3ce95e7c16 Disable navigation to Pages config if Pages is disabled
* Regards project-level pages config
- Nav link is now shown only if Pages is enabled for instance
- Navigation to following controllers denied if Pages disabled:
  * projects/pages_controller
  * projects/pages_domains_controller
- 'disabled' partial removed
+ Test for pages_controller introduced
2017-05-04 14:11:40 +08:00

23 lines
604 B
Ruby

class Projects::PagesController < Projects::ApplicationController
layout 'project_settings'
before_action :require_pages_enabled!
before_action :authorize_read_pages!, only: [:show]
before_action :authorize_update_pages!, except: [:show]
def show
@domains = @project.pages_domains.order(:domain)
end
def destroy
project.remove_pages
project.pages_domains.destroy_all
respond_to do |format|
format.html do
redirect_to(namespace_project_pages_path(@project.namespace, @project),
notice: 'Pages were removed')
end
end
end
end