diff --git a/app/assets/images/communication/blocks/templates/chapter/accent_background.png b/app/assets/images/communication/blocks/templates/chapter/accent_background.png new file mode 100644 index 0000000000000000000000000000000000000000..b1a306e8dc280a8ea9d21b4fb87c538f359f57ff Binary files /dev/null and b/app/assets/images/communication/blocks/templates/chapter/accent_background.png differ diff --git a/app/assets/images/communication/blocks/templates/chapter/alt_background.png b/app/assets/images/communication/blocks/templates/chapter/alt_background.png new file mode 100644 index 0000000000000000000000000000000000000000..df960268bbd908a268404b89c81c4ea003974965 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/chapter/alt_background.png differ diff --git a/app/assets/images/communication/blocks/templates/chapter/no_background.png b/app/assets/images/communication/blocks/templates/chapter/no_background.png new file mode 100644 index 0000000000000000000000000000000000000000..5d86c75741765fb1b46b8a420dd95f4f930b5ef2 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/chapter/no_background.png differ diff --git a/app/models/communication/block/template/chapter.rb b/app/models/communication/block/template/chapter.rb index 11e1f1952aee32de91325ee2097962eeec241119..2c4ee670985b53e5b5d89c9aa8fa4376bb4da243 100644 --- a/app/models/communication/block/template/chapter.rb +++ b/app/models/communication/block/template/chapter.rb @@ -1,5 +1,7 @@ class Communication::Block::Template::Chapter < Communication::Block::Template::Base + has_layouts [:no_background, :alt_background, :accent_background] + has_component :text, :rich_text has_component :notes, :rich_text has_component :image, :image diff --git a/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb b/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb index 1e96e20facc5e0f75ebf28e7550ebb644ec66e05..13cd9af8b9765c5f7007bb63e7a39fe2d8dff3be 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_edit.html.erb @@ -1,3 +1,5 @@ +<%= block_component_edit :layout %> + <div class="row mb-4"> <div class="col-xl-6"> <%= block_component_edit :text %> diff --git a/app/views/admin/communication/blocks/templates/chapter/_static.html.erb b/app/views/admin/communication/blocks/templates/chapter/_static.html.erb index ab05443581df9e90c61e3b2d7f9f701b9f205261..470574b7140f365647ca327b4ed0aa6decf2becc 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_static.html.erb @@ -1,3 +1,4 @@ + layout: <%= block.template.layout %> <%= block_component_static :text %> <%= block_component_static :notes %> <%= block_component_static :image %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 8c279ae64115ac2e13d13e94ee05e1b873b44514..697b92e656a53ac1851770d1e4e8c2dd1aef163f 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -212,6 +212,16 @@ en: placeholder: Enter image's credit here chapter: description: A section of a document, with a title, a text, footnotes and an image. + layouts: + no_background: + label: Simple + description: A title, a text, possibly some notes and and an image. + alt_background: + label: Subtle highlight + description: A chapter on a light background. + accent_background: + label: Strong highlight + description: A chapter on a strong background, like a call to action. edit: image: label: Chapter illustration diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 2e98a1652a5dc2c1e1f253cea1b0d5931db36064..21318bfa680515f0e142684f86c8cf3b6ef0aa53 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -212,6 +212,16 @@ fr: placeholder: Entrer le crédit de l'image ici chapter: description: Une section de document avec un titre, un texte, des notes de bas de page et une image. + layouts: + no_background: + label: Simple + description: Un titre et un texte, éventuellement des notes et une image. + alt_background: + label: Légère mise en avant + description: Un chapitre sur un fond discret, par exemple pour rythmer la page. + accent_background: + label: Forte mise en avant + description: Un chapitre sur un fond très fort, comme un appel à actions. edit: image: label: Image d'illustration