|
|
|
|
@ -2,10 +2,10 @@
|
|
|
|
|
<% submitters = template.submitters.reject { |e| e['invite_by_uuid'].present? } %>
|
|
|
|
|
<dynamic-list class="space-y-4">
|
|
|
|
|
<div class="space-y-4">
|
|
|
|
|
<div class="card card-compact bg-base-200" data-targets="dynamic-list.items">
|
|
|
|
|
<div class="card card-compact bg-base-300/40" data-targets="dynamic-list.items">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="absolute right-4 top-5">
|
|
|
|
|
<a href="#" data-action="click:dynamic-list#removeItem" class="<%= submitters.size == 1 ? 'right-2' : '-top-3' %> relative block w-6 h-6 rounded-lg text-neutral-700 text-center bg-base-300 p-1 hidden hover:bg-neutral hover:text-white">
|
|
|
|
|
<a href="#" data-action="click:dynamic-list#removeItem" class="<%= submitters.size == 1 ? 'right-2 top-1' : '-top-3' %> relative block w-6 h-6 rounded-lg text-neutral-700 text-center bg-base-300 p-1 hidden hover:bg-neutral hover:text-white">
|
|
|
|
|
<%= svg_icon('trash', class: 'w-4 h-4') %>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
@ -14,20 +14,20 @@
|
|
|
|
|
<submitter-item class="grid <%= submitters.size > 1 ? 'gap-4' : 'md:grid-cols-2 gap-1' %>">
|
|
|
|
|
<div class="form-control">
|
|
|
|
|
<% if submitters.size > 1 %>
|
|
|
|
|
<label class="label pt-0 pb-1 text-xs">
|
|
|
|
|
<label class="label pt-0 pb-1">
|
|
|
|
|
<span class="label-text"> <%= item['name'] %></span>
|
|
|
|
|
</label>
|
|
|
|
|
<% end %>
|
|
|
|
|
<input type="hidden" name="submission[1][submitters][][uuid]" value="<%= item['uuid'] %>">
|
|
|
|
|
<submitters-autocomplete data-field="phone">
|
|
|
|
|
<linked-input data-target-id="<%= "phone_phone_#{item['linked_to_uuid']}" if item['linked_to_uuid'].present? %>">
|
|
|
|
|
<%= tag.input type: 'tel', pattern: '^\+[0-9\s\-]+$', oninvalid: "this.value ? this.setCustomValidity('Use internatioanl format: +1xxx...') : ''", oninput: "this.setCustomValidity('')", name: 'submission[1][submitters][][phone]', autocomplete: 'off', class: 'input input-sm input-bordered w-full', placeholder: 'Phone', required: index.zero?, id: "phone_phone_#{item['uuid']}" %>
|
|
|
|
|
<%= tag.input type: 'tel', pattern: '^\+[0-9\s\-]+$', oninvalid: "this.value ? this.setCustomValidity('Use internatioanl format: +1xxx...') : ''", oninput: "this.setCustomValidity('')", name: 'submission[1][submitters][][phone]', autocomplete: 'off', class: 'base-input-slim w-full', placeholder: 'Phone', required: index.zero?, id: "phone_phone_#{item['uuid']}" %>
|
|
|
|
|
</linked-input>
|
|
|
|
|
</submitters-autocomplete>
|
|
|
|
|
<% if submitters.size > 1 %>
|
|
|
|
|
<submitters-autocomplete data-field="name">
|
|
|
|
|
<linked-input data-target-id="<%= "phone_name_#{item['linked_to_uuid']}" if item['linked_to_uuid'].present? %>">
|
|
|
|
|
<input type="text" name="submission[1][submitters][][name]" autocomplete="off" class="input input-sm input-bordered mt-1.5 w-full" placeholder="Name (optional)" value="<%= (params[:selfsign] && index.zero?) || item['is_requester'] ? current_user.full_name : '' %>" dir="auto" id="phone_name_<%= item['uuid'] %>">
|
|
|
|
|
<input type="text" name="submission[1][submitters][][name]" autocomplete="off" class="base-input-slim mt-1.5 w-full" placeholder="Name (optional)" value="<%= (params[:selfsign] && index.zero?) || item['is_requester'] ? current_user.full_name : '' %>" dir="auto" id="phone_name_<%= item['uuid'] %>">
|
|
|
|
|
</linked-input>
|
|
|
|
|
</submitters-autocomplete>
|
|
|
|
|
<% end %>
|
|
|
|
|
@ -36,7 +36,7 @@
|
|
|
|
|
<div class="form-control flex">
|
|
|
|
|
<submitters-autocomplete data-field="name">
|
|
|
|
|
<linked-input data-target-id="<%= "phone_name_#{item['linked_to_uuid']}" if item['linked_to_uuid'].present? %>">
|
|
|
|
|
<input type="text" name="submission[1][submitters][][name]" autocomplete="off" class="input input-sm input-bordered w-full" placeholder="Name (optional)" value="<%= (params[:selfsign] && index.zero?) || item['is_requester'] ? current_user.full_name : '' %>" dir="auto" id="phone_name_<%= item['uuid'] %>">
|
|
|
|
|
<input type="text" name="submission[1][submitters][][name]" autocomplete="off" class="base-input-slim w-full" placeholder="Name (optional)" value="<%= (params[:selfsign] && index.zero?) || item['is_requester'] ? current_user.full_name : '' %>" dir="auto" id="phone_name_<%= item['uuid'] %>">
|
|
|
|
|
</linked-input>
|
|
|
|
|
</submitters-autocomplete>
|
|
|
|
|
</div>
|
|
|
|
|
|