Files
fizzy/app/views/workflows/edit.html.erb
T
2025-01-14 16:45:29 -06:00

26 lines
1.5 KiB
Plaintext

<%= turbo_frame_tag dom_id(@workflow, :header) do %>
<div class="flex align-center gap-half">
<%= form_with model: @workflow, url: workflow_path(@workflow), id: dom_id(@workflow, :form), class: "full-width", data: { controller: "form" } do |form| %>
<h3 class="txt-large margin-none">
<%= form.text_field :name, required: true, autofocus: true, class: "input full-width", style: "--input-padding: 0.2em 0.5em;", data: { action: "keydown.esc@document->form#cancel" } %>
</h3>
<%= link_to "Cancel", workflow_path(@workflow), data: { form_target: "cancel", turbo_frame: dom_id(@workflow) }, hidden: true %>
<% end %>
<%= tag.button type: :submit, class: "btn btn--small btn--positive", form: dom_id(@workflow, :form) do %>
<%= image_tag "check.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Save</span>
<% end %>
<%= link_to workflow_path(@workflow), class: "btn btn--small", data: { turbo_frame: dom_id(@workflow) } do %>
<%= image_tag "remove-med.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Cancel</span>
<% end %>
<%= button_to workflow_path(@workflow), method: :delete, class: "btn btn--small btn--negative", data: { turbo_frame: :workflows, turbo_confirm: "Are you sure you want to delete this workflow?" } do %>
<%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Delete <%= @workflow.name %></span>
<% end %>
</div>
<% end %>