Skip to content
Snippets Groups Projects
Commit 3af69abd authored by alexisben's avatar alexisben
Browse files

Blocks: add description to timeline and fix block page

parent 6cada37a
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ class Communication::Block::Template::Post < Communication::Block::Template
category.posts.ordered.limit(quantity)
end
def selected_posts_free
def selected_posts_selection
elements.map { |element| post(element['id']) }
.compact
end
......
class Communication::Block::Template::Timeline < Communication::Block::Template
def description
"#{data['description']}"
end
def events
@events ||= elements.map { |element| event(element) }
.compact
......
......@@ -59,7 +59,6 @@
<option value="<%= page[:id] %>"><%= page[:label].html_safe %></option>
<% end %>
</select>
</div>
<div class="col-6">
<div class="col-md-6">
......
<label for="description"><%= t '.description_placeholder' %></label>
<textarea class="form-control mb-2"
rows="3"
v-model="data.description"
placeholder="<%= t '.description_placeholder' %>"
id="description"></textarea>
<a class="<%= button_classes('mb-4') %>"
v-on:click="data.elements.push({title: '', text: ''})">
<%= t '.add_event' %>
......
<p><%= @block.template.description %></p>
<div class="row">
<% @block.template.events.each do |event| %>
<div class="col-xxl-4 col-xl-6">
......
description: >-
<%= prepare_text_for_static block.template.description %>
events:
<% block.template.events.each do |event| %>
- title: >-
<%= prepare_text_for_static event.title %>
text: >-
<%= prepare_text_for_static event.text %>
- title: >-
<%= prepare_text_for_static event.title %>
text: >-
<%= prepare_text_for_static event.text %>
<% end %>
......@@ -165,6 +165,8 @@ fr:
remove_testimonial: Enlever le témoignage
timeline:
edit:
description_label: Description
description_placeholder: Entrer la description
add_event: Ajouter un événement
remove_event: Supprimer l'événement
title_label: Titre
......
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