|
|
|
|
@ -20,6 +20,11 @@ module Templates
|
|
|
|
|
Selecionar |
|
|
|
|
|
Escolher
|
|
|
|
|
)\b/ix
|
|
|
|
|
FIELD_ALIGNMENT = {
|
|
|
|
|
0 => 'left',
|
|
|
|
|
1 => 'center',
|
|
|
|
|
2 => 'right'
|
|
|
|
|
}.freeze
|
|
|
|
|
|
|
|
|
|
module_function
|
|
|
|
|
|
|
|
|
|
@ -33,6 +38,8 @@ module Templates
|
|
|
|
|
areas = Array.wrap(field[:Kids] || field).filter_map do |child_field|
|
|
|
|
|
page = annots_index[child_field.hash]
|
|
|
|
|
|
|
|
|
|
next unless page
|
|
|
|
|
|
|
|
|
|
media_box = page[:CropBox] || page[:MediaBox]
|
|
|
|
|
crop_box = page[:CropBox] || media_box
|
|
|
|
|
|
|
|
|
|
@ -124,6 +131,11 @@ module Templates
|
|
|
|
|
field[:TU] != field.full_field_name &&
|
|
|
|
|
!field[:TU].in?(SKIP_FIELD_DESCRIPTION)
|
|
|
|
|
|
|
|
|
|
if field[:Q].present? && field.field_type == :Tx
|
|
|
|
|
attrs[:preferences] ||= {}
|
|
|
|
|
attrs[:preferences][:align] = FIELD_ALIGNMENT.fetch(field[:Q], 'left')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if field.field_type == :Btn && field.concrete_field_type == :radio_button && field[:Opt].present?
|
|
|
|
|
selected_option_index = (field.allowed_values || []).find_index(field.field_value)
|
|
|
|
|
selected_option = field[:Opt][selected_option_index] if selected_option_index
|
|
|
|
|
|