|
|
|
@ -117,7 +117,7 @@
|
|
|
|
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-1' }, data: { close_on_submit: false } do |f| %>
|
|
|
|
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-1' }, data: { close_on_submit: false } do |f| %>
|
|
|
|
<toggle-on-submit data-element-id="email_saved_alert2"></toggle-on-submit>
|
|
|
|
<toggle-on-submit data-element-id="email_saved_alert2"></toggle-on-submit>
|
|
|
|
<% configs = AccountConfigs.find_or_initialize_for_key(current_account, AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY).value %>
|
|
|
|
<% configs = AccountConfigs.find_or_initialize_for_key(current_account, AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY).value %>
|
|
|
|
<%= f.fields_for :preferences, Struct.new(:documents_copy_email_subject, :documents_copy_email_body, :documents_copy_email_enabled, :documents_copy_email_attach_audit).new(@template.preferences['documents_copy_email_subject'].presence || configs['subject'], @template.preferences['documents_copy_email_body'].presence || configs['body'], @template.preferences['documents_copy_email_enabled'], configs['attach_audit_log'] != false && @template.preferences['documents_copy_email_attach_audit'] != false) do |ff| %>
|
|
|
|
<%= f.fields_for :preferences, Struct.new(:documents_copy_email_subject, :documents_copy_email_body, :documents_copy_email_enabled, :documents_copy_email_attach_audit, :documents_copy_email_attach_documents).new(@template.preferences['documents_copy_email_subject'].presence || configs['subject'], @template.preferences['documents_copy_email_body'].presence || configs['body'], @template.preferences['documents_copy_email_enabled'], configs['attach_audit_log'] != false && @template.preferences['documents_copy_email_attach_audit'] != false, configs['attach_documents'] != false && @template.preferences['documents_copy_email_attach_documents'] != false) do |ff| %>
|
|
|
|
<div class="form-control">
|
|
|
|
<div class="form-control">
|
|
|
|
<%= ff.label :documents_copy_email_subject, t('email_subject'), class: 'label' %>
|
|
|
|
<%= ff.label :documents_copy_email_subject, t('email_subject'), class: 'label' %>
|
|
|
|
<%= ff.text_field :documents_copy_email_subject, required: true, class: 'base-input', dir: 'auto' %>
|
|
|
|
<%= ff.text_field :documents_copy_email_subject, required: true, class: 'base-input', dir: 'auto' %>
|
|
|
|
@ -133,6 +133,12 @@
|
|
|
|
<%= ff.text_area :documents_copy_email_body, required: true, class: 'base-input w-full py-2', dir: 'auto' %>
|
|
|
|
<%= ff.text_area :documents_copy_email_body, required: true, class: 'base-input w-full py-2', dir: 'auto' %>
|
|
|
|
</autoresize-textarea>
|
|
|
|
</autoresize-textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
<%= t('attach_documents_to_the_email') %>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<%= ff.check_box :documents_copy_email_attach_documents, { checked: ff.object.documents_copy_email_attach_documents != false, class: 'toggle', onchange: 'this.form.requestSubmit()', disabled: configs['attach_documents'] == false }, 'true', 'false' %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<%= t('attach_audit_log_pdf_to_the_email') %>
|
|
|
|
<%= t('attach_audit_log_pdf_to_the_email') %>
|
|
|
|
@ -182,21 +188,21 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<%= t('send_emails_automatically_on_completion') %>
|
|
|
|
<%= t('attach_documents_to_the_email') %>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<%= ff.check_box :completed_notification_email_enabled, { checked: ff.object.completed_notification_email_enabled != false, class: 'toggle', onchange: 'this.form.requestSubmit()' }, 'true', 'false' %>
|
|
|
|
<%= ff.check_box :completed_notification_email_attach_documents, { checked: ff.object.completed_notification_email_attach_documents != false, class: 'toggle', onchange: 'this.form.requestSubmit()', disabled: configs['attach_documents'] == false }, 'true', 'false' %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<div class="flex items-center justify-between pt-2.5 px-1 mb-2">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<%= t('attach_documents_to_the_email') %>
|
|
|
|
<%= t('attach_audit_log_pdf_to_the_email') %>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<%= ff.check_box :completed_notification_email_attach_documents, { checked: ff.object.completed_notification_email_attach_documents != false, class: 'toggle', onchange: 'this.form.requestSubmit()', disabled: configs['attach_documents'] == false }, 'true', 'false' %>
|
|
|
|
<%= ff.check_box :completed_notification_email_attach_audit, { checked: ff.object.completed_notification_email_attach_audit != false, class: 'toggle', onchange: 'this.form.requestSubmit()', disabled: configs['attach_audit_log'] == false }, 'true', 'false' %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between py-2.5 px-1 mb-2">
|
|
|
|
<div class="flex items-center justify-between py-2.5 px-1 mb-2">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<%= t('attach_audit_log_pdf_to_the_email') %>
|
|
|
|
<%= t('send_emails_automatically_on_completion') %>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<%= ff.check_box :completed_notification_email_attach_audit, { checked: ff.object.completed_notification_email_attach_audit != false, class: 'toggle', onchange: 'this.form.requestSubmit()', disabled: configs['attach_audit_log'] == false }, 'true', 'false' %>
|
|
|
|
<%= ff.check_box :completed_notification_email_enabled, { checked: ff.object.completed_notification_email_enabled != false, class: 'toggle', onchange: 'this.form.requestSubmit()' }, 'true', 'false' %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div class="form-control pt-2">
|
|
|
|
<div class="form-control pt-2">
|
|
|
|
|