diff --git a/app/helpers/block_helper.rb b/app/helpers/block_helper.rb index f0b2699..6749b74 100644 --- a/app/helpers/block_helper.rb +++ b/app/helpers/block_helper.rb @@ -1,9 +1,15 @@ module BlockHelper - def block_title(title) - tag_class = 'block-title' + def block_title(title, subtitle=nil) + block_header = block_heading title + block_header += block_heading(subtitle, 'h4') if subtitle + content_tag 'div', block_header, :class => 'block-header' + end + + def block_heading(title, heading='h3') + tag_class = 'block-' + (heading == 'h3' ? 'title' : 'subtitle') tag_class += ' empty' if title.empty? - content_tag 'h3', content_tag('span', h(title)), :class => tag_class + content_tag heading, content_tag('span', h(title)), :class => tag_class end def highlights_block_config_image_fields(block, image={}, row_number=nil) diff --git a/app/models/block.rb b/app/models/block.rb index 2fd43d0..f703930 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -1,6 +1,6 @@ class Block < ActiveRecord::Base - attr_accessible :title, :display, :limit, :box_id, :posts_per_page, + attr_accessible :title, :subtitle, :display, :limit, :box_id, :posts_per_page, :visualization_format, :language, :display_user, :box, :edit_modes, :move_modes, :mirror diff --git a/app/views/blocks/article.html.erb b/app/views/blocks/article.html.erb index 1e16825..512aeb3 100644 --- a/app/views/blocks/article.html.erb +++ b/app/views/blocks/article.html.erb @@ -1,4 +1,4 @@ -<%= block_title(block.title) %> +<%= block_title(block.title, block.subtitle) %> <% if block.article %> <%= h(article_to_html(FilePresenter.for(block.article), diff --git a/app/views/blocks/blog_archives.html.erb b/app/views/blocks/blog_archives.html.erb index 552490c..624e27f 100644 --- a/app/views/blocks/blog_archives.html.erb +++ b/app/views/blocks/blog_archives.html.erb @@ -1,5 +1,5 @@ <% if block.blog %> - <%= block_title(block.title) %> + <%= block_title(block.title, block.subtitle) %>