5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-27 15:56:21 +00:00

Merge branch 'issue-15068' into production.panel.sutty.nl

This commit is contained in:
f 2024-05-23 15:26:27 -03:00
commit 27a4233390
No known key found for this signature in database
7 changed files with 13 additions and 13 deletions

View file

@ -87,7 +87,6 @@ gem 'after_commit_everywhere', '~> 1.0'
gem 'aasm'
gem 'que-web'
gem 'nanoid'
gem 'nice_partials'
# database
gem 'hairtrigger'

View file

@ -389,8 +389,6 @@ GEM
net-protocol
net-ssh (7.2.1)
netaddr (2.0.6)
nice_partials (0.10.0)
actionview (>= 4.2.6)
nio4r (2.7.0-x86_64-linux-musl)
nokogiri (1.16.4-x86_64-linux-musl)
mini_portile2 (~> 2.8.2)
@ -687,7 +685,6 @@ DEPENDENCIES
mobility
nanoid
net-ssh
nice_partials
nokogiri
pg
pg_search

View file

@ -20,11 +20,11 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
end
# Crea los posts anidados
create_nested_posts! post, params[:post]
create_nested_posts! post, params[base]
post.save
update_related_posts
commit(action: :created, add: files)
commit(action: :created, add: files) if post.valid?
update_site_license!
@ -50,14 +50,14 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
def update
post.usuaries << usuarie
params[:post][:draft] = true if site.invitade? usuarie
params[base][:draft] = true if site.invitade? usuarie
# Eliminar ("mover") el archivo si cambió de ubicación.
if post.update(post_params)
rm = []
rm << post.path.value_was if post.path.changed?
create_nested_posts! post, params[:post]
create_nested_posts! post, params[base]
update_related_posts
# Es importante que el artículo se guarde primero y luego los
@ -149,11 +149,11 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
end
def locale
params.dig(:post, :lang)&.to_sym || I18n.locale
params.dig(base, :lang)&.to_sym || I18n.locale
end
def layout
params.dig(:post, :layout) || params[:layout]
params.dig(base, :layout) || params[:layout]
end
# Actualiza los artículos relacionados según los métodos que los

View file

@ -23,6 +23,9 @@
local_assigns[:hide_actions] << 'click->modal#hide'
local_assigns[:modal_content_attributes] ||= {}
-# XXX: Necesario para poder generar todas las demás
= yield
.modal.fade{ tabindex: -1, aria: { hidden: 'true' }, data: { target: 'modal.modal' } }
.modal-backdrop.fade{ data: { target: 'modal.backdrop', action: local_assigns[:hide_actions].join(' ') } }
.modal-dialog.modal-dialog-scrollable.modal-dialog-centered

View file

@ -1,7 +1,7 @@
-#
Genera un listado de checkboxes entre los que se puede elegir para guardar
:ruby
id = "#{base}_#{attribute}"
id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_')
name = "#{base}[#{attribute}][]"
form_id = "form-#{Nanoid.generate}"

View file

@ -8,7 +8,7 @@
del formulario principal porque no se pueden anidar.
:ruby
id = "#{base}_#{attribute}"
id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_')
name = "#{base}[#{attribute}][]"
form_id = "form-#{Nanoid.generate}"
modal_id = "modal-#{Nanoid.generate}"

View file

@ -3,7 +3,8 @@
guardar, pero no se pueden agregar nuevos.
:ruby
id = "#{base}_#{attribute}"
# @todo Convertir en un helper
id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_')
name = "#{base}[#{attribute}][]"
form_id = "form-#{Nanoid.generate}"