Sha256: d72942a8b7c40c683a1a7af8d6b2207560b64d9dd219f1e06605f6c211c2d4f7
Contents?: true
Size: 1.25 KB
Versions: 8
Compression:
Stored size: 1.25 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[:body] : nil}, {:yield => :body_content_right, :fallback => @page.present? ? @page[:side_body] : 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 section[:html] = section[:fallback] end unless section[:html].blank? unless section[:title] section[:html] = "<div class='clearfix' id='#{dom_id}'>#{section[:html]}</div>".html_safe else section[:html] = "<h1 id='#{dom_id}'>#{section[:html]}</h1>".html_safe end else css << "no_#{dom_id}" end end -%> <div id='body_content' class='clearfix<%= " #{css.join(' ')}" if css.any? %>'> <%= sections.collect {|s| s[:html] }.join("\n") %> </div> <%= render :partial => '/shared/draft_page_message' unless @page.nil? or @page.live? -%>
Version data entries
8 entries across 8 versions & 1 rubygems