From 89298476285cced8576bc8b986145786c11b7e2a Mon Sep 17 00:00:00 2001 From: f Date: Mon, 29 Apr 2024 11:22:23 -0300 Subject: [PATCH] feat: contenido de texto plano #16174 --- app/models/metadata_plain_text.rb | 3 +++ app/views/posts/attribute_ro/_plain_text.haml | 3 +++ app/views/posts/attributes/_plain_text.haml | 8 ++++++++ 3 files changed, 14 insertions(+) create mode 100644 app/models/metadata_plain_text.rb create mode 100644 app/views/posts/attribute_ro/_plain_text.haml create mode 100644 app/views/posts/attributes/_plain_text.haml diff --git a/app/models/metadata_plain_text.rb b/app/models/metadata_plain_text.rb new file mode 100644 index 00000000..e12ee18b --- /dev/null +++ b/app/models/metadata_plain_text.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +class MetadataPlainText < MetadataContent; end diff --git a/app/views/posts/attribute_ro/_plain_text.haml b/app/views/posts/attribute_ro/_plain_text.haml new file mode 100644 index 00000000..e6d9a274 --- /dev/null +++ b/app/views/posts/attribute_ro/_plain_text.haml @@ -0,0 +1,3 @@ +%tr{ id: attribute } + %th= post_label_t(attribute, post: post) + %td{ lang: locale, dir: dir }= metadata.value diff --git a/app/views/posts/attributes/_plain_text.haml b/app/views/posts/attributes/_plain_text.haml new file mode 100644 index 00000000..3f9ae91d --- /dev/null +++ b/app/views/posts/attributes/_plain_text.haml @@ -0,0 +1,8 @@ +.form-group + = label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post) + = render 'posts/attribute_feedback', + post: post, attribute: attribute, metadata: metadata + + = text_area_tag "#{base}[#{attribute}]", metadata.to_s.html_safe, + dir: dir, lang: locale, + **field_options(attribute, metadata)