mirror of
https://github.com/docusealco/docuseal
synced 2026-11-08 07:42:32 -05:00
fix RTL reverse
This commit is contained in:
1 parent
113b61588b
commit
4e4354af99
2 files changed
+22
-9
No files matched your search
@@ -219,7 +219,7 @@ module Submissions
|
|||||||
|
|
||||||
[
|
[
|
||||||
composer.document.layout.formatted_text_box(
|
composer.document.layout.formatted_text_box(
|
||||||
[{ text: document.filename.to_s }]
|
[{ text: TextUtils.maybe_rtl_reverse(document.filename.to_s) }]
|
||||||
),
|
),
|
||||||
composer.document.layout.formatted_text_box(
|
composer.document.layout.formatted_text_box(
|
||||||
[
|
[
|
||||||
@@ -272,7 +272,9 @@ module Submissions
|
|||||||
[
|
[
|
||||||
composer.document.layout.formatted_text_box(
|
composer.document.layout.formatted_text_box(
|
||||||
[
|
[
|
||||||
submission.template_submitters.size > 1 && { text: "#{item['name']}\n" },
|
submission.template_submitters.size > 1 && {
|
||||||
|
text: "#{TextUtils.maybe_rtl_reverse(item['name'].to_s)}\n"
|
||||||
|
},
|
||||||
submitter.email && { text: "#{submitter.email}\n", font: [FONT_NAME, { variant: :bold }] },
|
submitter.email && { text: "#{submitter.email}\n", font: [FONT_NAME, { variant: :bold }] },
|
||||||
submitter.name && { text: "#{TextUtils.maybe_rtl_reverse(submitter.name)}\n" },
|
submitter.name && { text: "#{TextUtils.maybe_rtl_reverse(submitter.name)}\n" },
|
||||||
submitter.phone && { text: "#{submitter.phone}\n" }
|
submitter.phone && { text: "#{submitter.phone}\n" }
|
||||||
@@ -425,7 +427,7 @@ module Submissions
|
|||||||
r.submissions_preview_url(submission.slug, **Docuseal.default_url_options)
|
r.submissions_preview_url(submission.slug, **Docuseal.default_url_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
{ link:, text: "#{attachment.filename}\n", style: :link }
|
{ link:, text: "#{TextUtils.maybe_rtl_reverse(attachment.filename.to_s)}\n", style: :link }
|
||||||
end,
|
end,
|
||||||
padding: [0, 0, 10, 0]
|
padding: [0, 0, 10, 0]
|
||||||
)
|
)
|
||||||
@@ -476,6 +478,8 @@ module Submissions
|
|||||||
submitter.name || submitter.email || submitter.phone
|
submitter.name || submitter.email || submitter.phone
|
||||||
end
|
end
|
||||||
|
|
||||||
|
submitter_name = TextUtils.maybe_rtl_reverse(submitter_name.to_s)
|
||||||
|
|
||||||
text =
|
text =
|
||||||
if event.event_type == 'complete_verification'
|
if event.event_type == 'complete_verification'
|
||||||
I18n.t('submission_event_names.complete_verification_by_html', provider: event.data['method'],
|
I18n.t('submission_event_names.complete_verification_by_html', provider: event.data['method'],
|
||||||
@@ -483,18 +487,22 @@ module Submissions
|
|||||||
elsif event.event_type == 'invite_party' &&
|
elsif event.event_type == 'invite_party' &&
|
||||||
(invited_submitter = submission.submitters.find { |e| e.uuid == event.data['uuid'] }) &&
|
(invited_submitter = submission.submitters.find { |e| e.uuid == event.data['uuid'] }) &&
|
||||||
(name = submission.template_submitters.find { |e| e['uuid'] == event.data['uuid'] }&.dig('name'))
|
(name = submission.template_submitters.find { |e| e['uuid'] == event.data['uuid'] }&.dig('name'))
|
||||||
invited_submitter_name = [invited_submitter.name || invited_submitter.email || invited_submitter.phone,
|
invited_submitter_name = TextUtils.maybe_rtl_reverse(
|
||||||
name].join(' ')
|
[invited_submitter.name || invited_submitter.email || invited_submitter.phone, name].join(' ')
|
||||||
|
)
|
||||||
I18n.t('submission_event_names.invite_party_by_html', invited_submitter_name:,
|
I18n.t('submission_event_names.invite_party_by_html', invited_submitter_name:,
|
||||||
submitter_name:)
|
submitter_name:)
|
||||||
elsif with_audit_sender && (event.event_type == 'send_email' || event.event_type == 'send_sms')
|
elsif with_audit_sender && (event.event_type == 'send_email' || event.event_type == 'send_sms')
|
||||||
|
created_by_name = TextUtils.maybe_rtl_reverse(submission.created_by_user.full_name)
|
||||||
|
|
||||||
[
|
[
|
||||||
I18n.t("submission_event_names.#{event.event_type}_to_html", submitter_name:),
|
I18n.t("submission_event_names.#{event.event_type}_to_html", submitter_name:),
|
||||||
"<b>#{I18n.t(:from)}</b> #{submission.created_by_user.full_name} #{submission.created_by_user.email}"
|
"<b>#{I18n.t(:from)}</b> #{created_by_name} #{submission.created_by_user.email}"
|
||||||
].join("\n")
|
].join("\n")
|
||||||
elsif event.event_type == 'delegate_form'
|
elsif event.event_type == 'delegate_form'
|
||||||
from = event.data['old_email'].presence ||
|
from = event.data['old_email'].presence ||
|
||||||
versions.rfind { |v| v.created_at <= event.event_timestamp }&.then { |v| v.name || v.phone }
|
versions.rfind { |v| v.created_at <= event.event_timestamp }&.then { |v| v.name || v.phone }
|
||||||
|
from = TextUtils.maybe_rtl_reverse(from.to_s)
|
||||||
I18n.t('submission_event_names.delegate_form_by_html', from:, to: event.data['email'])
|
I18n.t('submission_event_names.delegate_form_by_html', from:, to: event.data['email'])
|
||||||
elsif event.event_type.include?('send_')
|
elsif event.event_type.include?('send_')
|
||||||
I18n.t("submission_event_names.#{event.event_type}_to_html", submitter_name:)
|
I18n.t("submission_event_names.#{event.event_type}_to_html", submitter_name:)
|
||||||
|
|||||||
@@ -346,8 +346,11 @@ module Submissions
|
|||||||
(with_signature_id_completed_at ? submitter.completed_at : nil) || attachment.created_at
|
(with_signature_id_completed_at ? submitter.completed_at : nil) || attachment.created_at
|
||||||
|
|
||||||
if with_signature_id_reason || field.dig('preferences', 'reasons').present?
|
if with_signature_id_reason || field.dig('preferences', 'reasons').present?
|
||||||
"#{"#{I18n.t('reason')}: " if reason_value}#{reason_value || I18n.t('digitally_signed_by')} " \
|
reason_line =
|
||||||
"#{submitter.name}#{" <#{submitter.email}>" if submitter.email.present?}\n" \
|
"#{"#{I18n.t('reason')}: " if reason_value}#{reason_value || I18n.t('digitally_signed_by')} " \
|
||||||
|
"#{submitter.name}#{" <#{submitter.email}>" if submitter.email.present?}"
|
||||||
|
|
||||||
|
"#{TextUtils.maybe_rtl_reverse(reason_line)}\n" \
|
||||||
"#{I18n.l(signature_timestamp.in_time_zone(timezone), format: time_format)} " \
|
"#{I18n.l(signature_timestamp.in_time_zone(timezone), format: time_format)} " \
|
||||||
"#{TimeUtils.timezone_abbr(timezone, signature_timestamp)}"
|
"#{TimeUtils.timezone_abbr(timezone, signature_timestamp)}"
|
||||||
else
|
else
|
||||||
@@ -509,7 +512,9 @@ module Submissions
|
|||||||
cv.image(PdfIcons.paperclip_io, at: [0, 0], width: box.content_width)
|
cv.image(PdfIcons.paperclip_io, at: [0, 0], width: box.content_width)
|
||||||
end
|
end
|
||||||
|
|
||||||
acc << HexaPDF::Layout::TextFragment.create("#{attachment.filename}\n", font:, font_size:)
|
acc << HexaPDF::Layout::TextFragment.create(
|
||||||
|
"#{TextUtils.maybe_rtl_reverse(attachment.filename.to_s)}\n", font:, font_size:
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
lines = layouter.fit(items, area['w'] * width, height).lines
|
lines = layouter.fit(items, area['w'] * width, height).lines
|
||||||
|
|||||||
Reference in new issue
Block a user