Commit 0d84f345448e3a7a521706588c253fddfea100da
1 parent
02a93dd1
Exists in
master
and in
28 other branches
ActionItem1049: wrapping the main content
8 nested divs to allow fancy borders and formatting
Showing
2 changed files
with
5 additions
and
11 deletions
Show diff stats
app/helpers/boxes_helper.rb
| ... | ... | @@ -63,7 +63,7 @@ module BoxesHelper |
| 63 | 63 | end |
| 64 | 64 | |
| 65 | 65 | def display_block_content(block, main_content = nil) |
| 66 | - content = block.main? ? main_content : block.content | |
| 66 | + content = block.main? ? wrap_main_content(main_content) : block.content | |
| 67 | 67 | result = extract_block_content(content) |
| 68 | 68 | footer_content = extract_block_content(block.footer) |
| 69 | 69 | unless footer_content.blank? |
| ... | ... | @@ -87,6 +87,10 @@ module BoxesHelper |
| 87 | 87 | box_decorator.block_handle(block) |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | + def wrap_main_content(content) | |
| 91 | + (1..8).to_a.reverse.inject(content) { |acc,n| content_tag('div', acc, :id => 'main-content-wrapper-' + n.to_s) } | |
| 92 | + end | |
| 93 | + | |
| 90 | 94 | def extract_block_content(content) |
| 91 | 95 | case content |
| 92 | 96 | when Hash | ... | ... |
app/views/content_viewer/view_page.rhtml
| 1 | 1 | <div id="article"> |
| 2 | -<div id="article-wraper-1"> | |
| 3 | -<div id="article-wraper-2"> | |
| 4 | -<div id="article-wraper-3"> | |
| 5 | -<div id="article-wraper-4"> | |
| 6 | -<div id="article-wraper-5"> | |
| 7 | -<div id="article-wraper-6"> | |
| 8 | -<div id="article-wraper-7"> | |
| 9 | -<div id="article-wraper-8"> | |
| 10 | 2 | |
| 11 | 3 | <% |
| 12 | 4 | # AddThis Button |
| ... | ... | @@ -125,6 +117,4 @@ |
| 125 | 117 | <% end %> |
| 126 | 118 | </div><!-- end class="comments" --> |
| 127 | 119 | |
| 128 | -</div></div></div></div> | |
| 129 | -</div></div></div></div><!-- end id="article-warp-[1-8]" --> | |
| 130 | 120 | </div><!-- end id="article" --> | ... | ... |