app/views/publication_setups/_form.html.slim
- javascript_additional_packs 'exports/form', 'publication_setups/form'
= simple_form_for @publication_setup, url: [@workgroup, @publication_setup], html: {class: 'form-horizontal', id: 'publication_setup_form', 'x-data': "exportForm(#{@export.alpine_state(false)})" }, wrapper: :horizontal_form do |form|
.row
.form-group
.col-lg-12
= form.input :workgroup_id, as: :hidden, input_html: { value: @workgroup.id }
= form.input :name
= form.input :enabled, as: :switchable_checkbox
= form.input :force_daily_publishing, as: :switchable_checkbox
.separator.section_separator
h2.mb-lg= t('publication_setups.form.sections.export')
.form-group
.col-lg-12
= render'exports/options', form: form, resource_type: :export_options, workgroup: @workgroup
.separator.section_separator
h2.mb-lg= t('publication_setups.form.sections.destinations')
.form-group
.col-lg-12
- form.object.destinations.build unless form.object.destinations.size > 0
= form.simple_fields_for(:destinations) do |destination_form|
= render 'destination_fields', f: destination_form, destination: destination_form.object
.links.nested-linker
= link_to_add_association t('publication_setups.form.add_destination'), form, :destinations, class: 'btn btn-primary'
= cancel_button
= form.button :submit,
t('actions.submit'),
class: 'btn btn-default formSubmitr',
data: { disable_with: t('actions.processing') },
form: 'publication_setup_form'