From 62bf58ce6dc48e9a401a76c0798306b2f1e9fdd3 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 17 Oct 2015 00:17:59 +0200 Subject: [PATCH] Added support for block options for the feed aggregator blocks. Updated weight for primary_tabs block. --- .../feed_aggregator/feed_aggregator_module.e | 11 +++++++++- src/service/response/cms_response.e | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/modules/feed_aggregator/feed_aggregator_module.e b/modules/feed_aggregator/feed_aggregator_module.e index a55e955..e0a4aee 100644 --- a/modules/feed_aggregator/feed_aggregator_module.e +++ b/modules/feed_aggregator/feed_aggregator_module.e @@ -230,6 +230,7 @@ feature -- Hook s: READABLE_STRING_8 b: CMS_CONTENT_BLOCK pref: STRING + nb: INTEGER do if attached feed_aggregator_api as l_feed_api then pref := "feed." @@ -238,7 +239,15 @@ feature -- Hook else s := a_block_id end - if attached feed_to_html (s, 0, True, a_response) as l_content then + nb := 0 + if + attached a_response.block_options (a_block_id) as l_options and then + attached {READABLE_STRING_GENERAL} l_options.item ("size") as l_size and then + l_size.is_integer + then + nb := l_size.to_integer + end + if attached feed_to_html (s, nb, True, a_response) as l_content then create b.make (a_block_id, Void, l_content, Void) b.set_is_raw (True) a_response.add_block (b, "feed_" + s) diff --git a/src/service/response/cms_response.e b/src/service/response/cms_response.e index 75e9a21..fbb3156 100644 --- a/src/service/response/cms_response.e +++ b/src/service/response/cms_response.e @@ -786,16 +786,6 @@ feature -- Blocks end end - primary_tabs_block: detachable CMS_MENU_BLOCK - do - if attached primary_tabs as m and then not m.is_empty then - create Result.make (m) - Result.is_horizontal := True - Result.set_is_raw (True) - Result.add_css_class ("tabs") - end - end - top_header_block: CMS_CONTENT_BLOCK local s: STRING @@ -846,7 +836,18 @@ feature -- Blocks if attached message as m and then not m.is_empty then create Result.make ("message", Void, "
" + m + "
", Void) Result.set_is_raw (True) + Result.set_weight (-3) + end + end + + primary_tabs_block: detachable CMS_MENU_BLOCK + do + if attached primary_tabs as m and then not m.is_empty then + create Result.make (m) + Result.is_horizontal := True + Result.set_is_raw (True) Result.set_weight (-2) + Result.add_css_class ("tabs") end end