Skip to content

Commit

Permalink
Fixes #1393.
Browse files Browse the repository at this point in the history
  • Loading branch information
robyurkowski committed Mar 27, 2012
1 parent e6f3b46 commit 15693ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* Fixed issue with Heroku option for CMS generator. [Philip Arndt](https://github.com/parndt)
* Fixed config.assets.initialize_on_precompile setting to false. [Philip Arndt](https://github.com/parndt)
* Add label style for admin Page tree [Nic Aitch](https://github.com/nicinabox)
* Fixed page part hiding [Rob Yurkowski](https://github.com/robyurkowski)
* Fixed missing page part CSS classes (i.e. no\_side\_body) [Rob Yurkowski](https://github.com/robyurkowski)
* Deprecated body\_content\_left and body\_content\_right [Rob Yurkowski](https://github.com/robyurkowski)
* Reorganizes documentation [Rob Yurkowski](https://github.com/robyurkowski)

## 2.0.2 [15 March 2012]

Expand Down
4 changes: 4 additions & 0 deletions pages/lib/refinery/pages/content_page_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def add_default_title_section(title)
def add_default_post_page_sections
add_section_if_missing(:id => :body)
add_section_if_missing(:id => :side_body)

# Deprecated in 2.1
add_section_if_missing(:id => :body_content_left)
add_section_if_missing(:id => :body_content_right)
end

def add_page_parts(parts)
Expand Down
16 changes: 15 additions & 1 deletion pages/lib/refinery/pages/content_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,21 @@ def to_html(can_use_fallback = true)
private

def sections_html(can_use_fallback)
@sections.map {|section| section.wrapped_html(can_use_fallback)}.compact.join("\n").html_safe
@sections.map do |section|
# Remove in 2.1
check_deprecated_sections(section)
section.wrapped_html(can_use_fallback)
end.compact.join("\n").html_safe
end

def check_deprecated_sections(section)
if section.has_content?
if section.id == :body_content_left
Refinery.deprecate "content_for :body_content_left", :when => '2.1.0', :replacement => "content_for :body"
elsif section.id == :body_content_right
Refinery.deprecate "content_for :body_content_right", :when => '2.1.0', :replacement => "content_for :side_body"
end
end
end

def add_section_if_missing(options)
Expand Down

0 comments on commit 15693ce

Please sign in to comment.