diff --git a/app/models/daily_packet.rb b/app/models/daily_packet.rb index e36f993..9cc1c07 100644 --- a/app/models/daily_packet.rb +++ b/app/models/daily_packet.rb @@ -12,7 +12,7 @@ class DailyPacket < ApplicationRecord validates :reading_list_pace, presence: true def built_on_phrase - "#{built_on.to_fs}, week #{built_on.cweek}" + "#{built_on.to_fs}\nweek #{built_on.cweek}" end def feedbin_oldest_phrase @@ -23,6 +23,10 @@ def feedbin_unread_phrase "unread: #{feedbin_unread_count}" end + def headline_phrase + "Daily Packet ##{id}" + end + def reading_list_phrase "#{reading_list_pace} pages/day" end diff --git a/app/models/daily_packet/pdf_view.rb b/app/models/daily_packet/pdf_view.rb index aa90d17..8169ac8 100644 --- a/app/models/daily_packet/pdf_view.rb +++ b/app/models/daily_packet/pdf_view.rb @@ -22,11 +22,11 @@ def build end def draw_front_page - text "Daily Packet", style: :bold_italic, size: 42 + text daily_packet.headline_phrase, style: :bold_italic, size: 42 - move_up 34 + move_up 45 - text daily_packet.built_on_phrase, align: :right, size: 18 + text daily_packet.built_on_phrase, align: :right, size: 14 stroke do horizontal_rule @@ -40,7 +40,7 @@ def draw_front_page warm_fuzzy = daily_packet.warm_fuzzy text warm_fuzzy.title, size: 16 text warm_fuzzy.body, size: 12 - text "\n- #{warm_fuzzy.author}, #{warm_fuzzy.received_at.to_fs}", size: 12, align: :right + text "\n- #{warm_fuzzy.author}, #{warm_fuzzy.received_at.to_date.to_fs}", size: 12, align: :right move_down 20 diff --git a/spec/models/daily_packet/pdf_view_spec.rb b/spec/models/daily_packet/pdf_view_spec.rb index 01a94f1..c363ddc 100644 --- a/spec/models/daily_packet/pdf_view_spec.rb +++ b/spec/models/daily_packet/pdf_view_spec.rb @@ -12,12 +12,13 @@ page_one_strings, page_two_strings, page_three_strings = inspector.pages.map { |page| page[:strings] } expect(page_one_strings).to eq([ - "Daily Packet", - "07/07/2007, week 27", + "Daily Packet ##{daily_packet.id}", + "07/07/2007", + "week 27", "Random Warm Fuzzy", "Alright Haircut", "Your haircut is adequate.", - "- Wife, 01/01/1970 12:00:00am", + "- Wife, 01/01/1970", "Reading Pace", "7.7 pages/day", "Feedbin Stats",