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

Merge branch 'main' into fix-security-v2

parents febd947f 919138b7
No related branches found
No related tags found
No related merge requests found
Showing
with 101 additions and 59 deletions
......@@ -8,8 +8,17 @@ class Communication::Block::Template::Agenda < Communication::Block::Template::B
]
has_elements
has_layouts [:grid, :list, :large]
has_component :mode, :option, options: [:all, :category, :selection]
has_layouts [
:grid,
:list,
:large
]
has_component :mode, :option, options: [
:all,
:category,
:selection,
:categories
]
has_component :category_id, :category
has_component :description, :rich_text
has_component :quantity, :number, options: 3
......@@ -62,4 +71,8 @@ class Communication::Block::Template::Agenda < Communication::Block::Template::B
}.compact
end
def selected_events_categories
[]
end
end
......@@ -8,7 +8,12 @@ class Communication::Block::Template::Post < Communication::Block::Template::Bas
:alternate,
:large
]
has_component :mode, :option, options: [:all, :category, :selection]
has_component :mode, :option, options: [
:all,
:category,
:selection,
:categories
]
has_component :posts_quantity, :number, options: 3
has_component :category_id, :category
......@@ -61,6 +66,10 @@ class Communication::Block::Template::Post < Communication::Block::Template::Bas
}.compact
end
def selected_posts_categories
[]
end
def post(id)
return if id.blank?
block.about&.website
......
<%= indentation %><%= property %>: <%= value %>
<%= indentation %><%= property %>: <%= value %>
\ No newline at end of file
<%= block_component_edit block, :layout %>
<div class="row pure__row--small">
<div class="col-xl-6 mb-5">
<div class="col-xl-6">
<%= block_component_edit block, :description %>
</div>
<div class="col-xl-6 mb-5">
<%= osuny_label t('admin.communication.blocks.templates.agenda.edit.show.label') %>
<%= block_component_edit block, :show_summary %>
<%= block_component_edit block, :show_category %>
<%= block_component_edit block, :show_status %>
</div>
</div>
<div class="row pure__row--small">
<div class="col-xl-6 mb-5">
<div class="col-xl-6 mb-3">
<%= block_component_edit block, :mode %>
<div v-show="data.mode != 'selection'">
</div>
<div class="col-xl-6 mb-3" v-show="data.mode != 'selection' && data.mode != 'categories'">
<%= block_component_edit block, :time %>
</div>
</div>
<div v-if="data.mode !== 'categories'">
<div class="mb-3">
<%= block_component_edit block, :layout %>
</div>
<div class="row pure__row--small">
<div class="col-xl-6 mb-3" v-show="data.mode != 'selection'">
<%= block_component_edit block, :quantity %>
</div>
<div v-if="data.mode === 'category'">
<div class="col-xl-6 mb-3" v-show="data.mode === 'category'">
<%= block_component_edit block, :category_id %>
</div>
</div>
<div class="col-xl-6 mb-5">
<div v-if="data.mode != 'selection'">
<%= block_component_edit block, :time %>
</div>
</div>
</div>
<div v-show="data.mode === 'selection'">
<%= block_component_add_element block, t('.add_event') %>
<draggable :list="data.elements" handle=".dragHandle" class="<%= if_appstack 'list-group' %>">
<div v-for="(element, index) in data.elements" class="draggable-item <%= if_appstack 'list-group-item' %>">
<div class="d-flex mb-n3">
<div>
<a class="btn ps-0 pt-0 dragHandle" title="Drag and drop">
<i class="<%= Icon::DRAG %> handle"></i>
</a>
</div>
<div class="flex-fill">
<%= block_component_edit block, :id, template: @element %>
</div>
<div>
<a class="btn btn-sm text-danger ms-3"
v-on:click="data.elements.splice(data.elements.indexOf(element), 1)"
title="Supprimer">
<i class="<%= Icon::DELETE %>"></i>
</a>
<div class="mb-3" v-show="data.mode === 'selection'">
<%= block_component_add_element block, t('.add_event') %>
<draggable :list="data.elements" handle=".dragHandle" class="<%= if_appstack 'list-group' %>">
<div v-for="(element, index) in data.elements" class="draggable-item <%= if_appstack 'list-group-item' %>">
<div class="d-flex mb-n3">
<div>
<a class="btn ps-0 pt-0 dragHandle" title="Drag and drop">
<i class="<%= Icon::DRAG %> handle"></i>
</a>
</div>
<div class="flex-fill">
<%= block_component_edit block, :id, template: @element %>
</div>
<div>
<a class="btn btn-sm text-danger ms-3"
v-on:click="data.elements.splice(data.elements.indexOf(element), 1)"
title="Supprimer">
<i class="<%= Icon::DELETE %>"></i>
</a>
</div>
</div>
</div>
</draggable>
</div>
<div class="row pure__row--small">
<div class="col-xl-6">
<%= osuny_label t('admin.communication.blocks.templates.agenda.edit.show.label') %>
<%= block_component_edit block, :show_summary %>
<%= block_component_edit block, :show_category %>
<%= block_component_edit block, :show_status %>
</div>
</draggable>
</div>
\ No newline at end of file
</div>
</div>
<p class="mb-0">
<%= block.template.selected_events.first(2).collect(&:to_s).join(', ') %>...
<% if block.template.mode == 'categories' %>
TODO...
<% else %>
<%= block.template.selected_posts.first(2).collect(&:to_s).join(', ') %>...
<% end %>
</p>
\ No newline at end of file
layout: <%= block.template.layout %>
<%= block_component_static block, :mode %>
<%= block_component_static block, :layout %>
<%= block_component_static block, :description %>
mode: <%= block.template.mode %>
<% if block.template.mode == 'category' && block.template.category %>
category: "<%= block.template.category.path %>"
<% end %>
......
<%
cc = Licenses::CreativeCommons.create_from_block(block)
%>
<%= block_component_static block, :type -%>
<%= block_component_static block, :type %>
creative_commons:
attribution: <%= block.template.creative_commons_attribution %>
commercial_use: <%= block.template.creative_commons_commercial_use %>
......
<%= block_component_edit block, :layout %>
<div class="mb-3">
<%= block_component_edit block, :mode %>
<div class="row pure__row--small">
<div v-if="data.mode === 'category' || data.mode === 'all'" class="col-lg-3">
<%= block_component_edit block, :posts_quantity %>
</div>
<div v-if="data.mode === 'category'" class="col-lg-9">
<%= block_component_edit block, :category_id %>
</div>
<%= block_component_edit block, :mode %>
<div v-if="data.mode !== 'categories'">
<%= block_component_edit block, :layout %>
</div>
<div class="row pure__row--small">
<div v-if="data.mode === 'category' || data.mode === 'all'" class="col-lg-3">
<%= block_component_edit block, :posts_quantity %>
</div>
<div v-if="data.mode === 'category'" class="col-lg-9">
<%= block_component_edit block, :category_id %>
</div>
</div>
<div v-if="data.mode === 'selection'">
......
<p class="mb-0">
<%= block.template.selected_posts.first(2).collect(&:to_s).join(', ') %>...
<% if block.template.mode == 'categories' %>
<%= @website.categories.ordered.first(2).collect(&:to_s).join(', ') %>...
<% else %>
<%= block.template.selected_posts.first(2).collect(&:to_s).join(', ') %>...
<% end %>
</p>
\ No newline at end of file
<%= block_component_static block, :mode %>
<% if block.template.mode == 'all' %>
all: true
<% elsif block.template.mode == 'category' && block.template.category %>
......
......@@ -82,6 +82,7 @@ en:
all: All events, regardless of category
category: A specific category of events
selection: A selection of events
categories: A list of all events' categories
quantity:
label: Quantity of events to show
placeholder: Enter quantity
......@@ -453,6 +454,7 @@ en:
all: All posts
category: A specific category
selection: A selection of posts
categories: A list of all posts' categories
posts_quantity:
label: Quantity
placeholder: Enter quantity
......
......@@ -82,6 +82,7 @@ fr:
all: Tous les événements, peu importe la catégorie
category: Une catégorie spécifique d'événements
selection: Une sélection d'événements
categories: La liste des catégories d'événements
quantity:
label: Quantité d'événements à afficher
placeholder: Entrer la quantité
......@@ -453,6 +454,7 @@ fr:
all: Toutes les actualités
category: Une catégorie spécifique
selection: Une sélection d'actualités
categories: La liste des catégories d'actualités
posts_quantity:
label: Quantité d'articles
placeholder: Entrer la quantité
......
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