From 5c5e55493c6c2605bbde31d68082bebd2a276144 Mon Sep 17 00:00:00 2001 From: transcental Date: Fri, 23 Jan 2026 14:58:57 +0000 Subject: [PATCH] orph, we need to compliment --- .../components/templates/ft_well_cooked.rb | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/lib/snail_mail/components/templates/ft_well_cooked.rb diff --git a/app/lib/snail_mail/components/templates/ft_well_cooked.rb b/app/lib/snail_mail/components/templates/ft_well_cooked.rb new file mode 100644 index 0000000..67b59e3 --- /dev/null +++ b/app/lib/snail_mail/components/templates/ft_well_cooked.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module SnailMail + module Components + module Templates + class FtWellCooked < HalfLetterComponent + IMAGES = %w(wizard.png hotdogcat.jpg magic_smoke.png) + + def self.abstract? = false + + def address_font = "gohu" + + def self.template_name = "Flavortown Well Cooked" + + def self.template_size = :half_letter + + def self.show_on_single? = false + + def render_front + image( + image_path(IMAGES.sample), + at: [410, bounds.bottom + 200], + valign: :top, + width: 150 + ) + + meta = letter.metadata || {} + project = (proj = meta["project"]).present? ? "#{proj} " : nil + reviewer = meta["reviewer"].presence || "your secret admirer" + text = <<~EOM + Hey, Chef #{letter.address&.first_name&.titleize}, + + We wanted to send our compliments to the chef, (that's you!), to say that your project #{project}really added some flavour to the menu at HQ! + + We love to see real creativity and people cooking with passion, and we think you're doing an amazing job in the kitchen! + + Many thanks & keep hacking! + + <3 Head Chef ~#{reviewer} + + + + + + tl;dr: TS well cooked! + EOM + + font "gohu" do text_box text, at: [15, bounds.top-15], width: bounds.right - 200 - 20, size: 14 end + end + + def render_back + super + end + end + end + end +end