5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 07:06:23 +00:00

fixup! feat: desde el modal, tener interfaz para agregar un artículo nuevo

This commit is contained in:
f 2024-05-18 18:49:16 -03:00
parent 8cafe32ce7
commit 4f08a0e5f2
No known key found for this signature in database
3 changed files with 9 additions and 5 deletions

View file

@ -26,6 +26,13 @@ class MetadataRelatedPosts < MetadataArray
posts.where(uuid: value).map(&:title).map(&:value) posts.where(uuid: value).map(&:title).map(&:value)
end end
# Encuentra el filtro
#
# @return [Hash]
def filter
layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {}
end
private private
# Obtiene todos los posts y opcionalmente los filtra # Obtiene todos los posts y opcionalmente los filtra
@ -37,11 +44,6 @@ class MetadataRelatedPosts < MetadataArray
"#{post&.title&.value || post&.slug&.value} #{post&.date&.value.strftime('%F')} (#{post.layout.humanized_name})" "#{post&.title&.value || post&.slug&.value} #{post&.date&.value.strftime('%F')} (#{post.layout.humanized_name})"
end end
# Encuentra el filtro
def filter
layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {}
end
def sanitize(uuid) def sanitize(uuid)
super(uuid.map do |u| super(uuid.map do |u|
u.to_s.gsub(/[^a-f0-9\-]/i, '') u.to_s.gsub(/[^a-f0-9\-]/i, '')

View file

@ -729,6 +729,7 @@ en:
filter: "Start typing to filter..." filter: "Start typing to filter..."
accept: "Accept" accept: "Accept"
cancel: "Cancel" cancel: "Cancel"
add: "Add %{layout}"
new_predefined_array: new_predefined_array:
edit: "Edit" edit: "Edit"
filter: "Start typing to filter..." filter: "Start typing to filter..."

View file

@ -737,6 +737,7 @@ es:
filter: "Empezá a escribir para filtrar..." filter: "Empezá a escribir para filtrar..."
accept: "Aceptar" accept: "Aceptar"
cancel: "Cancelar" cancel: "Cancelar"
add: "Agregar %{layout}"
new_predefined_array: new_predefined_array:
edit: "Editar" edit: "Editar"
filter: "Empezá a escribir para filtrar..." filter: "Empezá a escribir para filtrar..."