Files
fizzy/app/views/comments/edit.html.erb
T
Jose Farias 0d2e4ed604 Merge branch 'main' into house
* main:
  Add hotwire-spark
  Fix for Safari which doesn't support `field-sizing: content`
  Add button and action to delete a bubble
  Indicate draggable element
  Stub draggable collection size divider
  Make close and trash more distinct
2024-12-18 16:27:07 -06:00

27 lines
1.7 KiB
Plaintext

<%= turbo_frame_tag dom_id(@comment) do %>
<div class="comment__content flex-inline flex-column full-width border border-radius" style="background-color: var(--color-selected);">
<%= form_with model: [@bubble.bucket, @bubble, @comment], class: "flex flex-column gap full-width",
data: { controller: "form", action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel" } do |form| %>
<%= form.markdown_area :body, class: "input comment__input", required: true %>
<div class="flex gap-half justify-start">
<%= form.button class: "btn btn--reversed txt-small", type: :submit do %>
<%= image_tag "check.svg", aria: { hidden: true }, size: 16 %>
<span class="for-screen-reader">Save</span>
<% end %>
<%= link_to bucket_bubble_comment_path(@bubble.bucket, @bubble, @comment), class: "btn btn--small", data: { form_target: "cancel" } do %>
<%= image_tag "remove-med.svg", aria: { hidden: true }, size: 16 %>
<span class="for-screen-reader">Cancel</span>
<% end %>
<%= tag.button type: :submit, class: "btn btn--small btn--negative flex-item-justify-end", form: dom_id(@comment, :delete_form),
data: { turbo_confirm: "Are you sure you want to delete this comment?" } do %>
<%= image_tag "trash.svg", aria: { hidden: true }, size: 16 %>
<span class="for-screen-reader">Delete</span>
<% end %>
</div>
<% end %>
<%= form_with url: bucket_bubble_comment_path(@bubble.bucket, @bubble, @comment), method: :delete, id: dom_id(@comment, :delete_form), data: { turbo_frame: "_top" } %>
</div>
<% end %>