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) %>
<% block.blog.total_number_of_posts(:by_year).each do |year, count| %>
diff --git a/app/views/blocks/categories.html.erb b/app/views/blocks/categories.html.erb
index e4c7e34..332fab0 100644
--- a/app/views/blocks/categories.html.erb
+++ b/app/views/blocks/categories.html.erb
@@ -1,3 +1,3 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%= display_category_menu block, block.selected_categories %>
diff --git a/app/views/blocks/featured_products.html.erb b/app/views/blocks/featured_products.html.erb
index 1a246a2..8669d93 100644
--- a/app/views/blocks/featured_products.html.erb
+++ b/app/views/blocks/featured_products.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<% unless block.products.blank? %>
<%= link_to content_tag(:span, _('Previous')), '#', :class => 'featured-product-prev featured-product-arrow' %>
diff --git a/app/views/blocks/feed_reader.html.erb b/app/views/blocks/feed_reader.html.erb
index 0712f76..bb4bd87 100644
--- a/app/views/blocks/feed_reader.html.erb
+++ b/app/views/blocks/feed_reader.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%=
if block.error_message.blank?
diff --git a/app/views/blocks/highlights.html.erb b/app/views/blocks/highlights.html.erb
index a26024e..ab534ef 100644
--- a/app/views/blocks/highlights.html.erb
+++ b/app/views/blocks/highlights.html.erb
@@ -1,4 +1,5 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
+
<% if !block.featured_images.empty? %>
diff --git a/app/views/blocks/link_list.html.erb b/app/views/blocks/link_list.html.erb
index 5c7dc29..8e1eedf 100644
--- a/app/views/blocks/link_list.html.erb
+++ b/app/views/blocks/link_list.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%= block.links.empty? && block.title.empty? ? content_tag('em', _('Please, edit this block to add links')) : '' %>
diff --git a/app/views/blocks/location.html.erb b/app/views/blocks/location.html.erb
index 35774b1..0dbbe47 100644
--- a/app/views/blocks/location.html.erb
+++ b/app/views/blocks/location.html.erb
@@ -1,5 +1,5 @@
<% if block.owner.lat %>
- <%= block_title block.title %>
+ <%= block_title(block.title, block.subtitle) %>
diff --git a/app/views/blocks/my_network.html.erb b/app/views/blocks/my_network.html.erb
index 884ea7d..5d0a6bb 100644
--- a/app/views/blocks/my_network.html.erb
+++ b/app/views/blocks/my_network.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
- <%= link_to(_('Homepage'), block.owner.url, :class => 'url') %>
diff --git a/app/views/blocks/products.html.erb b/app/views/blocks/products.html.erb
index a65dfbf..0cf0d9a 100644
--- a/app/views/blocks/products.html.erb
+++ b/app/views/blocks/products.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<% block.products.each do |product| %>
diff --git a/app/views/blocks/profile_list.html.erb b/app/views/blocks/profile_list.html.erb
index 8edcdaa..a09dec8 100644
--- a/app/views/blocks/profile_list.html.erb
+++ b/app/views/blocks/profile_list.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.view_title) %>
+<%= block_title(block.view_title, block.subtitle) %>
<%
list = block.profile_list.map do |item|
diff --git a/app/views/blocks/profile_search.html.erb b/app/views/blocks/profile_search.html.erb
index 9da842c..a7d4ed3 100644
--- a/app/views/blocks/profile_search.html.erb
+++ b/app/views/blocks/profile_search.html.erb
@@ -1,3 +1,3 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%= render :partial => 'shared/profile_search_form' %>
diff --git a/app/views/blocks/raw_html.html.erb b/app/views/blocks/raw_html.html.erb
index 87c19cd..640d7ae 100644
--- a/app/views/blocks/raw_html.html.erb
+++ b/app/views/blocks/raw_html.html.erb
@@ -1,3 +1,3 @@
-<%=h block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%=h block.html %>
diff --git a/app/views/blocks/recent_documents.html.erb b/app/views/blocks/recent_documents.html.erb
index e45a555..83bb9c8 100644
--- a/app/views/blocks/recent_documents.html.erb
+++ b/app/views/blocks/recent_documents.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<% block.docs.map do |item| %>
diff --git a/app/views/blocks/slideshow.html.erb b/app/views/blocks/slideshow.html.erb
index 7742801..173becb 100644
--- a/app/views/blocks/slideshow.html.erb
+++ b/app/views/blocks/slideshow.html.erb
@@ -7,7 +7,7 @@
end
%>
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<% if images %>
<% description = images.any? { |img| !img.abstract.blank? } %>
diff --git a/app/views/blocks/tags.html.erb b/app/views/blocks/tags.html.erb
index db30dfd..c85135e 100644
--- a/app/views/blocks/tags.html.erb
+++ b/app/views/blocks/tags.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%
is_env = block.owner.class == Environment
diff --git a/app/views/box_organizer/edit.html.erb b/app/views/box_organizer/edit.html.erb
index 031946b..ed27448 100644
--- a/app/views/box_organizer/edit.html.erb
+++ b/app/views/box_organizer/edit.html.erb
@@ -4,6 +4,7 @@
<%= form_tag(:action => 'save', :id => @block.id) do %>
<%= labelled_form_field(_('Custom title for this block: '), text_field(:block, :title, :maxlength => 20)) %>
+ <%= labelled_form_field(_('Custom subtitle for this block: '), text_field(:block, :subtitle)) %>
<%= render :partial => partial_for_class(@block.class) %>
diff --git a/db/migrate/20160127141855_add_subtitle_to_blocks.rb b/db/migrate/20160127141855_add_subtitle_to_blocks.rb
new file mode 100644
index 0000000..95dde1f
--- /dev/null
+++ b/db/migrate/20160127141855_add_subtitle_to_blocks.rb
@@ -0,0 +1,8 @@
+class AddSubtitleToBlocks < ActiveRecord::Migration
+ def up
+ add_column :blocks, :subtitle, :string, :default => ""
+ end
+ def down
+ remove_column :blocks, :subtitle
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 7de0ff2..c67df27 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -206,6 +206,7 @@ ActiveRecord::Schema.define(version: 20160324132518) do
t.boolean "mirror", default: false
t.integer "mirror_block_id"
t.integer "observers_id"
+ t.string "subtitle", default: ""
end
add_index "blocks", ["box_id"], name: "index_blocks_on_box_id", using: :btree
diff --git a/plugins/community_track/views/blocks/track_list.html.erb b/plugins/community_track/views/blocks/track_list.html.erb
index 713b1dd..3b19157 100644
--- a/plugins/community_track/views/blocks/track_list.html.erb
+++ b/plugins/community_track/views/blocks/track_list.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%= render :partial => "blocks/#{block.track_partial}", :collection => block.tracks, :locals => {:block => block} %>
diff --git a/plugins/container_block/views/blocks/container.html.erb b/plugins/container_block/views/blocks/container.html.erb
index 3fe6846..ef865a6 100644
--- a/plugins/container_block/views/blocks/container.html.erb
+++ b/plugins/container_block/views/blocks/container.html.erb
@@ -1,7 +1,7 @@
<% edit_mode = controller.send(:boxes_editor?) && controller.send(:uses_design_blocks?) %>
<% box_decorator = edit_mode ? self : BoxesHelper::DontMoveBlocks %>
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>
<%= display_box_content(block.container_box, nil) %>
diff --git a/plugins/context_content/views/blocks/context_content.html.erb b/plugins/context_content/views/blocks/context_content.html.erb
index c15a36e..5d36c8c 100644
--- a/plugins/context_content/views/blocks/context_content.html.erb
+++ b/plugins/context_content/views/blocks/context_content.html.erb
@@ -1,7 +1,7 @@
<% if block.use_parent_title %>
- <%= block_title(parent_title) %>
+ <%= block_title(parent_title, block.subtitle) %>
<% else %>
- <%= block_title(block.title) %>
+ <%= block_title(block.title, block.subtitle) %>
<% end %>
@@ -18,4 +18,4 @@
<% end %>
-
\ No newline at end of file
+
diff --git a/plugins/display_content/lib/display_content_block.rb b/plugins/display_content/lib/display_content_block.rb
index 8fcf1b5..c33bbc0 100644
--- a/plugins/display_content/lib/display_content_block.rb
+++ b/plugins/display_content/lib/display_content_block.rb
@@ -139,7 +139,7 @@ class DisplayContentBlock < Block
end
proc do
- block.block_title(block.title) +
+ block.block_title(block.title, block.subtitle) +
content_tag('ul', docs.map {|item|
if !item.folder? && item.class != RssFeed
content_sections = ''
diff --git a/plugins/event/views/blocks/event.html.erb b/plugins/event/views/blocks/event.html.erb
index faa5b20..5824f49 100644
--- a/plugins/event/views/blocks/event.html.erb
+++ b/plugins/event/views/blocks/event.html.erb
@@ -1,4 +1,4 @@
-<%= block_title(block.title) %>
+<%= block_title(block.title, block.subtitle) %>