diff --git a/app/assets/images/communication/blocks/templates/posts/grid.png b/app/assets/images/communication/blocks/templates/posts/grid.png new file mode 100644 index 0000000000000000000000000000000000000000..46e962263be19f6856aace92b9d81cc1937d4386 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/posts/grid.png differ diff --git a/app/assets/images/communication/blocks/templates/posts/highlight.png b/app/assets/images/communication/blocks/templates/posts/highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0ee1c2682971d30b72f572b7900d78fa6ed468 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/posts/highlight.png differ diff --git a/app/assets/images/communication/blocks/templates/posts/list.png b/app/assets/images/communication/blocks/templates/posts/list.png new file mode 100644 index 0000000000000000000000000000000000000000..ec0980e11201df63b8d4a786f548fedbb043c326 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/posts/list.png differ diff --git a/app/models/communication/block/template/post.rb b/app/models/communication/block/template/post.rb index 7edaea24edbe29cd8fe8926d632d8a1434440f94..5d95ffd1bd70e04297e6890bc675c49a36f9e7c9 100644 --- a/app/models/communication/block/template/post.rb +++ b/app/models/communication/block/template/post.rb @@ -1,6 +1,7 @@ class Communication::Block::Template::Post < Communication::Block::Template::Base has_elements + has_layouts [:grid, :list, :highlight] has_component :mode, :option, options: [:all, :category, :selection] has_component :posts_quantity, :number, options: 3 has_component :category_id, :category diff --git a/app/views/admin/communication/blocks/templates/posts/_edit.html.erb b/app/views/admin/communication/blocks/templates/posts/_edit.html.erb index 7aefa0c2a20950a81b724bcf211f6e9ebaa36abf..53195f1645d840984941c734d60a7c65b6145f0c 100644 --- a/app/views/admin/communication/blocks/templates/posts/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/posts/_edit.html.erb @@ -1,5 +1,7 @@ <% categories = collection_tree(@block.about&.website.categories) %> +<%= block_component_edit :layout %> + <div class="mb-3"> <%= block_component_edit :mode %> <div class="row"> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 221e45ce0c7aa4ec7b3ecf3736c2f72012a72436..f6742bb36ecad8c747c211329bfc9ca16a13cf28 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -429,6 +429,16 @@ en: label: With clickable link to each organization's page? posts: description: A list of highlighted news. + layouts: + highlight: + label: Highlighted + description: The first post is big and has an image, the next ones are smaller with no image. + grid: + label: Grid + description: A grid of posts, with all images the same size. + list: + label: List + description: A list of posts with small images the same width. edit: add_post: Add post mode: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index ad81e7ba0ce1620b53005cc9b0f04340ae7111a9..6af324365cf4ca8b92e16c45809c9d22d5c10cb7 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -429,6 +429,16 @@ fr: label: Avec des liens cliquables vers les pages des organisations? posts: description: Une liste d'actualités mises en avant. + layouts: + highlight: + label: Mise en avant + description: Un premier article en grand avec son image, puis plusieurs petits, sans images. + grid: + label: Grille + description: Une grille avec toutes les images à la même taille. + list: + label: Liste + description: Une liste d'articles avec de petites images à la même largeur. edit: add_post: Ajouter un article mode: