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

posts wip

parent c7355660
No related branches found
No related tags found
No related merge requests found
GIT
remote: https://github.com/noesya/summernote-rails.git
revision: d8f1155a64d995228b1949d7ef95b3cff5b00fc3
revision: 9a4e669ae6c4f50f7d08cd6939cdff719d135c9d
branch: activestorage
specs:
summernote-rails (0.8.20.5)
summernote-rails (0.8.20.6)
nokogiri
rails (>= 6.0)
GIT
......@@ -88,7 +89,7 @@ GEM
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
aws-eventstream (1.2.0)
aws-partitions (1.598.0)
aws-partitions (1.599.0)
aws-sdk-core (3.131.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
......
class Communication::Block::Component::Category < Communication::Block::Component::Base
end
......@@ -2,6 +2,7 @@ class Communication::Block::Template::Post < Communication::Block::Template::Bas
has_component :mode, :option, options: [:all, :category, :selection]
has_component :posts_quantity, :number, options: 3
has_component :category, :category
def build_git_dependencies
add_dependency category unless category.nil?
......
<%
categories = collection_tree(@block.about&.website.categories)
%>
<label class="form-label"
for="category_id">Sélectionnez une catégorie</label>
<select id="category_id"
class="form-select select mb-3"
v-model="data.category_id">
<% categories.each_with_index do |category, index| %>
<option value="<%= category[:id] %>"><%= category[:label].html_safe %></option>
<% end %>
</select>
......@@ -3,28 +3,22 @@
<div class="row mb-1">
<div class="col-md-6">
<%= block_component_edit :mode %>
<div v-if="data.mode === 'category' || data.mode === 'all'">
<%= block_component_edit :posts_quantity %>
</div>
<div v-if="data.mode === 'category'" class="mb-3">
<div v-if="data.mode === 'category'">
<%= block_component_edit :category %>
<label class="form-label"
for="category_id">Sélectionnez une catégorie</label>
<select id="category_id"
class="form-select select"
class="form-select select mb-3"
v-model="data.category_id">
<% categories.each_with_index do |category, index| %>
<option value="<%= category[:id] %>"><%= category[:label].html_safe %></option>
<% end %>
</select>
</div>
<div v-if="data.mode === 'category' || data.mode === 'all'">
<label class="form-label"
for="posts_quantity">Choisissez la quantité d'articles à afficher</label>
<input type="number"
placeholder="Quantité"
class="form-control"
id="posts_quantity"
min="0" max="30"
v-model="data.posts_quantity"/>
</div>
</div>
</div>
<div v-if="data.mode === 'selection'">
......
......@@ -336,6 +336,9 @@ fr:
all: Toutes les actualités
category: Une catégorie spécifique
selection: Une sélection d'actualités
posts_quantity:
label: Quantité d'articles à afficher
placeholder: Entrer la quantité
testimonials:
description: Un ou plusieurs témoignages, avec le texte, l'auteur, sa fonction et sa photo.
edit:
......
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