From 4f08a0e5f2e2ac47bbc181392b6569ecf8d98498 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 18 May 2024 18:49:16 -0300 Subject: [PATCH] =?UTF-8?q?fixup!=20feat:=20desde=20el=20modal,=20tener=20?= =?UTF-8?q?interfaz=20para=20agregar=20un=20art=C3=ADculo=20nuevo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/metadata_related_posts.rb | 12 +++++++----- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/metadata_related_posts.rb b/app/models/metadata_related_posts.rb index 42d1381b..2728020e 100644 --- a/app/models/metadata_related_posts.rb +++ b/app/models/metadata_related_posts.rb @@ -26,6 +26,13 @@ class MetadataRelatedPosts < MetadataArray posts.where(uuid: value).map(&:title).map(&:value) end + # Encuentra el filtro + # + # @return [Hash] + def filter + layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {} + end + private # 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})" end - # Encuentra el filtro - def filter - layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {} - end - def sanitize(uuid) super(uuid.map do |u| u.to_s.gsub(/[^a-f0-9\-]/i, '') diff --git a/config/locales/en.yml b/config/locales/en.yml index 6a2eb7d8..ebc7b9c2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -729,6 +729,7 @@ en: filter: "Start typing to filter..." accept: "Accept" cancel: "Cancel" + add: "Add %{layout}" new_predefined_array: edit: "Edit" filter: "Start typing to filter..." diff --git a/config/locales/es.yml b/config/locales/es.yml index 1da0edf9..e56a09e5 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -737,6 +737,7 @@ es: filter: "Empezá a escribir para filtrar..." accept: "Aceptar" cancel: "Cancelar" + add: "Agregar %{layout}" new_predefined_array: edit: "Editar" filter: "Empezá a escribir para filtrar..."