diff --git a/app/assets/images/communication/blocks/templates/testimonials/carousel.png b/app/assets/images/communication/blocks/templates/testimonials/carousel.png new file mode 100644 index 000000000..a2fd267e8 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/testimonials/carousel.png differ diff --git a/app/assets/images/communication/blocks/templates/testimonials/grid.png b/app/assets/images/communication/blocks/templates/testimonials/grid.png new file mode 100644 index 000000000..e38266c8b Binary files /dev/null and b/app/assets/images/communication/blocks/templates/testimonials/grid.png differ diff --git a/app/assets/images/communication/blocks/templates/testimonials/large.png b/app/assets/images/communication/blocks/templates/testimonials/large.png new file mode 100644 index 000000000..9864d505e Binary files /dev/null and b/app/assets/images/communication/blocks/templates/testimonials/large.png differ diff --git a/app/assets/images/communication/blocks/templates/testimonials/list.png b/app/assets/images/communication/blocks/templates/testimonials/list.png new file mode 100644 index 000000000..88a49fcb3 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/testimonials/list.png differ diff --git a/app/models/communication/block/template/testimonial.rb b/app/models/communication/block/template/testimonial.rb index 3e67a58fe..f164452c8 100644 --- a/app/models/communication/block/template/testimonial.rb +++ b/app/models/communication/block/template/testimonial.rb @@ -1,6 +1,12 @@ class Communication::Block::Template::Testimonial < Communication::Block::Template::Base has_elements + has_layouts [ + :carousel, + :grid, + :list, + :large + ] def allowed_for_about? !about.respond_to?(:extranet) diff --git a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb index c77986f54..0937bb9d0 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_edit.html.erb @@ -41,3 +41,8 @@ + +<%= osuny_separator %> +<%= osuny_small_panel t('admin.communication.blocks.components.layouts.label') do %> + <%= block_component_edit block, :layout %> +<% end %> diff --git a/app/views/admin/communication/blocks/templates/testimonials/_static.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_static.html.erb index 5a18d69e7..60b86e85a 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_static.html.erb @@ -1,3 +1,4 @@ +<%= block_component_static block, :layout %> testimonials: <% block.template.elements.each do |element| %> <%= block_component_static block, :text, template: element, depth: 4, list: true %> diff --git a/config/locales/communication/blocks/en.yml b/config/locales/communication/blocks/en.yml index 175908574..711c3822d 100644 --- a/config/locales/communication/blocks/en.yml +++ b/config/locales/communication/blocks/en.yml @@ -113,7 +113,6 @@ en: large: description: Each event is presented in majesty, across the full width available, with a large image. label: Large - more: Show more list: description: A list of events with dates, small images, all the same width. label: List @@ -792,6 +791,19 @@ en: label: Text placeholder: Enter testimonial's text remove_testimonial: Remove testimonial + layouts: + carousel: + description: Testimonials are large, with an automatic animation. + label: Carousel + grid: + description: Testimonials are shown as a grid, all the same width. + label: Grid + large: + description: Testimonials are as large as possible, using all screen width. + label: Large + list: + description: Testimonials are displayed one above the other, somewhat like a table. + label: List timeline: description: A list of events with their description, on a timeline. edit: diff --git a/config/locales/communication/blocks/fr.yml b/config/locales/communication/blocks/fr.yml index 224c2ad5f..7e4836970 100644 --- a/config/locales/communication/blocks/fr.yml +++ b/config/locales/communication/blocks/fr.yml @@ -792,6 +792,19 @@ fr: label: Texte placeholder: Entrer le texte du témoignage remove_testimonial: Enlever le témoignage + layouts: + carousel: + description: Les témoignages sont présentés en grand, avec un système de défilement automatique. + label: Carrousel + grid: + description: Les témoignages sont présentés en grille, tous de la même largeur. + label: Grille + large: + description: Les témoignages sont présentés en grand, sur toute la largeur disponible. + label: Grand + list: + description: Les témoignages sont présentés les uns après les autres, en une sorte de tableau. + label: Liste timeline: description: Une liste d'événements avec leur description, présentés en frise. edit: