Fixed cancel button with turbo_frame_tag

This commit is contained in:
2024-09-13 14:37:53 +02:00
parent d294a3f7f0
commit 5ee276e2eb

View File

@@ -2,7 +2,7 @@
<%# TODO: Refactor! %> <%# TODO: Refactor! %>
<% if current_user %> <% if current_user %>
<% if allowed_to? :cancel?, job %> <% if allowed_to? :cancel?, job %>
<%= button_to icon("x-circle", class: "icon size-10 text-hsrm-red", title: "Druckauftrag abbrechen (Anmeldung erforderlich)"), cancel_job_path(job), method: :patch, form: {data: {turbo_confirm: 'Den Plottauftrag wirklich abbrechen?'}}, form_class: "inline" %> <%= button_to icon("x-circle", class: "icon size-10 text-hsrm-red", title: "Druckauftrag abbrechen (Anmeldung erforderlich)"), cancel_job_path(job), method: :patch, target: "_top", form: {data: {turbo_frame: "_top", turbo_confirm: 'Den Plottauftrag wirklich abbrechen?'}}, form_class: "inline" %>
<% else %> <% else %>
<% if job.open? %> <% if job.open? %>
<% if job.created_by_operator %> <% if job.created_by_operator %>
@@ -19,7 +19,7 @@
<% if job.created_by_operator %> <% if job.created_by_operator %>
<%= icon("x-circle", class: "icon icon-disabled size-10", title: "Druckauftrag kann nur vom Operator abgebrochen werden!") %> <%= icon("x-circle", class: "icon icon-disabled size-10", title: "Druckauftrag kann nur vom Operator abgebrochen werden!") %>
<% else %> <% else %>
<%= button_to icon("x-circle", class: "icon size-10 text-hsrm-red", title: "Druckauftrag abbrechen (Anmeldung erforderlich)"), cancel_job_path(job), method: :patch, form: {data: {turbo_confirm: 'Den Plottauftrag wirklich abbrechen? (Anmeldung erforderlich!)'}}, form_class: "inline" %> <%= button_to icon("x-circle", class: "icon size-10 text-hsrm-red", title: "Druckauftrag abbrechen (Anmeldung erforderlich)"), cancel_job_path(job), method: :patch, form: {data: {turbo_frame: "_top", turbo_confirm: 'Den Plottauftrag wirklich abbrechen? (Anmeldung erforderlich!)'}}, form_class: "inline" %>
<% end %> <% end %>
<% else %> <% else %>
<%= icon("x-circle", class: "icon icon-disabled size-10", title: "Kann nicht mehr abgebrochen werden") %> <%= icon("x-circle", class: "icon icon-disabled size-10", title: "Kann nicht mehr abgebrochen werden") %>