private template placeholder

pull/381/merge
Pete Matsyburka 2 months ago
parent 0df0946c2a
commit d805fd614c

@ -26,6 +26,8 @@ module Api
original_template: @template, original_template: @template,
documents: params[:documents]) documents: params[:documents])
Templates.maybe_assign_access(cloned_template)
cloned_template.save! cloned_template.save!
WebhookUrls.enqueue_events(cloned_template, 'template.created') WebhookUrls.enqueue_events(cloned_template, 'template.created')

@ -17,6 +17,8 @@ class TemplatesCloneAndReplaceController < ApplicationController
documents = Templates::ReplaceAttachments.call(cloned_template, params, extract_fields: true) documents = Templates::ReplaceAttachments.call(cloned_template, params, extract_fields: true)
Templates.maybe_assign_access(cloned_template)
cloned_template.save! cloned_template.save!
Templates::CloneAttachments.call(template: cloned_template, original_template: @template, Templates::CloneAttachments.call(template: cloned_template, original_template: @template,

@ -69,6 +69,8 @@ class TemplatesController < ApplicationController
@template.account = current_account @template.account = current_account
end end
Templates.maybe_assign_access(@template)
if @template.save if @template.save
Templates::CloneAttachments.call(template: @template, original_template: @base_template) if @base_template Templates::CloneAttachments.call(template: @template, original_template: @base_template) if @base_template

@ -46,6 +46,8 @@ class TemplatesUploadsController < ApplicationController
template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:folder_name]) template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:folder_name])
template.name = File.basename((url_params || params)[:files].first.original_filename, '.*') template.name = File.basename((url_params || params)[:files].first.original_filename, '.*')
Templates.maybe_assign_access(template)
template.save! template.save!
template template

@ -36,6 +36,7 @@ en: &en
bcc_recipients: BCC recipients bcc_recipients: BCC recipients
resend_pending: Re-send pending resend_pending: Re-send pending
always_enforce_signing_order: Always enforce the signing order always_enforce_signing_order: Always enforce the signing order
create_templates_with_private_access_by_default: Create templates with private access by default
ensure_unique_recipients: Ensure unique recipients ensure_unique_recipients: Ensure unique recipients
edit_per_party: Edit per party edit_per_party: Edit per party
reply_to: Reply to reply_to: Reply to
@ -900,6 +901,7 @@ en: &en
range_without_total: "%{from}-%{to} events" range_without_total: "%{from}-%{to} events"
es: &es es: &es
create_templates_with_private_access_by_default: Crear plantillas con acceso privado por defecto
party: Parte party: Parte
edit_order: Edita Pedido edit_order: Edita Pedido
select: Seleccionar select: Seleccionar
@ -1780,6 +1782,7 @@ es: &es
range_without_total: "%{from}-%{to} eventos" range_without_total: "%{from}-%{to} eventos"
it: &it it: &it
create_templates_with_private_access_by_default: Crea modelli con accesso privato per impostazione predefinita
party: Parte party: Parte
edit_order: Modifica Ordine edit_order: Modifica Ordine
select: Seleziona select: Seleziona
@ -2660,6 +2663,7 @@ it: &it
range_without_total: "%{from}-%{to} eventi" range_without_total: "%{from}-%{to} eventi"
fr: &fr fr: &fr
create_templates_with_private_access_by_default: Créer des modèles avec un accès privé par défaut
party: Partie party: Partie
edit_order: Modifier la commande edit_order: Modifier la commande
select: Sélectionner select: Sélectionner
@ -3543,6 +3547,7 @@ fr: &fr
range_without_total: "%{from} à %{to} événements" range_without_total: "%{from} à %{to} événements"
pt: &pt pt: &pt
create_templates_with_private_access_by_default: Criar modelos com acesso privado por padrão
party: Parte party: Parte
edit_order: Edita Pedido edit_order: Edita Pedido
select: Selecionar select: Selecionar
@ -4424,6 +4429,7 @@ pt: &pt
range_without_total: "%{from}-%{to} eventos" range_without_total: "%{from}-%{to} eventos"
de: &de de: &de
create_templates_with_private_access_by_default: Vorlagen standardmäßig mit privatem Zugriff erstellen
party: Partei party: Partei
edit_order: Bestellung bearbeiten edit_order: Bestellung bearbeiten
select: Auswählen select: Auswählen

@ -37,6 +37,10 @@ module Templates
hash hash
end end
def maybe_assign_access(_template)
nil
end
def search(current_user, templates, keyword) def search(current_user, templates, keyword)
if Docuseal.fulltext_search? if Docuseal.fulltext_search?
fulltext_search(current_user, templates, keyword) fulltext_search(current_user, templates, keyword)

Loading…
Cancel
Save