Skip to content
Snippets Groups Projects
Commit 1aedc0a6 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

edit

parent 5957d474
No related branches found
No related tags found
No related merge requests found
app/assets/images/communication/blocks/templates/features.jpg

122 KiB

......@@ -38,12 +38,19 @@ class Communication::Block < ApplicationRecord
# template_blobs would be a better name, because there are files
has_many_attached :template_images
# Les numéros sont un peu en vrac
# Dans l'idée, pour le futur
# 1000 basic
# 2000 storytelling
# 3000 references
# 4000 utilities
enum template_kind: {
chapter: 50,
image: 51,
gallery: 300,
video: 52,
key_figures: 56,
features: 2010,
datatable: 54,
files: 55,
embed: 53,
......@@ -61,7 +68,7 @@ class Communication::Block < ApplicationRecord
CATEGORIES = {
basic: [:chapter, :image, :video, :datatable],
storytelling: [:key_figures, :gallery, :call_to_action, :testimonials, :timeline],
storytelling: [:key_figures, :features, :gallery, :call_to_action, :testimonials, :timeline],
references: [:pages, :posts, :organization_chart, :partners, :programs],
utilities: [:files, :definitions, :embed, :contact]
}
......
class Communication::Block::Template::Feature < Communication::Block::Template::Base
has_elements
has_component :description, :rich_text
end
class Communication::Block::Template::Feature::Element < Communication::Block::Template::Base
has_component :image, :image
has_component :title, :string
has_component :description, :text
end
<div class="row pure__row--small">
<div class="col-xl-6">
<%= block_component_edit :description %>
</div>
</div>
<draggable :list="data.elements" handle=".dragHandle" class="mb-3 row <%= if_appstack 'list-group' %>">
<div v-for="(element, index) in data.elements" class="col-lg-4 draggable-item <%= if_appstack 'list-group-item' %>">
<div>
<a class="btn ps-0 pt-0 dragHandle">
<i class="<%= Icon::DRAG %> handle"></i>
</a>
<a class="btn btn-sm text-danger float-end pe-0"
v-on:click="data.elements.splice(data.elements.indexOf(element), 1)"
title="<%= t '.remove_element' %>">
<i class="<%= Icon::DELETE %>"></i>
</a>
</div>
<div>
<%= block_component_edit :image, template: @element %>
<%= block_component_edit :title, template: @element %>
<%= block_component_edit :description, template: @element %>
</div>
<div>
</div>
</div>
</draggable>
<%= block_component_add_element t('.add_element') %>
<%= block_component_static :description %>
elements:
<% block.template.elements.each do |element| %>
<%= block_component_static :title, template: element, list: true, depth: 4 %>
<%= block_component_static :description, template: element, depth: 5 %>
<%= block_component_static :image, template: element, depth: 5 %>
<% end %>
......@@ -363,6 +363,21 @@ en:
label: Iframe title (mandatory for accessibility)
placeholder: Enter the title
warning: Beware, the code below is used as is, without any security filtering. Be extremely careful and never integrate possibly unreliable code.
features:
description: A list of features with images (often icons) and a description.
edit:
add_element: Add feature
remove_element: Remove feature
element:
image:
label: Image (.png, .jpg, .svg)
remove: Remove image
title:
label: Title
placeholder: Enter title here
description:
label: Text
placeholder: Enter text here
files:
description: A list of downloadable files, mentioning their file size.
edit:
......@@ -703,6 +718,7 @@ en:
datatable: Table
definitions: Definitions
embed: HTML embed
features: Features
files: Files
gallery: Gallery
image: Image
......
......@@ -363,6 +363,21 @@ fr:
label: Titre de l'iframe (nécessaire pour l'accessibilité)
placeholder: Entrer le titre
warning: Attention, le code ci-dessous est intégré tel quel, sans filtrage de sécurité. N'intégrez jamais de code externe dont la fiabilité n'est pas certaine.
features:
description: Une liste de fonctionnalités avec des images, par exemple des icônes, et une description.
edit:
add_element: Ajouter une fonctionnalité
remove_element: Supprimer la fonctionnalité
element:
image:
label: Image (.png, .jpg, .svg)
remove: Enlever l'image
title:
label: Titre
placeholder: Entrer le titre de la fonctionnalité
description:
label: Texte
placeholder: Entrer la description de la fonctionnalité
files:
description: Une liste de fichiers téléchargeables, présentés avec leur poids.
edit:
......@@ -703,6 +718,7 @@ fr:
datatable: Tableau
definitions: Définitions
embed: Intégration HTML
features: Fonctionnalités
files: Fichiers
gallery: Galerie
image: Image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment