gitlab-org--gitlab-foss/app/controllers/projects/pages_controller.rb

25 lines
606 B
Ruby
Raw Normal View History

2016-02-09 12:06:55 -05:00
class Projects::PagesController < Projects::ApplicationController
layout 'project_settings'
before_action :require_pages_enabled!
2016-02-19 09:11:26 -05:00
before_action :authorize_read_pages!, only: [:show]
before_action :authorize_update_pages!, except: [:show]
2016-02-09 12:06:55 -05:00
def show
@domains = @project.pages_domains.order(:domain)
2016-02-09 12:06:55 -05:00
end
def destroy
2016-02-10 10:21:39 -05:00
project.remove_pages
project.pages_domains.destroy_all
2016-02-14 13:58:45 -05:00
respond_to do |format|
format.html do
redirect_to project_pages_path(@project),
status: 302,
notice: 'Pages were removed'
2016-02-14 13:58:45 -05:00
end
end
2016-02-10 10:21:39 -05:00
end
2016-02-09 12:06:55 -05:00
end