Skip to content
Snippets Groups Projects
Unverified Commit 57814412 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

Merge pull request #652 from noesya/feature/definitions-description

definitions description
parents dea00b91 1d027841
No related branches found
No related tags found
No related merge requests found
class Communication::Block::Template::Definition < Communication::Block::Template::Base
has_elements
has_component :description, :rich_text
end
......@@ -29,7 +29,7 @@
</textarea>
<% content_for :action_bar_left do %>
<%= destroy_link @block %>
<%= link_to 'Dependencies',
<%= link_to 'Dependencies',
[:admin, @block],
class: button_classes('btn-light') if current_user.server_admin? %>
<% end %>
......@@ -54,12 +54,8 @@
blobUrlTemplate: "<%= rails_service_blob_url(":signed_id", ":filename").html_safe %>"
},
data: <%= @block.data.to_json.html_safe %>,
<% if @block.template.default_element %>
defaultElement: <%= @block.template
.default_element
.default_data
.to_json
.html_safe %>
<% if @element %>
defaultElement: <%= @element.default_data.to_json.html_safe %>
<% end %>
}
},
......
<% element = @block.template.default_element %>
<div class="row">
<div class="col-xl-6">
<%= block_component_edit :description %>
</div>
</div>
<%= block_component_add_element t('.add_definition') %>
......@@ -15,10 +19,10 @@
<div class="flex-fill">
<div class="row mb-n3">
<div class="col-lg-5">
<%= block_component_edit :title, template: element %>
<%= block_component_edit :title, template: @element %>
</div>
<div class="col-lg-7">
<%= block_component_edit :description, template: element %>
<%= block_component_edit :description, template: @element %>
</div>
</div>
</div>
......
<div class="description">
<%= block_component_preview :description %>
</div>
<div class="definitions">
<% @block.template.elements.each do |element| %>
<details itemscope itemtype="https://schema.org/DefinedTerm">
......
<%= block_component_static :description %>
elements:
<% block.template.elements.each do |element| %>
<%= block_component_static :title, template: element, list: true, depth: 4 %>
......
<% element = @block.template.default_element %>
<%= block_component_add_element t('.add_testimonial') %>
<draggable :list="data.elements" handle=".dragHandle" class="row">
......@@ -13,14 +11,14 @@
<div class="flex-fill">
<div class="row mb-n3">
<div class="col-lg-4">
<%= block_component_edit :text, template: element %>
<%= block_component_edit :text, template: @element %>
</div>
<div class="col-lg-4">
<%= block_component_edit :author, template: element %>
<%= block_component_edit :job, template: element %>
<%= block_component_edit :author, template: @element %>
<%= block_component_edit :job, template: @element %>
</div>
<div class="col-lg-4">
<%= block_component_edit :photo, template: element %>
<%= block_component_edit :photo, template: @element %>
</div>
</div>
</div>
......
......@@ -285,6 +285,8 @@ fr:
edit:
add_definition: Ajouter une définition
remove_definition: Supprimer la définition
description:
label: Description
element:
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