20 lines
1.3 KiB
Plaintext
20 lines
1.3 KiB
Plaintext
<%= turbo_frame_tag @card, :edit do %>
|
|
<%= form_with model: @card, url: collection_card_path(@card.collection, @card), class: "card__content", data: { controller: "form" } do |form| %>
|
|
<h1 class="card__title">
|
|
<%= form.label :title, class: "flex flex-column align-center" do %>
|
|
<%= form.text_area :title, class: "input input--textarea full-width borderless txt-align-start card-field__title",
|
|
required: true, autofocus: true, placeholder: "Name it…",
|
|
rows: 1,
|
|
data: { action: "keydown.enter->form#submit:prevent keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel focus->form#select" } %>
|
|
<% end %>
|
|
</h1>
|
|
|
|
<%= form.rich_textarea :description, class: "card-field__description rich-text-content",
|
|
placeholder: "Add some notes, context, pictures, or video about this…",
|
|
data: { action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" } %>
|
|
</div>
|
|
<%= form.button "Save changes", type: :submit, class: "btn" %>
|
|
<%= link_to "Close editor and discard changes", collection_card_path(@card.collection, @card), data: { form_target: "cancel" }, hidden: true %>
|
|
<% end %>
|
|
<% end %>
|