Files
fizzy/app/views/comments/reactions/new.html.erb
T
2025-04-09 14:50:58 +02:00

27 lines
1.5 KiB
Plaintext

<%= turbo_frame_tag dom_id(@comment, :new_reaction) do %>
<%= form_with url: collection_card_comment_reactions_path(@comment.card.collection, @comment.card, @comment),
class: "reaction reaction__form flex-inline postion--relative max-width align-center fill-white gap expanded",
html: { aria: { label: "New reaction" } },
data: { controller: "form", turbo_frame: dom_id(@comment, :reacting), action: "keydown.esc->form#cancel" } do |form| %>
<label class="reaction__form-label flex gap" style="--column-gap: 0.7ch;">
<figure class="reaction__avatar margin-none flex-item-no-shrink">
<%= avatar_tag Current.user %>
</figure>
<%= form.text_field :content, name: "reaction[content]", autofocus: true, autocomplete: "off", autocorrect: "off", maxlength: 16,
required: true, pattern: /\S+.*/, class: "input reaction__input txt-small",
aria: { label: "Add a reaction" } %>
</label>
<%= form.button class: "btn btn--reversed", type: "submit" do %>
<%= icon_tag "check" %>
<span class="for-screen-reader">Submit</span>
<% end %>
<%= link_to collection_card_comment_reactions_path(@comment.card.collection, @comment.card, @comment), role: "button",
data: { turbo_frame: dom_id(@comment, :reactions), form_target: "cancel" }, class: "btn btn--negative" do %>
<%= icon_tag "minus" %>
<span class="for-screen-reader">Cancel</span>
<% end %>
<% end %>
<% end %>