app/controllers/effective/pages_controller.rb in effective_pages-3.1.0 vs app/controllers/effective/pages_controller.rb in effective_pages-3.1.1
- old
+ new
@@ -6,10 +6,12 @@
@pages = Effective::Page.all
@pages = @pages.published unless EffectiveResources.authorized?(self, :admin, :effective_pages)
@page = @pages.find(params[:id])
+ raise ActionController::RoutingError.new('Not Found') if @page.menu_root_with_children?
+
if @page.authenticate_user? || @page.roles.present?
authenticate_user!
end
raise Effective::AccessDenied.new('Access Denied', :show, @page) unless @page.roles_permit?(current_user)
@@ -20,12 +22,11 @@
@canonical_url = effective_pages.page_url(@page)
if EffectiveResources.authorized?(self, :admin, :effective_pages)
flash.now[:warning] = [
'Hi Admin!',
- ('You are viewing a hidden page.' unless @page.published?),
- 'Click here to',
- ("<a href='#{effective_pages.edit_admin_page_path(@page)}' class='alert-link'>edit page settings</a>.")
+ ('You are viewing a draft page.' unless @page.published?),
+ ("<a href='#{effective_pages.edit_admin_page_path(@page)}' class='alert-link'>Click here to edit this page</a>.")
].compact.join(' ')
end
template = File.join(EffectivePages.pages_path, @page.template)
layout = File.join(EffectivePages.layouts_path, @page.layout)