mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 03:32:18 -05:00
31 lines
1.0 KiB
ERB
31 lines
1.0 KiB
ERB
<%= form_with model: list, class: "container-md tabular-form" do |form| %>
|
|
<%= TextInputRow(form: form, attribute: :name, label: List.human_attribute_name(:name)) unless @list.special %>
|
|
|
|
<% if list.persisted? %>
|
|
<div>
|
|
<%= form.label :list_items %>
|
|
</div>
|
|
<div>
|
|
<%= cocooned_container :table, id: "cocooned-list-items", data: {controller: "cocooned"}, class: "table table-striped" do
|
|
form.fields_for :list_items do |f|
|
|
render "list_item_fields", f: f
|
|
end
|
|
end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div>
|
|
<%= form.submit class: "btn btn-primary" %>
|
|
<% if list.persisted? && policy(list).destroy? %>
|
|
<%= link_to list_path(list), {
|
|
method: :delete,
|
|
class: "float-end btn btn-outline-danger",
|
|
data: {confirm: translate("views.lists.form.confirm_destroy")}
|
|
} do %>
|
|
<%= Icon(icon: "trash", label: t("general.delete")) %>
|
|
<%= t("general.delete") %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|