mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1daee8214c | ||
|
|
9cc85595e3 |
No files matched your search
@@ -195,6 +195,13 @@
|
|||||||
>
|
>
|
||||||
<template v-if="isAnonymousChecboxes">
|
<template v-if="isAnonymousChecboxes">
|
||||||
Complete hightlighted checkboxes and click <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? 'submit' : 'next' }}</span>.
|
Complete hightlighted checkboxes and click <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? 'submit' : 'next' }}</span>.
|
||||||
|
<input
|
||||||
|
v-for="field in currentStepFields"
|
||||||
|
:key="field.uuid"
|
||||||
|
type="hidden"
|
||||||
|
:name="`values[${field.uuid}]`"
|
||||||
|
:value="!!values[field.uuid]"
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ module Submissions
|
|||||||
|
|
||||||
width = page.box.width
|
width = page.box.width
|
||||||
height = page.box.height
|
height = page.box.height
|
||||||
|
font_size = ((page.box.width / A4_SIZE[0].to_f) * FONT_SIZE).to_i
|
||||||
|
|
||||||
value = submitter.values[field['uuid']]
|
value = submitter.values[field['uuid']]
|
||||||
|
|
||||||
@@ -70,13 +71,13 @@ module Submissions
|
|||||||
items = Array.wrap(value).each_with_object([]) do |uuid, acc|
|
items = Array.wrap(value).each_with_object([]) do |uuid, acc|
|
||||||
attachment = submitter.attachments.find { |a| a.uuid == uuid }
|
attachment = submitter.attachments.find { |a| a.uuid == uuid }
|
||||||
|
|
||||||
acc << HexaPDF::Layout::InlineBox.create(width: FONT_SIZE, height: FONT_SIZE,
|
acc << HexaPDF::Layout::InlineBox.create(width: font_size, height: font_size,
|
||||||
margin: [0, 1, -2, 0]) do |cv, box|
|
margin: [0, 1, -2, 0]) do |cv, box|
|
||||||
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: pdf.fonts.add(FONT_NAME),
|
acc << HexaPDF::Layout::TextFragment.create("#{attachment.filename}\n", font: pdf.fonts.add(FONT_NAME),
|
||||||
font_size: FONT_SIZE)
|
font_size:)
|
||||||
end
|
end
|
||||||
|
|
||||||
lines = layouter.fit(items, area['w'] * width, height).lines
|
lines = layouter.fit(items, area['w'] * width, height).lines
|
||||||
@@ -132,7 +133,7 @@ module Submissions
|
|||||||
|
|
||||||
value.chars.each_with_index do |char, index|
|
value.chars.each_with_index do |char, index|
|
||||||
text = HexaPDF::Layout::TextFragment.create(char, font: pdf.fonts.add(FONT_NAME),
|
text = HexaPDF::Layout::TextFragment.create(char, font: pdf.fonts.add(FONT_NAME),
|
||||||
font_size: FONT_SIZE)
|
font_size:)
|
||||||
|
|
||||||
cell_layouter.fit([text], cell_width, area['h'] * height)
|
cell_layouter.fit([text], cell_width, area['h'] * height)
|
||||||
.draw(canvas, ((area['x'] * width) + (cell_width * index)),
|
.draw(canvas, ((area['x'] * width) + (cell_width * index)),
|
||||||
@@ -142,7 +143,7 @@ module Submissions
|
|||||||
value = I18n.l(Date.parse(value), format: :long) if field['type'] == 'date'
|
value = I18n.l(Date.parse(value), format: :long) if field['type'] == 'date'
|
||||||
|
|
||||||
text = HexaPDF::Layout::TextFragment.create(Array.wrap(value).join(', '), font: pdf.fonts.add(FONT_NAME),
|
text = HexaPDF::Layout::TextFragment.create(Array.wrap(value).join(', '), font: pdf.fonts.add(FONT_NAME),
|
||||||
font_size: FONT_SIZE)
|
font_size:)
|
||||||
|
|
||||||
lines = layouter.fit([text], area['w'] * width, height).lines
|
lines = layouter.fit([text], area['w'] * width, height).lines
|
||||||
box_height = lines.sum(&:height)
|
box_height = lines.sum(&:height)
|
||||||
|
|||||||
Reference in new issue
Block a user