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

Fix

parent 2c76a66a
No related branches found
No related tags found
No related merge requests found
......@@ -16,12 +16,12 @@ class Communication::Block::Template::Page < Communication::Block::Template
@main_page ||= page(data['page_id'])
end
def show_descriptions
data['show_descriptions'] || false
def show_description
data['show_description'] || false
end
def show_images
data['show_images'] || false
def show_image
data['show_image'] || false
end
protected
......
......@@ -31,20 +31,20 @@
<div class="form-check">
<input v-model="data.show_description"
class="form-check-input boolean optional"
id="show_descriptions"
id="show_description"
type="checkbox">
<label class="form-check-label boolean optional"
for="show_descriptions">
for="show_description">
Afficher les descriptions courtes des pages
</label>
</div>
<div class="form-check">
<input v-model="data.show_image"
class="form-check-input boolean optional"
id="show_images"
id="show_image"
type="checkbox">
<label class="form-check-label boolean optional"
for="show_images">
for="show_image">
Afficher les images des pages
</label>
</div>
......
......@@ -8,11 +8,11 @@
<h3 class="card-title h5"><%= element %></h3>
</div>
<div class="card-body">
<% if @block.template.show_images && element.page.featured_image.attached? %>
<% if @block.template.show_image && element.page.featured_image.attached? %>
<%= kamifusen_tag element.featured_image,
class: 'img-fluid mb-3' %>
<% end %>
<% if @block.template.show_descriptions %>
<% if @block.template.show_description %>
<p><%= element.page.description_short %></p>
<% end %>
</div>
......
<% if block.template.main_page %>
page: <%= block.template.main_page.generated_path %>
<% end %>
show_descriptions: <%= block.template.show_descriptions %>
show_images: <%= block.template.show_images %>
show_descriptions: <%= block.template.show_description %>
show_images: <%= block.template.show_image %>
pages:
<% block.template.selected_pages.each do |element| %>
- slug: <%= element.generated_path %>
show_description: <%= block.template.show_descriptions %>
show_image: <%= block.template.show_images %>
show_description: <%= block.template.show_description %>
show_image: <%= block.template.show_image %>
<% end %>
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