From a7791635aa98f012d35f97c3c5288494bbb28e38 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 13 Mar 2024 18:03:43 +0100 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- app/views/comments/_comment.html.erb | 42 ++++++++++++++++++++++++++++++++++++ app/views/comments/_list.html.erb | 30 ++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 app/views/comments/_comment.html.erb create mode 100644 app/views/comments/_list.html.erb (limited to 'app/views/comments') diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb new file mode 100644 index 0000000..8c0975e --- /dev/null +++ b/app/views/comments/_comment.html.erb @@ -0,0 +1,42 @@ +
+
+
+ <% if defined?(idx) %> + <%= I18n.t('comments.title') %> #<%= idx + 1 %> + <% else %> + <%= I18n.t('comments.title') %> <%= I18n.t('general.in') %> <%= link_to comment.thing.title, thing_path(comment.thing) %> + <% end %> +
+ +
+ <% if defined?(from) %> + <%= I18n.t('general.edit').capitalize %> + <%= link_to I18n.t('general.delete').capitalize, thing_comment_path(comment.thing, comment, from: from), data: { "turbo-method": :delete }, title: I18n.t('comments.delete-title'), class: 'delete-comment' %> + <% end %> +
+
+ +
+ <%= comment.content %> +
+ + <% if comment.tag_references.any? %> + + <% end %> + + <% if defined?(from) %> + + <% end %> +
diff --git a/app/views/comments/_list.html.erb b/app/views/comments/_list.html.erb new file mode 100644 index 0000000..2396140 --- /dev/null +++ b/app/views/comments/_list.html.erb @@ -0,0 +1,30 @@ +
+
<%= I18n.t('comments.title-plural') %>
+ +
+ <% if thing.comments.any? %> + <% thing.comments.each_with_index do |comment, idx| %> + <%= render comment, from: from, idx: idx %> + <% end %> + <% else %> +

<%= I18n.t('comments.none') %>.

+ <% end %> +
+ +
+ <%= I18n.t('comments.new') %> + + +
+
-- cgit v1.2.3