<%= render 'shared/turbo_modal_large', title: t('share_link') do %>
<%= form_for @template, url: template_share_link_path(@template), method: :post, html: { id: 'shared_link_form', autocomplete: 'off', class: 'mt-3' }, data: { close_on_submit: false } do |f| %>
<%= render 'shared/clipboard_copy', icon: 'copy', text: start_form_url(slug: @template.slug), class: 'base-button', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %>
<% end %> <%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-4 mb-5' }, data: { close_on_submit: false } do |f| %> <% link_form_fields = @template.preferences.fetch('link_form_fields', ['email']) %> <% %w[name email phone].each do |field| %> <%= label_tag "link_form_fields_#{field}", t(field), class: 'relative flex w-full md:w-1/3 items-center h-12 border-base-300 py-3.5 border rounded-xl' do %> <%= check_box_tag 'template[preferences][link_form_fields][]', field, link_form_fields.include?(field), class: 'absolute !animate-none checkbox left-3', id: "link_form_fields_#{field}" %> <%= t(field) %> <% end %> <% end %> <% end %> <% if Templates.filter_undefined_submitters(@template.submitters).size > 1 %>
<%= svg_icon('info_circle', class: 'stroke-current shrink-0 h-6 w-6 mt-1') %>
<%= t('this_template_has_multiple_parties_which_prevents_the_use_of_a_sharing_link') %>
<% end %> <% if @template.submitters.to_a.length > 1 %>
<%= t('default_parties') %>
<%= render 'templates_preferences/recipients', template: @template, close_on_submit: false, with_toggles: false, with_submission_requester: false %>
<% end %>
<% end %>