<%= form_with model: [ :admin, template ], class: "card card-body max-w-3xl space-y-4" do |f| %> <%= f.errors_summary %>
<%= f.field :name, required: true, placeholder: "Oil and filter change" %> <%= f.field :reference, placeholder: "Part 43 App. A (c)(6)", hint: "Shown next to the name, e.g. the regulation or manual paragraph." %>
<%= f.field :text, as: :textarea, rows: 5, required: true, hint: "The entry text. Use __ for blanks to fill in (quantities, part numbers…)." %>
<%= f.field :entry_type, as: :select, label: "Entry type", collection: LogbookEntry::ENTRY_TYPES.invert %> <%= f.field :log_type, as: :select, label: "Logbook", include_blank: "— Leave as is —", collection: LogbookEntry::LOG_TYPES.invert %> <%= f.field :certificate_type, as: :select, label: "Kind of certificate", include_blank: "— Leave as is —", collection: LogbookEntry::CERTIFICATE_TYPES.invert, hint: "Only filled in when none is chosen yet." %> <%= f.field :position, as: :number, label: "Order" %>
<%= f.submit "Save Template" %><%= link_to "Cancel", admin_logbook_templates_path, class: "btn-secondary" %>
<% end %> <% if template.persisted? %>
<%= delete_button "Delete template", admin_logbook_template_path(template) %>
<% end %>