2016-02-09 12:06:55 -05:00
|
|
|
class Projects::PagesController < Projects::ApplicationController
|
|
|
|
layout 'project_settings'
|
|
|
|
|
2016-02-19 09:11:26 -05:00
|
|
|
before_action :authorize_read_pages!, only: [:show]
|
|
|
|
before_action :authorize_update_pages!, except: [:show]
|
2016-02-10 09:06:31 -05:00
|
|
|
|
2016-02-09 12:06:55 -05:00
|
|
|
def show
|
2016-02-14 15:22:44 -05:00
|
|
|
@domains = @project.pages_domains.order(:domain)
|
2016-02-09 12:06:55 -05:00
|
|
|
end
|
|
|
|
|
2016-02-10 09:06:31 -05:00
|
|
|
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(namespace_project_pages_path(@project.namespace, @project),
|
|
|
|
notice: 'Pages were removed')
|
|
|
|
end
|
|
|
|
end
|
2016-02-10 10:21:39 -05:00
|
|
|
end
|
2016-02-09 12:06:55 -05:00
|
|
|
end
|