From 03320bcd10bc25d5d682458b5e6166d412714096 Mon Sep 17 00:00:00 2001 From: Alejandro Rueda Date: Mon, 9 Sep 2024 11:29:13 +0200 Subject: [PATCH] Change components width based on url --- .../alternative_landing/content_blocks/cover_full/show.erb | 2 +- .../alternative_landing/content_blocks/cover_full_cell.rb | 5 +++++ .../alternative_landing/content_blocks/tiles/show.erb | 2 +- .../decidim/alternative_landing/content_blocks/tiles_cell.rb | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/cells/decidim/alternative_landing/content_blocks/cover_full/show.erb b/app/cells/decidim/alternative_landing/content_blocks/cover_full/show.erb index 71d83aa..8e6e8e4 100644 --- a/app/cells/decidim/alternative_landing/content_blocks/cover_full/show.erb +++ b/app/cells/decidim/alternative_landing/content_blocks/cover_full/show.erb @@ -1,4 +1,4 @@ -
+

<%= decidim_sanitize translated_title %> diff --git a/app/cells/decidim/alternative_landing/content_blocks/cover_full_cell.rb b/app/cells/decidim/alternative_landing/content_blocks/cover_full_cell.rb index 4ce8fc3..2f28bee 100644 --- a/app/cells/decidim/alternative_landing/content_blocks/cover_full_cell.rb +++ b/app/cells/decidim/alternative_landing/content_blocks/cover_full_cell.rb @@ -15,6 +15,11 @@ def translated_body def background_image model.images_container.attached_uploader(:background_image).path(variant: :big) end + + def id_type + process_group_url = "processes_groups" + request.url.include?(process_group_url) ? "hero-1" : "" + end end end end diff --git a/app/cells/decidim/alternative_landing/content_blocks/tiles/show.erb b/app/cells/decidim/alternative_landing/content_blocks/tiles/show.erb index 5c5a73a..9311f11 100644 --- a/app/cells/decidim/alternative_landing/content_blocks/tiles/show.erb +++ b/app/cells/decidim/alternative_landing/content_blocks/tiles/show.erb @@ -1,4 +1,4 @@ -
+

<%= decidim_sanitize translated_title %> diff --git a/app/cells/decidim/alternative_landing/content_blocks/tiles_cell.rb b/app/cells/decidim/alternative_landing/content_blocks/tiles_cell.rb index 188f426..00c812e 100644 --- a/app/cells/decidim/alternative_landing/content_blocks/tiles_cell.rb +++ b/app/cells/decidim/alternative_landing/content_blocks/tiles_cell.rb @@ -25,6 +25,11 @@ def translated_url(item_number) def background_image(item_number) model.images_container.attached_uploader("background_image_#{item_number}".to_sym).path(variant: :landscape) end + + def id_type + process_group_url = "processes_groups" + request.url.include?(process_group_url) ? "hero-1" : "" + end end end end