Skip to content
Snippets Groups Projects
Commit 28b420b2 authored by alexisben's avatar alexisben
Browse files

block chapter wip

parent e8f3a5b6
No related branches found
No related tags found
No related merge requests found
<% about.blocks.published.ordered.each do |block| %>
<section class="block-<%= block.template_kind %>">
<div class="container">
<div class="block-content">
<div class="top">
<h2><%= block.title %></h2>
</div>
<% @block = block %>
<%= render "admin/communication/blocks/templates/#{@block.template_kind}/preview" %>
</div>
</div>
</section>
<% @block = block %>
<%= render "admin/communication/blocks/templates/#{@block.template_kind}/preview" %>
<% end %>
\ No newline at end of file
......@@ -6,7 +6,7 @@ return unless blob
<figure>
<%= kamifusen_tag blob, width: 600, class: 'img-fluid mb-1', alt: component.template.alt %>
<figcaption>
<%= component.template.text if component.template.try(:text).present? %>
<%= component.template.credit if component.template.try(:credit).present? %>
<%#= sanitize component.template.text if component.template.try(:text).present? %>
<%= sanitize component.template.credit if component.template.try(:credit).present? %>
</figcaption>
</figure>
\ No newline at end of file
<section>
<%
$class = "block block-chapter"
if @block.template.image[:id] #TODO comment vérifier proprement la présence de l'image?
$class += " block-chapter--with-image"
end
$class += " block-chapter--" + @block.template.layout
%>
<section class="<%= $class %>">
<div class="container">
<div class="block-content">
<div class="chapter">
<div class="text">
<% if @block.template.text %>
<% unless @block.title.empty? %>
<div class="top">
<h2><%= @block.title %></h2>
</div>
<% end %>
<% unless @block.template.text.empty? %>
<div class="rich-text">
<%= block_component_preview :text %>
</div>
<% end %>
<% if @block.template.notes %>
<% unless @block.template.notes.empty? %>
<div class="notes">
<%= block_component_preview :notes %>
</div>
......
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