Sha256: 4f54943c79cca9df174b7085d8fe3b1a760d11c3a21c09667b8c7caae703594d

Contents?: true

Size: 1.42 KB

Versions: 10

Compression:

Stored size: 1.42 KB

Contents

<%
  show_empty_sections ||= false
  remove_automatic_sections ||= false
  hide_sections ||= []

  sections = [
    {:yield => :body_content_title, :fallback => page_title, :id => 'body_content_page_title', :title => true},
    {:yield => :body_content_left, :fallback => (@page.present? ? @page[Page.default_parts.first.to_sym] : nil)},
    {:yield => :body_content_right, :fallback => (@page.present? ? @page[Page.default_parts.second.to_sym] : nil)}
  ].reject {|section| hide_sections.include?(section[:yield]) }

  css = []
  sections.each do |section|
    dom_id = (section[:id] ||= section[:yield].to_s)
    section[:html] = (yield(section[:yield]))

    if section[:html].blank? and
       !show_empty_sections and
       !remove_automatic_sections and
       section.keys.include?(:fallback) and
       section[:fallback].present?
      section[:html] = section[:fallback].to_s.html_safe
    end

    unless section[:html].blank?
      unless section[:title]
        section[:html] = "<div class='clearfix' id='#{dom_id}'>#{section[:html]}</div>"
      else
        section[:html] = "<h1 id='#{dom_id}'>#{section[:html]}</h1>"
      end
    else
      css << "no_#{dom_id}"
    end
  end
-%>
<div id='body_content' class='clearfix<%= " #{css.join(' ')}" if css.any? %>'>
  <% sections.each do |s| %>
    <%= s[:html].to_s.html_safe %>
  <% end %>
</div>
<%= render :partial => '/shared/draft_page_message' unless @page.nil? or @page.live? -%>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
refinerycms-0.9.8.9 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.8 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.7 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.6 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.5 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.4 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.3 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.2 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8.1 vendor/refinerycms/core/app/views/shared/_content_page.html.erb
refinerycms-0.9.8 vendor/refinerycms/core/app/views/shared/_content_page.html.erb