add signature id
This commit is contained in:
@@ -13,7 +13,8 @@ class AccountConfigsController < ApplicationController
|
|||||||
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
||||||
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
|
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
|
||||||
AccountConfig::FORCE_SSO_AUTH_KEY,
|
AccountConfig::FORCE_SSO_AUTH_KEY,
|
||||||
AccountConfig::FLATTEN_RESULT_PDF_KEY
|
AccountConfig::FLATTEN_RESULT_PDF_KEY,
|
||||||
|
AccountConfig::WITH_SIGNATURE_ID
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
InvalidKey = Class.new(StandardError)
|
InvalidKey = Class.new(StandardError)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module Api
|
|||||||
cookies.encrypted[:signature_uuids] = build_new_cookie_signatures_json(submitter, attachment)
|
cookies.encrypted[:signature_uuids] = build_new_cookie_signatures_json(submitter, attachment)
|
||||||
end
|
end
|
||||||
|
|
||||||
render json: attachment.as_json(only: %i[uuid], methods: %i[url filename content_type])
|
render json: attachment.as_json(only: %i[uuid created_at], methods: %i[url filename content_type])
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_new_cookie_signatures_json(submitter, attachment)
|
def build_new_cookie_signatures_json(submitter, attachment)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class SubmitFormValuesController < ApplicationController
|
|||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
value:,
|
value:,
|
||||||
attachment: attachment&.as_json(only: %i[uuid], methods: %i[url filename content_type])
|
attachment: attachment&.as_json(only: %i[uuid created_at], methods: %i[url filename content_type])
|
||||||
}, head: :ok
|
}, head: :ok
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ safeRegisterElement('submission-form', class extends HTMLElement {
|
|||||||
scrollPadding: this.dataset.scrollPadding || '-80px',
|
scrollPadding: this.dataset.scrollPadding || '-80px',
|
||||||
dryRun: this.dataset.dryRun === 'true',
|
dryRun: this.dataset.dryRun === 'true',
|
||||||
expand: ['true', 'false'].includes(this.dataset.expand) ? this.dataset.expand === 'true' : null,
|
expand: ['true', 'false'].includes(this.dataset.expand) ? this.dataset.expand === 'true' : null,
|
||||||
|
withSignatureId: this.dataset.withSignatureId === 'true',
|
||||||
withConfetti: this.dataset.withConfetti !== 'false',
|
withConfetti: this.dataset.withConfetti !== 'false',
|
||||||
withDisclosure: this.dataset.withDisclosure === 'true',
|
withDisclosure: this.dataset.withDisclosure === 'true',
|
||||||
withTypedSignature: this.dataset.withTypedSignature !== 'false',
|
withTypedSignature: this.dataset.withTypedSignature !== 'false',
|
||||||
|
|||||||
@@ -54,11 +54,37 @@
|
|||||||
class="object-contain mx-auto"
|
class="object-contain mx-auto"
|
||||||
:src="stamp.url"
|
:src="stamp.url"
|
||||||
>
|
>
|
||||||
<img
|
<div
|
||||||
v-else-if="field.type === 'signature' && signature"
|
v-else-if="field.type === 'signature' && signature"
|
||||||
class="object-contain mx-auto"
|
class="flex flex-col justify-between h-full overflow-hidden"
|
||||||
:src="signature.url"
|
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
class="flex-grow flex overflow-hidden"
|
||||||
|
style="min-height: 50%"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
class="object-contain mx-auto"
|
||||||
|
:src="signature.url"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="withSignatureId"
|
||||||
|
class="w-full mt-1 text-[1vw] lg:text-[0.55rem] lg:leading-[0.65rem]"
|
||||||
|
>
|
||||||
|
<div class="truncate uppercase">
|
||||||
|
ID: {{ signature.uuid }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ t('reason') }}: {{ t('digitally_signed_by') }} {{ submitter.name }}
|
||||||
|
<template v-if="submitter.email">
|
||||||
|
<{{ submitter.email }}>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ new Date(signature.created_at).toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZoneName: 'short' }) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<img
|
<img
|
||||||
v-else-if="field.type === 'initials' && initials"
|
v-else-if="field.type === 'initials' && initials"
|
||||||
class="object-contain mx-auto"
|
class="object-contain mx-auto"
|
||||||
@@ -198,6 +224,15 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
submitter: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
withSignatureId: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
isValueSet: {
|
isValueSet: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
:submittable="true"
|
:submittable="true"
|
||||||
:field-index="fieldIndex"
|
:field-index="fieldIndex"
|
||||||
:scroll-padding="scrollPadding"
|
:scroll-padding="scrollPadding"
|
||||||
|
:submitter="submitter"
|
||||||
:with-field-placeholder="withFieldPlaceholder"
|
:with-field-placeholder="withFieldPlaceholder"
|
||||||
|
:with-signature-id="withSignatureId"
|
||||||
:is-active="currentStep === step"
|
:is-active="currentStep === step"
|
||||||
:with-label="withLabel && !withFieldPlaceholder"
|
:with-label="withLabel && !withFieldPlaceholder"
|
||||||
:is-value-set="step.some((f) => f.uuid in values)"
|
:is-value-set="step.some((f) => f.uuid in values)"
|
||||||
@@ -50,6 +52,15 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
|
withSignatureId: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
submitter: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
values: {
|
values: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
:steps="stepFields"
|
:steps="stepFields"
|
||||||
:values="values"
|
:values="values"
|
||||||
:with-field-placeholder="withFieldPlaceholder"
|
:with-field-placeholder="withFieldPlaceholder"
|
||||||
|
:submitter="submitter"
|
||||||
:scroll-el="scrollEl"
|
:scroll-el="scrollEl"
|
||||||
|
:with-signature-id="withSignatureId"
|
||||||
:attachments-index="attachmentsIndex"
|
:attachments-index="attachmentsIndex"
|
||||||
:with-label="!isAnonymousChecboxes && showFieldNames"
|
:with-label="!isAnonymousChecboxes && showFieldNames"
|
||||||
:current-step="currentStepFields"
|
:current-step="currentStepFields"
|
||||||
@@ -535,6 +537,11 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
withSignatureId: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
scrollPadding: {
|
scrollPadding: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ const en = {
|
|||||||
take_photo: 'Take photo',
|
take_photo: 'Take photo',
|
||||||
number_phone_is_invalid: '{number} phone is invalid',
|
number_phone_is_invalid: '{number} phone is invalid',
|
||||||
file: 'File',
|
file: 'File',
|
||||||
|
digitally_signed_by: 'Digitally signed by',
|
||||||
|
reason: 'Reason',
|
||||||
select: 'Select',
|
select: 'Select',
|
||||||
checkbox: 'Checkbox',
|
checkbox: 'Checkbox',
|
||||||
multiple: 'Multiple',
|
multiple: 'Multiple',
|
||||||
@@ -83,6 +85,8 @@ const es = {
|
|||||||
text: 'Texto',
|
text: 'Texto',
|
||||||
signature: 'Firma',
|
signature: 'Firma',
|
||||||
pay: 'Pagar',
|
pay: 'Pagar',
|
||||||
|
digitally_signed_by: 'Firmado digitalmente por',
|
||||||
|
reason: 'Razón',
|
||||||
initials: 'Iniciales',
|
initials: 'Iniciales',
|
||||||
date: 'Fecha',
|
date: 'Fecha',
|
||||||
number: 'Número',
|
number: 'Número',
|
||||||
@@ -155,6 +159,8 @@ const it = {
|
|||||||
already_paid: 'Pagato',
|
already_paid: 'Pagato',
|
||||||
text: 'Testo',
|
text: 'Testo',
|
||||||
signature: 'Firma',
|
signature: 'Firma',
|
||||||
|
digitally_signed_by: 'Firmato digitalmente da',
|
||||||
|
reason: 'Motivo',
|
||||||
initials: 'Iniziali',
|
initials: 'Iniziali',
|
||||||
date: 'Data',
|
date: 'Data',
|
||||||
number: 'Numero',
|
number: 'Numero',
|
||||||
@@ -228,6 +234,8 @@ const de = {
|
|||||||
minimize: 'Minimieren',
|
minimize: 'Minimieren',
|
||||||
text: 'Text',
|
text: 'Text',
|
||||||
signature: 'Unterschrift',
|
signature: 'Unterschrift',
|
||||||
|
digitally_signed_by: 'Digital unterschrieben von',
|
||||||
|
reason: 'Grund',
|
||||||
initials: 'Initialen',
|
initials: 'Initialen',
|
||||||
date: 'Datum',
|
date: 'Datum',
|
||||||
number: 'Nummer',
|
number: 'Nummer',
|
||||||
@@ -302,6 +310,8 @@ const fr = {
|
|||||||
already_paid: 'Déjà payé',
|
already_paid: 'Déjà payé',
|
||||||
signature: 'Signature',
|
signature: 'Signature',
|
||||||
initials: 'Initiales',
|
initials: 'Initiales',
|
||||||
|
digitally_signed_by: 'Signé numériquement par',
|
||||||
|
reason: 'Raison',
|
||||||
pay: 'Payer',
|
pay: 'Payer',
|
||||||
date: 'Date',
|
date: 'Date',
|
||||||
number: 'Numéro',
|
number: 'Numéro',
|
||||||
@@ -373,6 +383,8 @@ const pl = {
|
|||||||
minimize: 'Zminimalizuj',
|
minimize: 'Zminimalizuj',
|
||||||
text: 'Tekst',
|
text: 'Tekst',
|
||||||
already_paid: 'Już zapłacono',
|
already_paid: 'Już zapłacono',
|
||||||
|
digitally_signed_by: 'Podpisano cyfrowo przez',
|
||||||
|
reason: 'Powód',
|
||||||
signature: 'Podpis',
|
signature: 'Podpis',
|
||||||
initials: 'Inicjały',
|
initials: 'Inicjały',
|
||||||
date: 'Data',
|
date: 'Data',
|
||||||
@@ -447,6 +459,8 @@ const uk = {
|
|||||||
text: 'Текст',
|
text: 'Текст',
|
||||||
already_paid: 'Вже оплачено',
|
already_paid: 'Вже оплачено',
|
||||||
signature: 'Підпис',
|
signature: 'Підпис',
|
||||||
|
digitally_signed_by: 'Підписано в електронному вигляді',
|
||||||
|
reason: 'Причина',
|
||||||
initials: 'Ініціали',
|
initials: 'Ініціали',
|
||||||
date: 'Дата',
|
date: 'Дата',
|
||||||
number: 'Число',
|
number: 'Число',
|
||||||
@@ -523,6 +537,8 @@ const cs = {
|
|||||||
initials: 'Iniciály',
|
initials: 'Iniciály',
|
||||||
date: 'Datum',
|
date: 'Datum',
|
||||||
number: 'Číslo',
|
number: 'Číslo',
|
||||||
|
digitally_signed_by: 'Digitálně podepsáno',
|
||||||
|
reason: 'Důvod',
|
||||||
image: 'Obrázek',
|
image: 'Obrázek',
|
||||||
pay: 'Zaplatit',
|
pay: 'Zaplatit',
|
||||||
file: 'Soubor',
|
file: 'Soubor',
|
||||||
@@ -594,6 +610,8 @@ const pt = {
|
|||||||
text: 'Texto',
|
text: 'Texto',
|
||||||
signature: 'Assinatura',
|
signature: 'Assinatura',
|
||||||
initials: 'Iniciais',
|
initials: 'Iniciais',
|
||||||
|
digitally_signed_by: 'Assinado digitalmente por',
|
||||||
|
reason: 'Razão',
|
||||||
date: 'Data',
|
date: 'Data',
|
||||||
number: 'Número',
|
number: 'Número',
|
||||||
image: 'Imagem',
|
image: 'Imagem',
|
||||||
@@ -668,6 +686,8 @@ const he = {
|
|||||||
signature: 'חתימה',
|
signature: 'חתימה',
|
||||||
initials: 'ראשי תיבות',
|
initials: 'ראשי תיבות',
|
||||||
date: 'תאריך',
|
date: 'תאריך',
|
||||||
|
digitally_signed_by: 'חתום דיגיטלית על ידי',
|
||||||
|
reason: 'סיבה',
|
||||||
number: 'מספר',
|
number: 'מספר',
|
||||||
image: 'תמונה',
|
image: 'תמונה',
|
||||||
file: 'קובץ',
|
file: 'קובץ',
|
||||||
@@ -740,6 +760,8 @@ const nl = {
|
|||||||
text: 'Tekst',
|
text: 'Tekst',
|
||||||
already_paid: 'Al betaald',
|
already_paid: 'Al betaald',
|
||||||
signature: 'Handtekening',
|
signature: 'Handtekening',
|
||||||
|
digitally_signed_by: 'Digitaal ondertekend door',
|
||||||
|
reason: 'Reden',
|
||||||
initials: 'Initialen',
|
initials: 'Initialen',
|
||||||
date: 'Datum',
|
date: 'Datum',
|
||||||
number: 'Nummer',
|
number: 'Nummer',
|
||||||
@@ -815,6 +837,8 @@ const ar = {
|
|||||||
initials: 'الاختصارات',
|
initials: 'الاختصارات',
|
||||||
date: 'تاريخ',
|
date: 'تاريخ',
|
||||||
number: 'رقم',
|
number: 'رقم',
|
||||||
|
digitally_signed_by: 'تم التوقيع رقميًا بواسطة',
|
||||||
|
reason: 'السبب',
|
||||||
image: 'صورة',
|
image: 'صورة',
|
||||||
take_photo: 'التقاط صورة',
|
take_photo: 'التقاط صورة',
|
||||||
pay: 'دفع',
|
pay: 'دفع',
|
||||||
@@ -888,6 +912,8 @@ const ko = {
|
|||||||
signature: '서명',
|
signature: '서명',
|
||||||
initials: '이니셜',
|
initials: '이니셜',
|
||||||
date: '날짜',
|
date: '날짜',
|
||||||
|
digitally_signed_by: '디지털 서명이 완료되었습니다',
|
||||||
|
reason: '이유',
|
||||||
number: '숫자',
|
number: '숫자',
|
||||||
pay: '급여',
|
pay: '급여',
|
||||||
image: '이미지',
|
image: '이미지',
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class AccountConfig < ApplicationRecord
|
|||||||
DOWNLOAD_LINKS_AUTH_KEY = 'download_links_auth'
|
DOWNLOAD_LINKS_AUTH_KEY = 'download_links_auth'
|
||||||
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
|
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
|
||||||
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
|
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
|
||||||
|
WITH_SIGNATURE_ID = 'with_signature_id'
|
||||||
|
|
||||||
DEFAULT_VALUES = {
|
DEFAULT_VALUES = {
|
||||||
SUBMITTER_INVITATION_EMAIL_KEY => {
|
SUBMITTER_INVITATION_EMAIL_KEY => {
|
||||||
|
|||||||
@@ -51,6 +51,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::WITH_SIGNATURE_ID) %>
|
||||||
|
<% if can?(:manage, account_config) %>
|
||||||
|
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
||||||
|
<%= f.hidden_field :key %>
|
||||||
|
<div class="flex items-center justify-between py-2.5">
|
||||||
|
<span>
|
||||||
|
Add signature ID to the documents
|
||||||
|
</span>
|
||||||
|
<%= f.check_box :value, class: 'toggle', checked: account_config.value, onchange: 'this.form.requestSubmit()' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TYPED_SIGNATURE) %>
|
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TYPED_SIGNATURE) %>
|
||||||
<% if can?(:manage, account_config) %>
|
<% if can?(:manage, account_config) %>
|
||||||
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
||||||
|
|||||||
@@ -1,6 +1,28 @@
|
|||||||
<% align = field.dig('preferences', 'align') %>
|
<% align = field.dig('preferences', 'align') %>
|
||||||
<field-value dir="auto" class="flex absolute text-[1.5vw] lg:text-base <%= align == 'right' ? 'justify-end' : (align == 'center' ? 'justify-center' : '') %>" style="width: <%= area['w'] * 100 %>%; height: <%= area['h'] * 100 %>%; left: <%= area['x'] * 100 %>%; top: <%= area['y'] * 100 %>%; <%= "font-size: #{field['preferences']['font_size']}pt" if field.dig('preferences', 'font_size') %>">
|
<field-value dir="auto" class="flex absolute text-[1.5vw] lg:text-base <%= align == 'right' ? 'justify-end' : (align == 'center' ? 'justify-center' : '') %>" style="width: <%= area['w'] * 100 %>%; height: <%= area['h'] * 100 %>%; left: <%= area['x'] * 100 %>%; top: <%= area['y'] * 100 %>%; <%= "font-size: #{field['preferences']['font_size']}pt" if field.dig('preferences', 'font_size') %>">
|
||||||
<% if field['type'].in?(['signature', 'image', 'initials', 'stamp']) %>
|
<% if field['type'] == 'signature' %>
|
||||||
|
<div class="flex flex-col justify-between h-full overflow-hidden">
|
||||||
|
<div class="flex-grow flex overflow-hidden" style="min-height: 50%">
|
||||||
|
<img class="object-contain mx-auto" src="<%= attachments_index[value].url %>">
|
||||||
|
</div>
|
||||||
|
<% if local_assigns[:with_signature_id] && attachment = attachments_index[value] %>
|
||||||
|
<div class="w-full mt-1 text-[1vw] lg:text-[0.55rem] lg:leading-[0.65rem]">
|
||||||
|
<div class="truncate uppercase">
|
||||||
|
ID: <%= attachment.uuid %>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<%= t('reason') %>: <%= t('digitally_signed_by') %> <%= submitter.name %>
|
||||||
|
<% if submitter.email %>
|
||||||
|
<<%= submitter.email %>>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<%= l(attachment.created_at.in_time_zone(local_assigns[:timezone]), format: :long, locale: local_assigns[:locale]) %> <%= TimeUtils.timezone_abbr(local_assigns[:timezone], attachment.created_at) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% elsif field['type'].in?(['image', 'initials', 'stamp']) %>
|
||||||
<img class="object-contain mx-auto" src="<%= attachments_index[value].url %>" loading="lazy">
|
<img class="object-contain mx-auto" src="<%= attachments_index[value].url %>" loading="lazy">
|
||||||
<% elsif field['type'].in?(['file', 'payment']) %>
|
<% elsif field['type'].in?(['file', 'payment']) %>
|
||||||
<autosize-field></autosize-field>
|
<autosize-field></autosize-field>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<% if params[:controller] == 'submissions_preview' %>
|
<% if params[:controller] == 'submissions_preview' %>
|
||||||
<%= render 'submissions/preview_tags' %>
|
<%= render 'submissions/preview_tags' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% with_signature_id = @submission.account.account_configs.exists?(key: AccountConfig::WITH_SIGNATURE_ID, value: true) %>
|
||||||
<div style="max-width: 1600px" class="mx-auto pl-4">
|
<div style="max-width: 1600px" class="mx-auto pl-4">
|
||||||
<div class="flex justify-between py-1.5 items-center pr-4 sticky top-0 md:relative z-10 bg-base-100">
|
<div class="flex justify-between py-1.5 items-center pr-4 sticky top-0 md:relative z-10 bg-base-100">
|
||||||
<a href="<%= signed_in? && @submission.account_id == current_account&.id ? template_path(@submission.template) : '/' %>" class="flex items-center space-x-3 py-1">
|
<a href="<%= signed_in? && @submission.account_id == current_account&.id ? template_path(@submission.template) : '/' %>" class="flex items-center space-x-3 py-1">
|
||||||
@@ -73,6 +74,7 @@
|
|||||||
<div id="document_view" class="w-full overflow-y-auto overflow-x-hidden mt-0.5 pt-0.5">
|
<div id="document_view" class="w-full overflow-y-auto overflow-x-hidden mt-0.5 pt-0.5">
|
||||||
<div class="pr-3.5 pl-0.5">
|
<div class="pr-3.5 pl-0.5">
|
||||||
<% fields_index = Templates.build_field_areas_index(@submission.template_fields || @submission.template.fields) %>
|
<% fields_index = Templates.build_field_areas_index(@submission.template_fields || @submission.template.fields) %>
|
||||||
|
<% submitters_index = @submission.submitters.index_by(&:uuid) %>
|
||||||
<% values = @submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %>
|
<% values = @submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %>
|
||||||
<% attachments_index = ActiveStorage::Attachment.where(record: @submission.submitters, name: :attachments).preload(:blob).index_by(&:uuid) %>
|
<% attachments_index = ActiveStorage::Attachment.where(record: @submission.submitters, name: :attachments).preload(:blob).index_by(&:uuid) %>
|
||||||
<% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %>
|
<% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %>
|
||||||
@@ -92,7 +94,7 @@
|
|||||||
<% fields_index.dig(document.uuid, index)&.each do |(area, field)| %>
|
<% fields_index.dig(document.uuid, index)&.each do |(area, field)| %>
|
||||||
<% value = values[field['uuid']] %>
|
<% value = values[field['uuid']] %>
|
||||||
<% next if value.blank? %>
|
<% next if value.blank? %>
|
||||||
<%= render 'submissions/value', area:, field:, attachments_index:, value:, locale: @submission.account.locale, timezone: @submission.account.timezone %>
|
<%= render 'submissions/value', area:, field:, attachments_index:, value:, locale: @submission.account.locale, timezone: @submission.account.timezone, submitter: submitters_index[field['submitter_uuid']], with_signature_id: %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<% data_attachments = attachments_index.values.select { |e| e.record_id == submitter.id }.to_json(only: %i[uuid], methods: %i[url filename content_type]) %>
|
<% data_attachments = attachments_index.values.select { |e| e.record_id == submitter.id }.to_json(only: %i[uuid created_at], methods: %i[url filename content_type]) %>
|
||||||
<% data_fields = (submitter.submission.template_fields || submitter.submission.template.fields).select { |f| f['submitter_uuid'] == submitter.uuid }.to_json %>
|
<% data_fields = (submitter.submission.template_fields || submitter.submission.template.fields).select { |f| f['submitter_uuid'] == submitter.uuid }.to_json %>
|
||||||
<submission-form data-is-demo="<%= Docuseal.demo? %>" data-with-confetti="<%= configs[:with_confetti] %>" data-completed-redirect-url="<%= submitter.preferences['completed_redirect_url'] %>" data-completed-message="<%= configs[:completed_message].to_json %>" data-completed-button="<%= configs[:completed_button].to_json %>" data-go-to-last="<%= submitter.preferences.key?('go_to_last') ? submitter.preferences['go_to_last'] : submitter.opened_at? %>" data-submitter="<%= submitter.to_json(only: %i[uuid slug name phone email]) %>" data-can-send-email="<%= Accounts.can_send_emails?(submitter.submission.account) %>" data-attachments="<%= data_attachments %>" data-fields="<%= data_fields %>" data-values="<%= submitter.values.to_json %>" data-with-typed-signature="<%= configs[:with_typed_signature] %>" data-previous-signature-value="<%= local_assigns[:signature_attachment]&.uuid %>" data-remember-signature="<%= configs[:prefill_signature] %>" data-dry-run="<%= local_assigns[:dry_run] %>" data-expand="<%= local_assigns[:expand] %>" data-scroll-padding="<%= local_assigns[:scroll_padding] %>"></submission-form>
|
<submission-form data-is-demo="<%= Docuseal.demo? %>" data-with-signature-id="<%= configs[:with_signature_id] %>" data-with-confetti="<%= configs[:with_confetti] %>" data-completed-redirect-url="<%= submitter.preferences['completed_redirect_url'] %>" data-completed-message="<%= configs[:completed_message].to_json %>" data-completed-button="<%= configs[:completed_button].to_json %>" data-go-to-last="<%= submitter.preferences.key?('go_to_last') ? submitter.preferences['go_to_last'] : submitter.opened_at? %>" data-submitter="<%= submitter.to_json(only: %i[uuid slug name phone email]) %>" data-can-send-email="<%= Accounts.can_send_emails?(submitter.submission.account) %>" data-attachments="<%= data_attachments %>" data-fields="<%= data_fields %>" data-values="<%= submitter.values.to_json %>" data-with-typed-signature="<%= configs[:with_typed_signature] %>" data-previous-signature-value="<%= local_assigns[:signature_attachment]&.uuid %>" data-remember-signature="<%= configs[:prefill_signature] %>" data-dry-run="<%= local_assigns[:dry_run] %>" data-expand="<%= local_assigns[:expand] %>" data-scroll-padding="<%= local_assigns[:scroll_padding] %>"></submission-form>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<% next if field['redacted'] && field['submitter_uuid'] != @submitter.uuid %>
|
<% next if field['redacted'] && field['submitter_uuid'] != @submitter.uuid %>
|
||||||
<% next if value == '{{date}}' && field['submitter_uuid'] != @submitter.uuid %>
|
<% next if value == '{{date}}' && field['submitter_uuid'] != @submitter.uuid %>
|
||||||
<% next if field.dig('preferences', 'formula').present? && field['submitter_uuid'] == @submitter.uuid %>
|
<% next if field.dig('preferences', 'formula').present? && field['submitter_uuid'] == @submitter.uuid %>
|
||||||
<%= render 'submissions/value', area:, field:, attachments_index: @attachments_index, value:, locale: @submitter.account.locale, timezone: @submitter.account.timezone %>
|
<%= render 'submissions/value', area:, field:, attachments_index: @attachments_index, value:, locale: @submitter.account.locale, timezone: @submitter.account.timezone, submitter: @submitter, with_signature_id: @form_configs[:with_signature_id] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ en: &en
|
|||||||
verification_code_code: 'Verification code: %{code}'
|
verification_code_code: 'Verification code: %{code}'
|
||||||
digitally_signed_by: Digitally signed by
|
digitally_signed_by: Digitally signed by
|
||||||
role: Role
|
role: Role
|
||||||
|
reason: Reason
|
||||||
provide_your_email_to_start: Provide your email to start
|
provide_your_email_to_start: Provide your email to start
|
||||||
start: Start
|
start: Start
|
||||||
starting: Starting
|
starting: Starting
|
||||||
@@ -64,6 +65,7 @@ en: &en
|
|||||||
|
|
||||||
es: &es
|
es: &es
|
||||||
role: Rol
|
role: Rol
|
||||||
|
reason: Razón
|
||||||
verification_code_code: 'Código de verificación: %{code}'
|
verification_code_code: 'Código de verificación: %{code}'
|
||||||
email: Correo electrónico
|
email: Correo electrónico
|
||||||
digitally_signed_by: Firmado digitalmente por
|
digitally_signed_by: Firmado digitalmente por
|
||||||
@@ -106,6 +108,7 @@ es: &es
|
|||||||
|
|
||||||
it: &it
|
it: &it
|
||||||
role: Rôle
|
role: Rôle
|
||||||
|
reason: Ragione
|
||||||
verification_code_code: 'Codice di verifica: %{code}'
|
verification_code_code: 'Codice di verifica: %{code}'
|
||||||
email: Email
|
email: Email
|
||||||
digitally_signed_by: Firmato digitalmente da
|
digitally_signed_by: Firmato digitalmente da
|
||||||
@@ -149,6 +152,7 @@ fr: &fr
|
|||||||
email: Email
|
email: Email
|
||||||
verification_code_code: 'Code de vérification: %{code}'
|
verification_code_code: 'Code de vérification: %{code}'
|
||||||
digitally_signed_by: Signé numériquement par
|
digitally_signed_by: Signé numériquement par
|
||||||
|
reason: Raison
|
||||||
role: Rôle
|
role: Rôle
|
||||||
provide_your_email_to_start: Entrez votre adresse email pour commencer
|
provide_your_email_to_start: Entrez votre adresse email pour commencer
|
||||||
start: Démarrer
|
start: Démarrer
|
||||||
@@ -189,6 +193,7 @@ fr: &fr
|
|||||||
pt: &pt
|
pt: &pt
|
||||||
role: Função
|
role: Função
|
||||||
email: Email
|
email: Email
|
||||||
|
reason: Razão
|
||||||
verification_code_code: 'Código de verificação: %{code}'
|
verification_code_code: 'Código de verificação: %{code}'
|
||||||
digitally_signed_by: Assinado digitalmente por
|
digitally_signed_by: Assinado digitalmente por
|
||||||
role: Função
|
role: Função
|
||||||
@@ -230,6 +235,7 @@ pt: &pt
|
|||||||
de: &de
|
de: &de
|
||||||
role: Rolle
|
role: Rolle
|
||||||
verification_code_code: 'Verifizierungscode: %{code}'
|
verification_code_code: 'Verifizierungscode: %{code}'
|
||||||
|
reason: Grund
|
||||||
email: E-Mail
|
email: E-Mail
|
||||||
digitally_signed_by: Digital signiert von
|
digitally_signed_by: Digital signiert von
|
||||||
role: Rolle
|
role: Rolle
|
||||||
@@ -275,6 +281,7 @@ pl:
|
|||||||
role: Rola
|
role: Rola
|
||||||
provide_your_email_to_start: Podaj swój adres email, aby rozpocząć
|
provide_your_email_to_start: Podaj swój adres email, aby rozpocząć
|
||||||
start: Rozpocznij
|
start: Rozpocznij
|
||||||
|
reason: Powód
|
||||||
starting: Rozpoczynanie
|
starting: Rozpoczynanie
|
||||||
form_has_been_deleted_by_html: 'Formularz został usunięty przez <span class="font-semibold">%{name}</span>.'
|
form_has_been_deleted_by_html: 'Formularz został usunięty przez <span class="font-semibold">%{name}</span>.'
|
||||||
invited_by_html: 'Zaproszony przez <span class="font-semibold">%{name}</span>'
|
invited_by_html: 'Zaproszony przez <span class="font-semibold">%{name}</span>'
|
||||||
@@ -315,6 +322,7 @@ uk:
|
|||||||
role: Роль
|
role: Роль
|
||||||
provide_your_email_to_start: Введіть свій email, щоб почати
|
provide_your_email_to_start: Введіть свій email, щоб почати
|
||||||
start: Почати
|
start: Почати
|
||||||
|
reason: Причина
|
||||||
starting: Початок
|
starting: Початок
|
||||||
form_has_been_deleted_by_html: 'Форму було видалено користувачем <span class="font-semibold">%{name}</span>.'
|
form_has_been_deleted_by_html: 'Форму було видалено користувачем <span class="font-semibold">%{name}</span>.'
|
||||||
invited_by_html: 'Запрошений користувачем <span class="font-semibold">%{name}</span>'
|
invited_by_html: 'Запрошений користувачем <span class="font-semibold">%{name}</span>'
|
||||||
@@ -354,6 +362,7 @@ cs:
|
|||||||
verification_code_code: 'Ověřovací kód: %{code}'
|
verification_code_code: 'Ověřovací kód: %{code}'
|
||||||
role: Role
|
role: Role
|
||||||
provide_your_email_to_start: Zadejte svůj email pro zahájení
|
provide_your_email_to_start: Zadejte svůj email pro zahájení
|
||||||
|
reason: Důvod
|
||||||
start: Zahájit
|
start: Zahájit
|
||||||
starting: Zahajování
|
starting: Zahajování
|
||||||
form_has_been_deleted_by_html: 'Formulář byl smazán uživatelem <span class="font-semibold">%{name}</span>.'
|
form_has_been_deleted_by_html: 'Formulář byl smazán uživatelem <span class="font-semibold">%{name}</span>.'
|
||||||
@@ -392,6 +401,7 @@ he:
|
|||||||
email: דוא"ל
|
email: דוא"ל
|
||||||
digitally_signed_by: חתום דיגיטלית על ידי
|
digitally_signed_by: חתום דיגיטלית על ידי
|
||||||
role: תפקיד
|
role: תפקיד
|
||||||
|
reason: סיבה
|
||||||
verification_code_code: 'קוד אימות: %{code}'
|
verification_code_code: 'קוד אימות: %{code}'
|
||||||
provide_your_email_to_start: ספק את כתובת הדוא"ל שלך כדי להתחיל
|
provide_your_email_to_start: ספק את כתובת הדוא"ל שלך כדי להתחיל
|
||||||
start: התחל
|
start: התחל
|
||||||
@@ -435,6 +445,7 @@ nl:
|
|||||||
verification_code_code: 'Verificatiecode: %{code}'
|
verification_code_code: 'Verificatiecode: %{code}'
|
||||||
provide_your_email_to_start: Geef uw e-mailadres om te beginnen
|
provide_your_email_to_start: Geef uw e-mailadres om te beginnen
|
||||||
start: Start
|
start: Start
|
||||||
|
reason: Reden
|
||||||
starting: Starten
|
starting: Starten
|
||||||
form_has_been_deleted_by_html: 'Formulier is verwijderd door <span class="font-semibold">%{name}</span>.'
|
form_has_been_deleted_by_html: 'Formulier is verwijderd door <span class="font-semibold">%{name}</span>.'
|
||||||
invited_by_html: 'Uitgenodigd door <span class="font-semibold">%{name}</span>'
|
invited_by_html: 'Uitgenodigd door <span class="font-semibold">%{name}</span>'
|
||||||
@@ -478,6 +489,7 @@ ar:
|
|||||||
starting: بداية
|
starting: بداية
|
||||||
verification_code_code: 'رمز التحقق: %{code}'
|
verification_code_code: 'رمز التحقق: %{code}'
|
||||||
form_has_been_deleted_by_html: 'تم حذف الاستمارة بواسطة <span class="font-semibold">%{name}</span>.'
|
form_has_been_deleted_by_html: 'تم حذف الاستمارة بواسطة <span class="font-semibold">%{name}</span>.'
|
||||||
|
reason: سبب
|
||||||
invited_by_html: 'تمت الدعوة بواسطة <span class="font-semibold">%{name}</span>'
|
invited_by_html: 'تمت الدعوة بواسطة <span class="font-semibold">%{name}</span>'
|
||||||
you_have_been_invited_to_submit_a_form: تمت دعوتك لتقديم استمارة
|
you_have_been_invited_to_submit_a_form: تمت دعوتك لتقديم استمارة
|
||||||
signed_on_time: 'تم التوقيع في %{time}'
|
signed_on_time: 'تم التوقيع في %{time}'
|
||||||
@@ -516,6 +528,7 @@ ko:
|
|||||||
role: 역할
|
role: 역할
|
||||||
provide_your_email_to_start: 시작하려면 이메일을 제공하세요
|
provide_your_email_to_start: 시작하려면 이메일을 제공하세요
|
||||||
start: 시작
|
start: 시작
|
||||||
|
reason: 이유
|
||||||
starting: 시작 중
|
starting: 시작 중
|
||||||
form_has_been_deleted_by_html: '<span class="font-semibold">%{name}</span>에 의해 양식이 삭제되었습니다.'
|
form_has_been_deleted_by_html: '<span class="font-semibold">%{name}</span>에 의해 양식이 삭제되었습니다.'
|
||||||
invited_by_html: '<span class="font-semibold">%{name}</span>에 의해 초대되었습니다.'
|
invited_by_html: '<span class="font-semibold">%{name}</span>에 의해 초대되었습니다.'
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ module Submissions
|
|||||||
.rectangle(0, 0, box.width, 20)
|
.rectangle(0, 0, box.width, 20)
|
||||||
.rectangle(0, box.height - 20, box.width, 20)
|
.rectangle(0, box.height - 20, box.width, 20)
|
||||||
.fill
|
.fill
|
||||||
|
|
||||||
|
maybe_add_background(canvas, submission, page_size)
|
||||||
end
|
end
|
||||||
style.frame = style.create_frame(canvas.context, 50)
|
style.frame = style.create_frame(canvas.context, 50)
|
||||||
end
|
end
|
||||||
@@ -336,6 +338,8 @@ module Submissions
|
|||||||
'Signed with DocuSeal.co'
|
'Signed with DocuSeal.co'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def maybe_add_background(_canvas, _submission, _page_size); end
|
||||||
|
|
||||||
def add_logo(column, _submission = nil)
|
def add_logo(column, _submission = nil)
|
||||||
column.image(PdfIcons.logo_io, width: 40, height: 40, position: :float)
|
column.image(PdfIcons.logo_io, width: 40, height: 40, position: :float)
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ module Submissions
|
|||||||
def generate_pdfs(submitter)
|
def generate_pdfs(submitter)
|
||||||
cell_layouter = HexaPDF::Layout::TextLayouter.new(text_valign: :center, text_align: :center)
|
cell_layouter = HexaPDF::Layout::TextLayouter.new(text_valign: :center, text_align: :center)
|
||||||
|
|
||||||
|
with_signature_id = submitter.account.account_configs
|
||||||
|
.exists?(key: AccountConfig::WITH_SIGNATURE_ID, value: true)
|
||||||
|
|
||||||
is_flatten =
|
is_flatten =
|
||||||
submitter.account.account_configs
|
submitter.account.account_configs
|
||||||
.find_or_initialize_by(key: AccountConfig::FLATTEN_RESULT_PDF_KEY).value != false
|
.find_or_initialize_by(key: AccountConfig::FLATTEN_RESULT_PDF_KEY).value != false
|
||||||
@@ -97,6 +100,22 @@ module Submissions
|
|||||||
|
|
||||||
pdfs_index = build_pdfs_index(submitter, flatten: is_flatten)
|
pdfs_index = build_pdfs_index(submitter, flatten: is_flatten)
|
||||||
|
|
||||||
|
if with_signature_id
|
||||||
|
pdfs_index.each_value do |pdf|
|
||||||
|
next if pdf.trailer.info[:DocumentID].present?
|
||||||
|
|
||||||
|
pdf.trailer.info[:DocumentID] = Digest::MD5.hexdigest(submitter.submission.slug).upcase
|
||||||
|
pdf.pages.each do |page|
|
||||||
|
font_size = (([page.box.width, page.box.height].min / A4_SIZE[0].to_f) * 9).to_i
|
||||||
|
cnv = page.canvas(type: :overlay)
|
||||||
|
|
||||||
|
cnv.font(FONT_NAME, size: font_size)
|
||||||
|
cnv.text("Document ID: #{Digest::MD5.hexdigest(submitter.submission.slug).upcase}",
|
||||||
|
at: [2, 4])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
submitter.submission.template_fields.each do |field|
|
submitter.submission.template_fields.each do |field|
|
||||||
next if field['submitter_uuid'] != submitter.uuid
|
next if field['submitter_uuid'] != submitter.uuid
|
||||||
|
|
||||||
@@ -150,6 +169,69 @@ module Submissions
|
|||||||
canvas.font(FONT_NAME, size: font_size)
|
canvas.font(FONT_NAME, size: font_size)
|
||||||
|
|
||||||
case field['type']
|
case field['type']
|
||||||
|
when ->(type) { type == 'signature' && with_signature_id }
|
||||||
|
attachment = submitter.attachments.find { |a| a.uuid == value }
|
||||||
|
|
||||||
|
attachments_data_cache[attachment.uuid] ||= attachment.download
|
||||||
|
|
||||||
|
image = Vips::Image.new_from_buffer(attachments_data_cache[attachment.uuid], '').autorot
|
||||||
|
|
||||||
|
id_string = "ID: #{attachment.uuid}".upcase
|
||||||
|
|
||||||
|
while true
|
||||||
|
text = HexaPDF::Layout::TextFragment.create(id_string,
|
||||||
|
font:,
|
||||||
|
font_size: (font_size / 1.8).to_i)
|
||||||
|
|
||||||
|
result = layouter.fit([text], area['w'] * width, (font_size / 1.8) / 0.65)
|
||||||
|
|
||||||
|
break if result.status == :success
|
||||||
|
|
||||||
|
id_string = "#{id_string.delete_suffix('...')[0..-2]}..."
|
||||||
|
|
||||||
|
break if id_string.length < 8
|
||||||
|
end
|
||||||
|
|
||||||
|
reason_string =
|
||||||
|
"#{I18n.t('reason')}: #{I18n.t('digitally_signed_by')} " \
|
||||||
|
"#{submitter.name}#{submitter.email.present? ? " <#{submitter.email}>" : ''}\n" \
|
||||||
|
"#{I18n.l(attachment.created_at.in_time_zone(submitter.account.timezone),
|
||||||
|
format: :long, locale: submitter.account.locale)} " \
|
||||||
|
"#{TimeUtils.timezone_abbr(submitter.account.timezone, attachment.created_at)}"
|
||||||
|
|
||||||
|
reason_text = HexaPDF::Layout::TextFragment.create(reason_string,
|
||||||
|
font:,
|
||||||
|
font_size: (font_size / 1.8).to_i)
|
||||||
|
|
||||||
|
reason_result = layouter.fit([reason_text], area['w'] * width, height)
|
||||||
|
|
||||||
|
text_height = result.lines.sum(&:height) + reason_result.lines.sum(&:height)
|
||||||
|
|
||||||
|
image_height = (area['h'] * height) - text_height
|
||||||
|
image_height = (area['h'] * height) / 2 if image_height < (area['h'] * height) / 2
|
||||||
|
|
||||||
|
scale = [(area['w'] * width) / image.width, image_height / image.height].min
|
||||||
|
|
||||||
|
io = StringIO.new(image.resize([scale * 4, 1].select(&:positive?).min).write_to_buffer('.png'))
|
||||||
|
|
||||||
|
layouter.fit([text], area['w'] * width, (font_size / 1.8) / 0.65)
|
||||||
|
.draw(canvas, (area['x'] * width) + TEXT_LEFT_MARGIN,
|
||||||
|
height - (area['y'] * height) - TEXT_TOP_MARGIN - image_height)
|
||||||
|
|
||||||
|
layouter.fit([reason_text], area['w'] * width, reason_result.lines.sum(&:height))
|
||||||
|
.draw(canvas, (area['x'] * width) + TEXT_LEFT_MARGIN,
|
||||||
|
height - (area['y'] * height) - TEXT_TOP_MARGIN -
|
||||||
|
result.lines.sum(&:height) - image_height)
|
||||||
|
|
||||||
|
canvas.image(
|
||||||
|
io,
|
||||||
|
at: [
|
||||||
|
(area['x'] * width) + (area['w'] * width / 2) - ((image.width * scale) / 2),
|
||||||
|
height - (area['y'] * height) - (image.height * scale / 2) - (image_height / 2)
|
||||||
|
],
|
||||||
|
width: image.width * scale,
|
||||||
|
height: image.height * scale
|
||||||
|
)
|
||||||
when 'image', 'signature', 'initials', 'stamp'
|
when 'image', 'signature', 'initials', 'stamp'
|
||||||
attachment = submitter.attachments.find { |a| a.uuid == value }
|
attachment = submitter.attachments.find { |a| a.uuid == value }
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ module Submitters
|
|||||||
AccountConfig::FORM_COMPLETED_MESSAGE_KEY,
|
AccountConfig::FORM_COMPLETED_MESSAGE_KEY,
|
||||||
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
||||||
AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
|
AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
|
||||||
|
AccountConfig::WITH_SIGNATURE_ID,
|
||||||
AccountConfig::ALLOW_TYPED_SIGNATURE].freeze
|
AccountConfig::ALLOW_TYPED_SIGNATURE].freeze
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
@@ -18,8 +19,14 @@ module Submitters
|
|||||||
with_typed_signature = find_safe_value(configs, AccountConfig::ALLOW_TYPED_SIGNATURE) != false
|
with_typed_signature = find_safe_value(configs, AccountConfig::ALLOW_TYPED_SIGNATURE) != false
|
||||||
with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) != false
|
with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) != false
|
||||||
prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false
|
prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false
|
||||||
|
with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true
|
||||||
|
|
||||||
attrs = { completed_button:, with_typed_signature:, with_confetti:, completed_message:, prefill_signature: }
|
attrs = { completed_button:,
|
||||||
|
with_typed_signature:,
|
||||||
|
with_confetti:,
|
||||||
|
completed_message:,
|
||||||
|
prefill_signature:,
|
||||||
|
with_signature_id: }
|
||||||
|
|
||||||
keys.each do |key|
|
keys.each do |key|
|
||||||
attrs[key.to_sym] = configs.find { |e| e.key == key.to_s }&.value
|
attrs[key.to_sym] = configs.find { |e| e.key == key.to_s }&.value
|
||||||
|
|||||||
Reference in New Issue
Block a user