From 1b1d8326d88bdb4434fc5b12f9f9ff85cd3b961d Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sat, 1 Jun 2024 09:05:19 +0300 Subject: [PATCH] Write closed note controls using submit_tag --- app/views/notes/show.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/notes/show.html.erb b/app/views/notes/show.html.erb index a04cbf9d9..17a6651cf 100644 --- a/app/views/notes/show.html.erb +++ b/app/views/notes/show.html.erb @@ -79,10 +79,14 @@
<% if @note.status != "hidden" and current_user and current_user.moderator? -%> - " class="btn btn-light" data-method="DELETE" data-url="<%= api_note_url(@note, "json") %>"> + <%= submit_tag t(".hide"), :name => "hide", :class => "btn btn-light", + :data => { :method => "DELETE", + :url => api_note_url(@note, "json") } %> <% end -%> <% if current_user -%> - " class="btn btn-primary" data-method="POST" data-url="<%= reopen_api_note_url(@note, "json") %>"> + <%= submit_tag t(".reactivate"), :name => "reopen", :class => "btn btn-primary", + :data => { :method => "POST", + :url => reopen_api_note_url(@note, "json") } %> <% end -%>
-- 2.39.5