mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.2 KiB
62 lines
2.2 KiB
<%= render 'shared/turbo_modal', title: 'New Recepients' do %>
|
|
<%= form_for '', url: template_submissions_path(@template), html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
|
|
<% if @template.submitters.size == 1 %>
|
|
<div class="form-control">
|
|
<%= f.label :emails, class: 'label' %>
|
|
<%= f.text_area :emails, required: true, class: 'base-textarea' %>
|
|
</div>
|
|
<% else %>
|
|
<table class="">
|
|
<thead>
|
|
<tr>
|
|
<% @template.submitters.each do |item| %>
|
|
<th class="w-1/2 text-left">
|
|
<%= item['name'] %>
|
|
</th>
|
|
<% end %>
|
|
<th>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<% @template.submitters.each do |item| %>
|
|
<td>
|
|
<input type="hidden" name="submission[][submitters][][uuid]" value="<%= item['uuid'] %>" >
|
|
<input type="email" name="submission[][submitters][][email]" value="<%= item['email'] %>" required>
|
|
</td>
|
|
<% end %>
|
|
<td>
|
|
×
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<button>
|
|
+ Add new
|
|
</button>
|
|
<% end %>
|
|
<div class="form-control">
|
|
<%= f.label :send_email, class: 'flex items-center cursor-pointer' do %>
|
|
<%= f.check_box :send_email, class: 'base-checkbox', onchange: "message_field.classList.toggle('hidden', !event.currentTarget.checked)" %>
|
|
<span class="label">Send Email</span>
|
|
<% end %>
|
|
</div>
|
|
<div id="message_field" class="card card-compact bg-base-200 hidden">
|
|
<div class="card-body">
|
|
<div class="form-control space-y-2">
|
|
<span class="label-text">Hi there,</span>
|
|
<%= f.text_area :message, value: SubmitterMailer::DEFAULT_MESSAGE, required: true, class: 'base-textarea !rounded-lg' %>
|
|
<span class="label-text">
|
|
Thanks,
|
|
</br>
|
|
<%= current_account.name %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-control">
|
|
<%= f.button button_title(title: 'Confirm', disabled_with: 'Processing'), class: 'base-button' %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|