<%= render Spina::UserInterface::HeaderComponent.new do |header| %> <% header.actions do %> <%= render Spina::UserInterface::TranslationsComponent.new(@resource, label: @locale.upcase) %> <%= button_tag type: :submit, form: dom_id(@resource), class: 'btn btn-primary', data: {controller: "button", action: "button#loading", loading_message: t('spina.ui.saving')} do %> <%= heroicon('check', style: :solid, class: 'w-5 h-5 mr-1 -ml-2') %> <%=t 'spina.ui.save_changes' %> <% end %> <% end %> <% end %>
<%= form_with model: [spina, :admin, @resource], id: dom_id(@resource) do |f| %> <%= hidden_field_tag :locale, @locale %>
<%= label_tag :label, class: "font-medium block" do %> <%= Spina::Resource.human_attribute_name(:label) %> <% end %>
<%=t 'spina.resources.label_description' %>
<%= render Spina::Forms::TextFieldComponent.new(f, :label, size: "lg", autofocus: @resource.label.blank?) %>
<%= label_tag :label, class: "font-medium block" do %> <%= Spina::Resource.human_attribute_name(:settings) %> <% end %>
<%=t 'spina.resources.settings_description' %>
<%= f.label :slug, class: 'font-medium text-sm text-gray-700 block' %> <% Mobility.with_locale(@locale) do %> <%= render Spina::Forms::TextFieldComponent.new(f, :slug) %> <% end %>
<%= f.label :view_template, class: 'font-medium text-sm text-gray-700 block' %> <% options = options_for_select(current_theme.view_templates.map { |template| [template[:title], template[:name]] }, @resource.view_template) %> <%= f.select :view_template, options, {include_blank: t('spina.resources.no_default_template')}, class: 'form-select', data: {controller: "select-placeholder", action: "select-placeholder#update"} %>
<%= f.label :order_by, class: 'font-medium text-sm text-gray-700 block' %> <%= f.select :order_by, f.object.order_by_options, {include_blank: t('spina.resources.manual_sorting')}, class: 'form-select' %>
<% end %>