add policy links to personalization settings
This commit is contained in:
committed by
Pete Matsyburka
parent
eec266ee83
commit
d25555b9b0
@@ -6,7 +6,8 @@ class PersonalizationSettingsController < ApplicationController
|
||||
AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY,
|
||||
AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY,
|
||||
AccountConfig::SUBMITTER_COMPLETED_EMAIL_KEY,
|
||||
AccountConfig::FORM_COMPLETED_MESSAGE_KEY
|
||||
AccountConfig::FORM_COMPLETED_MESSAGE_KEY,
|
||||
*(Docuseal.multitenant? ? [] : [AccountConfig::POLICY_LINKS_KEY])
|
||||
].freeze
|
||||
|
||||
InvalidKey = Class.new(StandardError)
|
||||
|
||||
@@ -44,6 +44,7 @@ class AccountConfig < ApplicationRecord
|
||||
REUSE_SIGNATURE_KEY = 'reuse_signature'
|
||||
COMBINE_PDF_RESULT_KEY = 'combine_pdf_result_key'
|
||||
DOCUMENT_FILENAME_FORMAT_KEY = 'document_filename_format'
|
||||
POLICY_LINKS_KEY = 'policy_links'
|
||||
|
||||
DEFAULT_VALUES = {
|
||||
SUBMITTER_INVITATION_EMAIL_KEY => lambda {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<% unless Docuseal.multitenant? %>
|
||||
<div class="collapse collapse-plus bg-base-200 mt-4">
|
||||
<input type="checkbox">
|
||||
<div class="collapse-title text-xl font-medium">
|
||||
<div>
|
||||
<%= t('policy_links') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse-content">
|
||||
<%= form_for AccountConfigs.find_or_initialize_for_key(current_account, AccountConfig::POLICY_LINKS_KEY), url: settings_personalization_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
|
||||
<%= f.hidden_field :key %>
|
||||
<div class="form-control">
|
||||
<autoresize-textarea>
|
||||
<%= f.text_area :value, class: 'base-input w-full py-2 font-mono', placeholder: "#{t('markdown_content_e_g')}\n[#{t('privacy_policy')}](https://example.com/privacy)" %>
|
||||
</autoresize-textarea>
|
||||
</div>
|
||||
<div class="form-control pt-2">
|
||||
<%= f.button button_title(title: t('save'), disabled_with: t('saving')), class: 'base-button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -19,6 +19,7 @@
|
||||
<div class="space-y-4">
|
||||
<%= render 'form_completed_message_form' %>
|
||||
<%= render 'form_completed_button_form' %>
|
||||
<%= render 'form_policy_links_form' %>
|
||||
</div>
|
||||
<%= render 'form_customization_settings' %>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<% values = @submitter.submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %>
|
||||
<% submitters_index = @submitter.submission.submitters.index_by(&:uuid) %>
|
||||
<% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %>
|
||||
<% policy_links_config = AccountConfigs.find_for_account(@submitter.account, AccountConfig::POLICY_LINKS_KEY) unless Docuseal.multitenant? %>
|
||||
<div style="max-height: -webkit-fill-available;">
|
||||
<div id="scrollbox">
|
||||
<div class="mx-auto block pb-72" style="max-width: 1000px">
|
||||
@@ -63,6 +64,13 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render 'shared/attribution', link_path: '/start', account: @submitter.account, with_style: false %>
|
||||
<% if policy_links_config %>
|
||||
<div class="text-center md:text-neutral-500 md:pr-3 md:pb-3 md:text-sm md:text-left mt-2 md:mt-0 md:fixed md:bottom-0 md:right-0">
|
||||
<div class="md:max-w-[8rem] flex flex-wrap md:flex-col justify-center md:justify-start md:items-start space-x-2 md:space-x-0">
|
||||
<%= auto_link(MarkdownToHtml.call(policy_links_config.value)) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -646,6 +646,9 @@ en: &en
|
||||
this_month: This month
|
||||
last_month: Last month
|
||||
this_year: This year
|
||||
policy_links: Policy Links
|
||||
markdown_content_e_g: Markdown content, e.g.
|
||||
privacy_policy: Privacy Policy
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>Email sent</b> to %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>Reminder email sent</b> to %{submitter_name}'
|
||||
@@ -1310,6 +1313,9 @@ es: &es
|
||||
this_month: Este Mes
|
||||
last_month: El Mes Pasado
|
||||
this_year: Este Año
|
||||
policy_links: Enlaces de Políticas
|
||||
markdown_content_e_g: Contenido Markdown, por ej.
|
||||
privacy_policy: Política de Privacidad
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>Correo electrónico enviado</b> a %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>Correo de recordatorio enviado</b> a %{submitter_name}'
|
||||
@@ -1974,6 +1980,9 @@ it: &it
|
||||
this_month: Questo Mese
|
||||
last_month: Mese Scorso
|
||||
this_year: "Quest'Anno"
|
||||
policy_links: Collegamenti alle Politiche
|
||||
markdown_content_e_g: Contenuto Markdown, ad es.
|
||||
privacy_policy: Politica sulla Privacy
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>E-mail inviato</b> a %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>E-mail di promemoria inviato</b> a %{submitter_name}'
|
||||
@@ -2639,6 +2648,9 @@ fr: &fr
|
||||
this_month: Ce Mois-ci
|
||||
last_month: Le Mois Dernier
|
||||
this_year: Cette Année
|
||||
policy_links: Liens des Politiques
|
||||
markdown_content_e_g: Contenu Markdown, par ex.
|
||||
privacy_policy: Politique de Confidentialité
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>E-mail envoyé</b> à %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>E-mail de rappel envoyé</b> à %{submitter_name}'
|
||||
@@ -3303,6 +3315,9 @@ pt: &pt
|
||||
this_month: Este Mês
|
||||
last_month: Mês Passado
|
||||
this_year: Este Ano
|
||||
policy_links: Links de Políticas
|
||||
markdown_content_e_g: Conteúdo Markdown, ex.
|
||||
privacy_policy: Política de Privacidade
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>E-mail enviado</b> para %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>E-mail de lembrete enviado</b> para %{submitter_name}'
|
||||
@@ -3967,6 +3982,9 @@ de: &de
|
||||
this_month: Dieser Monat
|
||||
last_month: Letzter Monat
|
||||
this_year: Dieses Jahr
|
||||
policy_links: Richtlinien-Links
|
||||
markdown_content_e_g: Markdown-Inhalt, z. B.
|
||||
privacy_policy: Datenschutzrichtlinie
|
||||
submission_event_names:
|
||||
send_email_to_html: '<b>E-Mail gesendet</b> an %{submitter_name}'
|
||||
send_reminder_email_to_html: '<b>Erinnerungs-E-Mail gesendet</b> an %{submitter_name}'
|
||||
|
||||
Reference in New Issue
Block a user