remove via linkk tab if 2+ parties

This commit is contained in:
Pete Matsyburka
2024-01-14 14:09:04 +02:00
parent 7a4aa3bf87
commit 15ff4386e5
+2 -2
View File
@@ -1,5 +1,5 @@
<%= render 'shared/turbo_modal', title: params[:selfsign] ? 'Add Recipients' : 'Add New Recipients' do %> <%= render 'shared/turbo_modal', title: params[:selfsign] ? 'Add Recipients' : 'Add New Recipients' do %>
<% options = [['via Email', 'email'], ['via Phone', 'phone'], %w[Detailed detailed], (Docuseal.multitenant? && params[:with_link] && @template.submitters.to_a.size != 0 ? ['via Link', 'link'] : nil)].compact %> <% options = [['via Email', 'email'], ['via Phone', 'phone'], %w[Detailed detailed], (Docuseal.multitenant? && params[:with_link] && @template.submitters.to_a.size < 2 ? ['via Link', 'link'] : nil)].compact %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-4 block"> <toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-4 block">
<div class="join"> <div class="join">
<% options.each_with_index do |(label, value), index| %> <% options.each_with_index do |(label, value), index| %>
@@ -22,7 +22,7 @@
<div id="detailed" class="hidden"> <div id="detailed" class="hidden">
<%= render 'detailed_form', template: @template %> <%= render 'detailed_form', template: @template %>
</div> </div>
<% if Docuseal.multitenant? && params[:with_link] && @template.submitters.to_a.size != 0 %> <% if Docuseal.multitenant? && params[:with_link] && @template.submitters.to_a.size < 2 %>
<div id="link" class="hidden"> <div id="link" class="hidden">
<%= render 'link_form', template: @template %> <%= render 'link_form', template: @template %>
</div> </div>