Commit 4c1ac095d1c2b560010886faeacd664b5a2a90f8
1 parent
fd1ffa3a
Exists in
master
and in
29 other branches
container_block: render block title
Showing
2 changed files
with
8 additions
and
0 deletions
Show diff stats
plugins/container_block/test/functional/container_block_home_controller_test.rb
@@ -31,6 +31,13 @@ class HomeControllerTest < ActionController::TestCase | @@ -31,6 +31,13 @@ class HomeControllerTest < ActionController::TestCase | ||
31 | assert_tag :div, :attributes => { :class => 'block container-block-plugin_container-block' } | 31 | assert_tag :div, :attributes => { :class => 'block container-block-plugin_container-block' } |
32 | end | 32 | end |
33 | 33 | ||
34 | + should 'display block title' do | ||
35 | + @block.title = "Block Title" | ||
36 | + @block.save! | ||
37 | + get :index | ||
38 | + assert_tag :div, :attributes => { :class => 'block container-block-plugin_container-block' }, :descendant => {:tag => 'h3', :attributes => { :class => "block-title"}, :content => @block.title } | ||
39 | + end | ||
40 | + | ||
34 | should 'display container children' do | 41 | should 'display container children' do |
35 | c1 = RawHTMLBlock.create!(:box => @block.container_box, :html => 'child1 content') | 42 | c1 = RawHTMLBlock.create!(:box => @block.container_box, :html => 'child1 content') |
36 | c2 = RawHTMLBlock.create!(:box => @block.container_box, :html => 'child2 content') | 43 | c2 = RawHTMLBlock.create!(:box => @block.container_box, :html => 'child2 content') |
plugins/container_block/views/blocks/container.rhtml
1 | <% edit_mode = @controller.send(:boxes_editor?) && @controller.send(:uses_design_blocks?) %> | 1 | <% edit_mode = @controller.send(:boxes_editor?) && @controller.send(:uses_design_blocks?) %> |
2 | <% box_decorator = edit_mode ? self : BoxesHelper::DontMoveBlocks %> | 2 | <% box_decorator = edit_mode ? self : BoxesHelper::DontMoveBlocks %> |
3 | 3 | ||
4 | +<%= block_title(block.title) %> | ||
4 | 5 | ||
5 | <div class="box" id="box-<%= block.container_box.id %>"> | 6 | <div class="box" id="box-<%= block.container_box.id %>"> |
6 | <%= display_box_content(block.container_box, nil) %> | 7 | <%= display_box_content(block.container_box, nil) %> |