diff --git a/app/models/communication/block/template/base.rb b/app/models/communication/block/template/base.rb index e2b48458cff7c0eadaddc537c02deaf14ec2813c..f9814ae497009439efb9775213c79ca867027467 100644 --- a/app/models/communication/block/template/base.rb +++ b/app/models/communication/block/template/base.rb @@ -185,6 +185,6 @@ class Communication::Block::Template::Base end def website - block.about&.website + block.about&.try(:website) end end diff --git a/app/models/communication/block/template/organization_chart.rb b/app/models/communication/block/template/organization_chart.rb index 24fd903a2d6a1105180c5a1d14f34efefac72cca..334d745ed2b8280fb9618fd3c97e6a37f4edfbb9 100644 --- a/app/models/communication/block/template/organization_chart.rb +++ b/app/models/communication/block/template/organization_chart.rb @@ -3,5 +3,6 @@ class Communication::Block::Template::OrganizationChart < Communication::Block:: has_elements has_component :description, :rich_text has_component :with_link, :boolean + has_component :with_photo, :boolean end diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb index ca3ff8574000536980a7d23fe2229024507e8765..6f6e48d65f2d8cdad385c0974cf1fae32cfc64a2 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_edit.html.erb @@ -5,6 +5,7 @@ <div class="col-xl-6"> <label class="form-label"> </label> <%= block_component_edit :with_link %> + <%= block_component_edit :with_photo %> </div> </div> diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb index f21033a0ddd164c215adc2850f3f528f94261c48..7f29eb08dd3753d5fc93e5fc33d46b842ec8844b 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_static.html.erb @@ -1,5 +1,6 @@ <%= block_component_static :description %> <%= block_component_static :with_link %> +<%= block_component_static :with_photo %> persons: <% block.template.elements.each do |element| %> <% next unless element.person %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 1d1f2a9ef263f3eb80c6b9fd839a650babdf7553..4715f3fe53e92842188d755e94bfd56a2d1f731b 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -283,6 +283,8 @@ en: label: Description with_link: label: With clickable links to the person's page? + with_photo: + label: With a portrait for each person? element: person: label: Person diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 81ffb0272231bd4c6b2feff5e2e5c410a113bdb8..964ed1199f6693b7fead83cd574d39699b08519c 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -282,7 +282,9 @@ fr: drag_title: Glisser-déposer pour organiser les personnes delete_title: Enlever la personne with_link: - label: Avec des liens cliquables vers les pages des personnes ? + label: Avec des liens cliquables vers les pages des personnes ? + with_photo: + label: Avec un portrait de chaque personne ? description: label: Description element: