From e85f24174e5d467974eb160318d20e13f8d43bda Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 28 Mar 2024 06:56:33 -0400 Subject: [PATCH] Simplify checklist step loop in welcome mailer (#29761) --- app/views/application/mailer/_checklist.html.haml | 8 +++----- app/views/user_mailer/welcome.html.haml | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/views/application/mailer/_checklist.html.haml b/app/views/application/mailer/_checklist.html.haml index 324fd7e6f8..91c7c98f26 100644 --- a/app/views/application/mailer/_checklist.html.haml +++ b/app/views/application/mailer/_checklist.html.haml @@ -16,16 +16,14 @@ = image_tag frontend_asset_url('images/mailer-new/welcome/checkbox-off.png'), alt: '', width: 20, height: 20 %td.email-checklist-icons-step-td - if defined?(key) - = image_tag frontend_asset_url("images/mailer-new/welcome-icons/#{key}-#{checked ? 'on' : 'off'}.png"), alt: '', width: 40, height: 40 + = image_tag frontend_asset_url("images/mailer-new/welcome-icons/#{key}_step-#{checked ? 'on' : 'off'}.png"), alt: '', width: 40, height: 40 %td.email-checklist-text-td .email-desktop-flex /[if mso]
%div - - if defined?(title) - %h3= title - - if defined?(text) - %p= text + %h3= t("user_mailer.welcome.#{key}_title") + %p= t("user_mailer.welcome.#{key}_step") /[if mso] %div diff --git a/app/views/user_mailer/welcome.html.haml b/app/views/user_mailer/welcome.html.haml index fd8980c234..0e55707d36 100644 --- a/app/views/user_mailer/welcome.html.haml +++ b/app/views/user_mailer/welcome.html.haml @@ -23,11 +23,11 @@ %td.email-body-huge-padding-td %h2.email-h2= t('user_mailer.welcome.checklist_title') %p.email-h-sub= t('user_mailer.welcome.checklist_subtitle') - = render 'application/mailer/checklist', key: 'edit_profile_step', title: t('user_mailer.welcome.edit_profile_title'), text: t('user_mailer.welcome.edit_profile_step'), checked: @has_account_fields, button_text: t('user_mailer.welcome.edit_profile_action'), button_url: web_url('start/profile') - = render 'application/mailer/checklist', key: 'follow_step', title: t('user_mailer.welcome.follow_title'), text: t('user_mailer.welcome.follow_step'), checked: @has_active_relationships, button_text: t('user_mailer.welcome.follow_action'), button_url: web_url('start/follows') - = render 'application/mailer/checklist', key: 'post_step', title: t('user_mailer.welcome.post_title'), text: t('user_mailer.welcome.post_step'), checked: @has_statuses, button_text: t('user_mailer.welcome.post_action'), button_url: web_url - = render 'application/mailer/checklist', key: 'share_step', title: t('user_mailer.welcome.share_title'), text: t('user_mailer.welcome.share_step'), checked: false, button_text: t('user_mailer.welcome.share_action'), button_url: web_url('start/share') - = render 'application/mailer/checklist', key: 'apps_step', title: t('user_mailer.welcome.apps_title'), text: t('user_mailer.welcome.apps_step'), checked: false, show_apps_buttons: true + = render 'application/mailer/checklist', key: 'edit_profile', checked: @has_account_fields, button_text: t('user_mailer.welcome.edit_profile_action'), button_url: web_url('start/profile') + = render 'application/mailer/checklist', key: 'follow', checked: @has_active_relationships, button_text: t('user_mailer.welcome.follow_action'), button_url: web_url('start/follows') + = render 'application/mailer/checklist', key: 'post', checked: @has_statuses, button_text: t('user_mailer.welcome.post_action'), button_url: web_url + = render 'application/mailer/checklist', key: 'share', checked: false, button_text: t('user_mailer.welcome.share_action'), button_url: web_url('start/share') + = render 'application/mailer/checklist', key: 'apps', checked: false, show_apps_buttons: true %table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' } %tr %td.email-body-columns-td