Skip to content

Commit

Permalink
[WIP] Converting next steps to use same fonts as web page
Browse files Browse the repository at this point in the history
  • Loading branch information
opticbob committed Sep 4, 2024
1 parent 26a6a25 commit 006051a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,24 @@ def next_steps_contact(_pdf, _data)
end

def next_steps_part1(pdf)

Check failure on line 57 in modules/representation_management/lib/representation_management/v0/pdf_constructor/base.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Metrics/MethodLength: Method has too many lines. [22/20]
pdf.font_size(20)
pdf.text('Fill out your form to appoint a VA accredited representative or VSO')
pdf.move_down(10)
pdf.font_size(12)
pdf.text('VA Form 21-22a')
pdf.move_down(10)
pdf.font_size(16)
pdf.text('Your Next Steps')
pdf.move_down(10)
pdf.font_size(12)
# TODO: - Add a method that takes a text string then adds it to the pdf,
# moves down 10, and sets the font size to 12
pdf.font('bitter', style: :bold) do
pdf.font_size(20)
pdf.text('Fill out your form to appoint a VA accredited representative or VSO')
pdf.move_down(10)
end
pdf.font('bitter', style: :normal) do
pdf.font_size(12)
pdf.text('VA Form 21-22a')
pdf.move_down(10)
end
pdf.font('bitter', style: :bold) do
pdf.font_size(16)
pdf.text('Your Next Steps')
pdf.move_down(10)
pdf.font_size(12)
end
str = <<~HEREDOC.squish
Both you and the accredited representative will need to sign your form.
You can bring your form to them in person or mail it to them.
Expand All @@ -81,9 +89,11 @@ def next_steps_part2(pdf)
HEREDOC
pdf.text(str)
pdf.move_down(10)
pdf.font_size(16)
pdf.text('After you submit your printed form')
pdf.move_down(10)
pdf.font('bitter', style: :bold) do
pdf.font_size(16)
pdf.text('After you submit your printed form')
pdf.move_down(10)
end
pdf.font_size(12)
str = <<~HEREDOC.squish
We'll confirm that the accredited representative is available to help you.
Expand All @@ -100,9 +110,11 @@ def next_steps_part3(pdf)
HEREDOC
pdf.text(str)
pdf.move_down(10)
pdf.font_size(14)
pdf.text('Need help?')
pdf.move_down(10)
pdf.font('bitter', style: :bold) do
pdf.font_size(14)
pdf.text('Need help?')
pdf.move_down(10)
end
pdf.font_size(12)
pdf.text("You can call us at 800-698-2411, ext. 0 (TTY: 711). We're here 24/7.")
pdf.move_down(10)
Expand Down Expand Up @@ -130,6 +142,13 @@ def fill_and_combine_pdf(data)
def generate_next_steps_page(data)
tempfile = Tempfile.new
next_steps = Prawn::Document.new
next_steps.font_families.update(
'bitter' => {
# modules/health_quest/lib/fonts/bitter-regular.ttf
normal: Rails.root.join('modules', 'health_quest', 'lib', 'fonts', 'bitter-regular.ttf'),
bold: Rails.root.join('modules', 'health_quest', 'lib', 'fonts', 'bitter-bold.ttf')
}
)
next_steps_part1(next_steps)
next_steps_contact(next_steps, data)
next_steps_part2(next_steps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def next_steps_contact(pdf, data)
#{data.representative_middle_initial}
#{data.representative_last_name}
HEREDOC
pdf.text(rep_name)
pdf.font('bitter', style: :bold) do
pdf.text(rep_name)
end
pdf.text(data.representative_address_line1)
pdf.text(data.representative_address_line2)
city_state_zip = <<~HEREDOC.squish
Expand Down

0 comments on commit 006051a

Please sign in to comment.