From 1db2c9a169d5150ee15be1d47bb63d364bab45a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= Date: Thu, 9 Oct 2025 17:21:41 +0200 Subject: [PATCH] block features: option icons --- app/models/communication/block/template/feature.rb | 4 +++- .../blocks/templates/features/_edit.html.erb | 10 +++++++--- .../blocks/templates/features/_static.html.erb | 1 + .../blocks/templates/links/_edit.html.erb | 2 +- config/locales/communication/blocks/en.yml | 2 ++ config/locales/communication/blocks/fr.yml | 2 ++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/models/communication/block/template/feature.rb b/app/models/communication/block/template/feature.rb index f7a7887a5..d9a013bf0 100644 --- a/app/models/communication/block/template/feature.rb +++ b/app/models/communication/block/template/feature.rb @@ -3,10 +3,12 @@ class Communication::Block::Template::Feature < Communication::Block::Template:: has_elements has_component :description, :rich_text + has_component :option_icons, :boolean, default: false + def allowed_for_about? !about.respond_to?(:extranet) end - + def children elements end diff --git a/app/views/admin/communication/blocks/templates/features/_edit.html.erb b/app/views/admin/communication/blocks/templates/features/_edit.html.erb index b13c93db8..89bc67e90 100644 --- a/app/views/admin/communication/blocks/templates/features/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/features/_edit.html.erb @@ -2,8 +2,8 @@ <%= osuny_separator %> -
@@ -41,4 +41,8 @@
<%= block_component_add_element block, t('.add_element') %> -
\ No newline at end of file +
+ +<%= osuny_separator %> + +<%= block_component_edit block, :option_icons %> diff --git a/app/views/admin/communication/blocks/templates/features/_static.html.erb b/app/views/admin/communication/blocks/templates/features/_static.html.erb index 265d924f2..b2fb1a611 100644 --- a/app/views/admin/communication/blocks/templates/features/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/features/_static.html.erb @@ -1,4 +1,5 @@ <%= block_component_static block, :description %> +<%= block_options_static block %> elements: <% block.template.elements.each do |element| %> <%= block_component_static block, :title, template: element, list: true, depth: 4 %> diff --git a/app/views/admin/communication/blocks/templates/links/_edit.html.erb b/app/views/admin/communication/blocks/templates/links/_edit.html.erb index 2988ee68b..7deb39fa5 100644 --- a/app/views/admin/communication/blocks/templates/links/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/links/_edit.html.erb @@ -43,4 +43,4 @@ <%= osuny_panel t('admin.communication.blocks.components.layouts.label'), small: true do %> <%= block_component_edit block, :layout %> <%= block_component_edit block, :option_icons %> -<% end %> \ No newline at end of file +<% end %> diff --git a/config/locales/communication/blocks/en.yml b/config/locales/communication/blocks/en.yml index 4a6d789de..169fbe841 100644 --- a/config/locales/communication/blocks/en.yml +++ b/config/locales/communication/blocks/en.yml @@ -352,6 +352,8 @@ en: title: label: Title placeholder: Enter title here + option_icons: + label: Show images as small icons remove_element: Remove feature files: description: A list of downloadable files, mentioning their file size. diff --git a/config/locales/communication/blocks/fr.yml b/config/locales/communication/blocks/fr.yml index f7bdf628d..317589d9d 100644 --- a/config/locales/communication/blocks/fr.yml +++ b/config/locales/communication/blocks/fr.yml @@ -352,6 +352,8 @@ fr: title: label: Titre placeholder: Entrer le titre de la fonctionnalité + option_icons: + label: Afficher les images comme de petites icônes remove_element: Supprimer la fonctionnalité files: description: Une liste de fichiers téléchargeables, présentés avec leur poids.