2016-02-09 12:06:55 -05:00
|
|
|
class Projects::PagesController < Projects::ApplicationController
|
|
|
|
layout 'project_settings'
|
|
|
|
|
2017-04-06 23:27:35 -04:00
|
|
|
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-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
|
2017-06-29 13:06:35 -04:00
|
|
|
redirect_to project_pages_path(@project),
|
2017-06-06 18:45:16 -04:00
|
|
|
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
|