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

Better

parent 74d871c6
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 22 deletions
......@@ -123,8 +123,8 @@ GEM
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
aws-eventstream (1.3.0)
aws-partitions (1.877.0)
aws-sdk-core (3.190.1)
aws-partitions (1.880.0)
aws-sdk-core (3.190.2)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
......@@ -142,7 +142,7 @@ GEM
bcrypt (3.1.20)
bigdecimal (3.1.5)
bindex (0.8.1)
bootsnap (1.17.0)
bootsnap (1.17.1)
msgpack (~> 1.2)
bootstrap (5.3.2)
autoprefixer-rails (>= 9.1.0)
......@@ -152,7 +152,7 @@ GEM
rails (>= 3.1)
breadcrumbs_on_rails (4.1.0)
railties (>= 5.0)
bugsnag (6.26.0)
bugsnag (6.26.1)
concurrent-ruby (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
......@@ -180,7 +180,7 @@ GEM
citeproc (~> 1.0, >= 1.0.9)
csl (~> 2.0)
cocoon (1.2.15)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
countries (5.7.1)
unaccent (~> 0.3)
......@@ -221,7 +221,7 @@ GEM
devise-i18n (1.12.0)
devise (>= 4.9.0)
docile (1.4.0)
domain_name (0.6.20231109)
domain_name (0.6.20240107)
drb (2.2.0)
ruby2_keywords
encryptor (3.0.0)
......@@ -234,10 +234,8 @@ GEM
faceted_search (3.6.2)
font-awesome-sass
rails (>= 5.2.0)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
......@@ -248,11 +246,12 @@ GEM
faraday-gzip (1.0.0)
faraday (>= 1.0)
zlib (~> 2.1)
faraday-http-cache (2.5.0)
faraday-http-cache (2.5.1)
faraday (>= 0.8)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (3.0.2)
faraday-net_http (3.1.0)
net-http
faraday-retry (2.2.0)
faraday (~> 2.0)
fastimage (2.3.0)
......@@ -309,9 +308,9 @@ GEM
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
io-console (0.7.1)
irb (1.11.0)
irb (1.11.1)
rdoc
reline (>= 0.3.8)
reline (>= 0.4.2)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
......@@ -371,14 +370,15 @@ GEM
nokogiri (~> 1.13)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.20.0)
minitest (5.21.1)
msgpack (1.7.2)
multi_xml (0.6.0)
multipart-post (2.3.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
namae (1.1.1)
namae (1.2.0)
racc (~> 1.7)
nesty (1.0.2)
net-http (0.4.1)
uri
......@@ -423,7 +423,7 @@ GEM
time
uri
orm_adapter (0.5.0)
parser (3.3.0.2)
parser (3.3.0.4)
ast (~> 2.4.1)
racc
pexels (0.5.0)
......@@ -490,7 +490,7 @@ GEM
ffi (~> 1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.8.3)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
requests (1.0.2)
......
class Communication::Block::Component::AgendaCategory < Communication::Block::Component::Base
def category
return unless website
website.agenda_categories.find_by(id: data)
end
def dependencies
[category]
end
def translate!
return unless category.present?
@data = category.find_or_translate!(template.language).id
end
end
class Communication::Block::Component::Category < Communication::Block::Component::Base
class Communication::Block::Component::PostCategory < Communication::Block::Component::Base
def category
return unless website
......
......@@ -19,7 +19,7 @@ class Communication::Block::Template::Agenda < Communication::Block::Template::B
:selection,
:categories
]
has_component :category_id, :category
has_component :category_id, :agenda_category
has_component :description, :rich_text
has_component :quantity, :number, options: 3
has_component :time, :option, options: AUTHORIZED_SCOPES
......
......@@ -15,7 +15,7 @@ class Communication::Block::Template::Post < Communication::Block::Template::Bas
:categories
]
has_component :posts_quantity, :number, options: 3
has_component :category_id, :category
has_component :category_id, :post_category
def category
category_id_component.category
......
......@@ -75,7 +75,7 @@ class Communication::Website::Agenda::Event < ApplicationRecord
scope :published, -> { where(published: true) }
scope :draft, -> { where(published: false) }
scope :for_category, -> (category_id) { joins(:categories).where(communication_website_categories: { id: category_id }).distinct }
scope :for_category, -> (category_id) { joins(:categories).where(communication_website_agenda_categories: { id: category_id }).distinct }
def git_path(website)
return unless website.id == communication_website_id && published
......
<% categories = collection(block.about&.website.post_categories.for_language(block.language)) %>
<label class="form-label"
:for="<%= dom_id.html_safe %>">
<%= label %>
</label>
<select :id="<%= dom_id.html_safe %>"
class="form-select select mb-3"
v-model="<%= model %>.<%= property %>">
<% categories.each_with_index do |category, index| %>
<option value="<%= category[:id] %>">
<%= category[:label].html_safe %>
</option>
<% end %>
</select>
<%= component.category.to_s %>
<%= component.category.to_s %>
<%= indentation %><%= '- ' if list %><%= property %>: <%= value %>
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