mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-14 19:58:20 +00:00
Merge branch 'production.panel.sutty.nl' of 0xacab.org:sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
9ba7f2a451
29 changed files with 61 additions and 29 deletions
|
@ -18,6 +18,18 @@ class MetadataFile < MetadataTemplate
|
||||||
# XXX: Esto ayuda a deserializar en {Site#everything_of}
|
# XXX: Esto ayuda a deserializar en {Site#everything_of}
|
||||||
def values; end
|
def values; end
|
||||||
|
|
||||||
|
# Usar la descripción
|
||||||
|
def titleize?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Devolver la descripción
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
|
def to_s
|
||||||
|
value['description'].to_s
|
||||||
|
end
|
||||||
|
|
||||||
def validate
|
def validate
|
||||||
super
|
super
|
||||||
|
|
||||||
|
|
|
@ -7,4 +7,13 @@ class MetadataPredefinedArray < MetadataArray
|
||||||
[v[I18n.locale.to_s], k]
|
[v[I18n.locale.to_s], k]
|
||||||
end&.to_h
|
end&.to_h
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Devolver los valores legibles por humanes
|
||||||
|
#
|
||||||
|
# @todo Debería devolver los valores en el idioma del post, no de le
|
||||||
|
# usuarie
|
||||||
|
# @return [String]
|
||||||
|
def to_s
|
||||||
|
values.invert.select { |x, k| value.include?(x) }.values.join(', ')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,11 @@ class MetadataTitle < MetadataString
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Siempre recalcular el título
|
||||||
|
def value
|
||||||
|
self[:value] = default_value
|
||||||
|
end
|
||||||
|
|
||||||
# Obtener todos los valores de texto del artículo y generar un título
|
# Obtener todos los valores de texto del artículo y generar un título
|
||||||
# en base a eso.
|
# en base a eso.
|
||||||
#
|
#
|
||||||
|
|
|
@ -85,11 +85,13 @@
|
||||||
|
|
||||||
= hidden_field_tag "#{base}[layout]", post.layout.name
|
= hidden_field_tag "#{base}[layout]", post.layout.name
|
||||||
|
|
||||||
-# Dibuja cada atributo
|
-# Dibuja cada atributo, excepto algunos
|
||||||
= render 'posts/attributes', site: site, post: post, dir: dir, base: base, locale: locale, except: except
|
= render 'posts/attributes', site: site, post: post, dir: dir, base: base, locale: locale, except: except
|
||||||
|
|
||||||
-# Enviamos valores vacíos para los atributos ocultos
|
-#
|
||||||
|
Enviamos valores vacíos o arrastrados desde el formulario anterior
|
||||||
|
para los atributos ignorados
|
||||||
- except.each do |attr|
|
- except.each do |attr|
|
||||||
%input{ type: 'hidden', name: "#{base}[#{attr}]", value: "" }
|
%input{ type: 'hidden', name: "#{base}[#{attr}]", value: params[attr].presence }
|
||||||
|
|
||||||
= yield(:post_form)
|
= yield(:post_form)
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
||||||
- if metadata.inverse?
|
- if metadata.inverse?
|
||||||
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
||||||
|
%input{ type: 'hidden', name: metadata.inverse, value: post.uuid.value }
|
||||||
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
||||||
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
||||||
- content_for :"#{post_id}_body" do
|
- content_for :"#{post_id}_body" do
|
||||||
|
|
|
@ -101,6 +101,7 @@
|
||||||
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
||||||
- if metadata.inverse?
|
- if metadata.inverse?
|
||||||
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
||||||
|
%input{ type: 'hidden', name: metadata.inverse, value: post.uuid.value }
|
||||||
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
||||||
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
||||||
- content_for :"#{post_id}_body" do
|
- content_for :"#{post_id}_body" do
|
||||||
|
|
|
@ -99,8 +99,10 @@
|
||||||
%input{ type: 'hidden', name: 'name', value: name }
|
%input{ type: 'hidden', name: 'name', value: name }
|
||||||
%input{ type: 'hidden', name: 'form', value: form_id }
|
%input{ type: 'hidden', name: 'form', value: form_id }
|
||||||
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
%input{ type: 'hidden', name: 'attribute', value: metadata.type }
|
||||||
|
-# @todo Forma genérica de arrastrar valores desde un formulario al siguiente
|
||||||
- if metadata.inverse?
|
- if metadata.inverse?
|
||||||
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
%input{ type: 'hidden', name: 'inverse', value: metadata.inverse }
|
||||||
|
%input{ type: 'hidden', name: metadata.inverse, value: post.uuid.value }
|
||||||
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
%div{ id: post_modal_id, data: { controller: 'modal' } }
|
||||||
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
= render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do
|
||||||
- content_for :"#{post_id}_body" do
|
- content_for :"#{post_id}_body" do
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
= render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' } do
|
= render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' } do
|
||||||
- content_for :"#{id}_body" do
|
- content_for :"#{id}_body" do
|
||||||
-# @todo ocultar el modal después de guardar
|
-# @todo ocultar el modal después de guardar
|
||||||
.placeholder-glow{ 'hx-get': site_posts_form_path(site, layout: layout, base: id, name: name, form: form_id, swap: 'innerHTML', target: target_id, attribute: 'new_has_one', hide: modal_id, uuid: metadata.value, invalid: invalid_id, submitting: submitting_id, saved: saved_id), 'hx-trigger': 'load' }
|
.placeholder-glow{ 'hx-get': site_posts_form_path(site, layout: layout, base: id, name: name, form: form_id, swap: 'innerHTML', target: target_id, attribute: 'new_has_one', hide: modal_id, uuid: metadata.value, invalid: invalid_id, submitting: submitting_id, saved: saved_id, inverse: metadata.inverse, metadata.inverse => post.uuid.value), 'hx-trigger': 'load' }
|
||||||
%span.placeholder.w-100.h-100
|
%span.placeholder.w-100.h-100
|
||||||
|
|
||||||
- content_for :"#{id}_footer" do
|
- content_for :"#{id}_footer" do
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
Para poder cancelar, mantenemos el estado original y desactivamos
|
Para poder cancelar, mantenemos el estado original y desactivamos
|
||||||
o activamos los ítemes según estén incluidos en esa lista o no.
|
o activamos los ítemes según estén incluidos en esa lista o no.
|
||||||
%ul.placeholder-glow{ data: { target: 'array.current' } }
|
%ul.placeholder-glow{ data: { target: 'array.current' } }
|
||||||
- metadata.values.slice(*metadata.value).each_key do |value|
|
- metadata.values.invert.slice(*metadata.value).each_value do |value|
|
||||||
= render 'posts/new_array_value', value: value
|
= render 'posts/new_array_value', value: value
|
||||||
|
|
||||||
= render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' }, hide_actions: ['array#cancel'], keydown_actions: %w[keydown->array#cancelWithEscape] do
|
= render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' }, hide_actions: ['array#cancel'], keydown_actions: %w[keydown->array#cancelWithEscape] do
|
||||||
|
|
BIN
public/assets/.sprockets-manifest-a1cbb907961024fc033716a7d30668dd.json
(Stored with Git LFS)
BIN
public/assets/.sprockets-manifest-a1cbb907961024fc033716a7d30668dd.json
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js.map
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js.map.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-259c401740dfed47822c.js.map.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js.br
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js.gz
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map.br
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map.gz
(Stored with Git LFS)
BIN
public/packs/js/application-ad620667f5fc36fddece.js.map.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/manifest.json
(Stored with Git LFS)
BIN
public/packs/manifest.json
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/manifest.json.br
(Stored with Git LFS)
BIN
public/packs/manifest.json.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/manifest.json.gz
(Stored with Git LFS)
BIN
public/packs/manifest.json.gz
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in a new issue