Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved page preview functionality behind the protection of /refinery.
Fixes #2012 * Also, stopped responding to page preview on GET route.
- Loading branch information
Showing
10 changed files
with
85 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module Refinery | ||
module Pages | ||
module RenderOptions | ||
|
||
def render_options_for_template(page) | ||
render_options = {} | ||
if Refinery::Pages.use_layout_templates && page.layout_template.present? | ||
render_options[:layout] = page.layout_template | ||
end | ||
if Refinery::Pages.use_view_templates && page.view_template.present? | ||
render_options[:action] = "/refinery/pages/#{page.view_template}" | ||
end | ||
render_options | ||
end | ||
|
||
def render_with_templates?(page = @page, render_options = {}) | ||
render_options.update render_options_for_template(page) | ||
render render_options | ||
end | ||
|
||
protected :render_options_for_template, :render_with_templates? | ||
|
||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters