mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-14 17:38:18 +00:00
Merge branch 'production.panel.sutty.nl' of 0xacab.org:sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
2b24034f38
33 changed files with 68 additions and 41 deletions
|
@ -108,7 +108,7 @@ export default class extends Controller {
|
|||
if (!this.isChecked(itemTarget)) continue;
|
||||
|
||||
this.originalValue.push(itemTarget.dataset.value);
|
||||
this.newArrayValueURL.searchParams.set("value", itemTarget.dataset.value);
|
||||
this.newArrayValueURL.searchParams.set("value", itemTarget.dataset?.humanValue || itemTarget.dataset?.value);
|
||||
|
||||
const placeholder = this.placeholderTarget.content.firstElementChild.cloneNode(true);
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
= render 'posts/new_related_post', post: post
|
||||
= render 'posts/new_related_post', post: post, modal_id: modal_id
|
||||
%input{ type: 'hidden', name: name, value: value }
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
:ruby
|
||||
local_assigns[:modal_id] ||= 'generic_modal'
|
||||
|
||||
image = nil
|
||||
description = nil
|
||||
|
||||
|
@ -6,9 +8,9 @@
|
|||
description = post.post.image.value['description']
|
||||
end
|
||||
|
||||
.col.mb-3.p-1
|
||||
.col.mb-3.p-1{ data: { controller: 'modal' } }
|
||||
= render('bootstrap/card', image: image, description: description, title: post.title, class: 'h-100') do
|
||||
- if post.post.attribute?(:description)
|
||||
%p.card-text= post.post.description.value
|
||||
|
||||
= link_to t('.edit'), edit_site_post_path(post.site, post.path), class: 'btn btn-secondary'
|
||||
= render 'bootstrap/btn', content: t('.edit'), data: { action: 'modal#showAnother', 'modal-show-value': local_assigns[:modal_id] }, id: random_id
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
.form-group.mb-0{ id: "#{id}_body" }
|
||||
-# Eliminamos las tildes para poder buscar independientemente de cómo se escriba.
|
||||
- metadata.values.each do |value|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: value } }
|
||||
= render 'targets/array/item', value: value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: value, checked: metadata.value.include?(value), content: value, data: { action: 'required-checkbox#change', target: 'required-checkbox.checkbox' }
|
||||
|
||||
- content_for :"#{id}_footer" do
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
- content_for :"#{id}_body" do
|
||||
.form-group.mb-0{ id: value_list_id }
|
||||
- metadata.values.each_pair do |value, uuid|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: uuid } }
|
||||
= render 'targets/array/item', value: uuid, 'human-value': value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: uuid, checked: metadata.value.include?(uuid), content: value, type: 'radio'
|
||||
|
||||
-#
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
- content_for :"#{id}_body" do
|
||||
.form-group.mb-0{ id: value_list_id }
|
||||
- metadata.values.each_pair do |value, uuid|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: uuid } }
|
||||
= render 'targets/array/item', value: uuid, 'human-value': value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: uuid, checked: metadata.value.include?(uuid), content: value, data: { action: 'required-checkbox#change', target: 'required-checkbox.checkbox' }
|
||||
|
||||
-#
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
- content_for :"#{id}_body" do
|
||||
.form-group.mb-0{ id: value_list_id }
|
||||
- metadata.values.each_pair do |value, uuid|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: uuid } }
|
||||
= render 'targets/array/item', value: uuid, 'human-value': value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: uuid, checked: metadata.value.include?(uuid), content: value, data: { action: 'required-checkbox#change', target: 'required-checkbox.checkbox' }
|
||||
|
||||
-#
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
.row.no-gutters.placeholder-glow{ id: target_id }
|
||||
-# @todo issue-7537
|
||||
- if !metadata.empty? && (indexed_post = site.indexed_posts.find_by(post_id: metadata.value))
|
||||
= render 'posts/new_has_one', post: indexed_post, name: name, value: metadata.value
|
||||
= render 'posts/new_has_one', post: indexed_post, name: name, value: metadata.value, modal_id: modal_id
|
||||
|
||||
-#
|
||||
El modal se genera por fuera del formulario, para poder enviar los
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
.form-group.mb-0{ id: "#{id}_body" }
|
||||
-# Eliminamos las tildes para poder buscar independientemente de cómo se escriba
|
||||
- metadata.values.each_pair do |value, key|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: key } }
|
||||
= render 'targets/array/item', class: 'mb-2', value: key, 'human-value': value do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: key, checked: metadata.value.include?(key), content: value, data: { action: 'required-checkbox#change', target: 'required-checkbox.checkbox' }
|
||||
|
||||
- content_for :"#{id}_footer" do
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
- content_for :"#{id}_body" do
|
||||
.form-group.mb-0{ id: value_list_id }
|
||||
- metadata.values.each_pair do |value, key|
|
||||
.mb-2{ data: { target: 'array.item', 'searchable-value': value.remove_diacritics.downcase, value: value } }
|
||||
= render 'targets/array/item', value: value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: name, id: random_id, value: key, checked: (metadata.value == key), content: value, type: 'radio'
|
||||
|
||||
- content_for :"#{id}_footer" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- item_id = random_id
|
||||
|
||||
.mb-2{ id: item_id, data: { target: 'array.item', 'searchable-value': @value.remove_diacritics.downcase, value: @value } }
|
||||
= render 'targets/array/item', value: @value, class: 'mb-2', id: item_id do
|
||||
.d-flex.flex-row.flex-wrap
|
||||
.flex-grow-1
|
||||
= render 'bootstrap/custom_checkbox', name: @name, id: random_id, value: @value, checked: true, content: @value
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
.mb-2{ data: { target: 'array.item', 'searchable-value': @value.remove_diacritics.downcase, value: @uuid } }
|
||||
= render 'targets/array/item', value: @uuid, 'human-value': @value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: @name, id: random_id, value: @uuid, checked: true, content: @value, type: 'radio'
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
.mb-2{ data: { target: 'array.item', 'searchable-value': @value.remove_diacritics.downcase, value: @uuid } }
|
||||
= render 'targets/array/item', value: @uuid, 'human-value': @value, class: 'mb-2' do
|
||||
= render 'bootstrap/custom_checkbox', name: @name, id: random_id, value: @uuid, checked: true, content: @value
|
||||
|
|
21
app/views/targets/array/_item.haml
Normal file
21
app/views/targets/array/_item.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
-#
|
||||
Un item de un array.
|
||||
|
||||
Además de los valores por defecto, se pueden pasar otros atributos
|
||||
para el div del ítem.
|
||||
|
||||
@param :value [String] El valor (requerido)
|
||||
@param :human-value [String] El valor legible por humanes (opcional)
|
||||
@param :searchable-value [String] El valor para usar en el filtro (opcional)
|
||||
|
||||
:ruby
|
||||
local_assigns[:'human-value'] ||= value
|
||||
local_assigns[:'searchable-value'] ||= local_assigns[:'human-value'].remove_diacritics.downcase
|
||||
local_assigns.delete(:value)
|
||||
|
||||
data = local_assigns.delete(:data)
|
||||
data ||= {}
|
||||
data[:'human-value'] = local_assigns.delete(:'human-value')
|
||||
data[:'searchable-value'] = local_assigns.delete(:'searchable-value')
|
||||
|
||||
%div{ **local_assigns, data: { target: 'array.item', value: value, **data } }= yield
|
|
@ -718,8 +718,6 @@ en:
|
|||
validation:
|
||||
invalid: "Some fields need attention! Please search for the fields marked as not valid."
|
||||
submitting: "Saving changes, please wait..."
|
||||
new_array:
|
||||
remove: "Remove"
|
||||
attributes:
|
||||
add: Add
|
||||
title:
|
||||
|
@ -969,3 +967,7 @@ en:
|
|||
edit: "Edit"
|
||||
alert:
|
||||
saved: "Changes were saved!"
|
||||
targets:
|
||||
array:
|
||||
item:
|
||||
remove: "Remove"
|
||||
|
|
|
@ -726,8 +726,6 @@ es:
|
|||
validation:
|
||||
invalid: "¡Te falta completar algunos campos! Busca los que estén marcados como no válidos."
|
||||
submitting: "Guardando, por favor espera..."
|
||||
new_array:
|
||||
remove: "Eliminar"
|
||||
attributes:
|
||||
add: Agregar
|
||||
title:
|
||||
|
@ -979,3 +977,7 @@ es:
|
|||
edit: "Editar"
|
||||
alert:
|
||||
saved: "¡Cambios guardados!"
|
||||
targets:
|
||||
array:
|
||||
item:
|
||||
remove: "Eliminar"
|
||||
|
|
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)
BIN
public/packs/js/application-259c401740dfed47822c.js
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.br
(Stored with Git LFS)
BIN
public/packs/js/application-259c401740dfed47822c.js.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.gz
(Stored with Git LFS)
BIN
public/packs/js/application-259c401740dfed47822c.js.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map
(Stored with Git LFS)
BIN
public/packs/js/application-259c401740dfed47822c.js.map
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map.br
(Stored with Git LFS)
BIN
public/packs/js/application-259c401740dfed47822c.js.map.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-259c401740dfed47822c.js.map.gz
(Stored with Git LFS)
BIN
public/packs/js/application-259c401740dfed47822c.js.map.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8f69d0f11e0ca7be2504.js.map.gz
(Stored with Git LFS)
Normal file
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