From 060f13ecb3efd632c4b425b24e0497658449de17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20B=C3=B6hme?= Date: Thu, 31 Oct 2024 17:31:39 +0100 Subject: [PATCH] Use helper instead of partial for contact text --- app/helpers/home_helper.rb | 8 ++++++++ app/views/events/show.slim | 2 +- app/views/home/_topics.slim | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 31a19fa04..9be67e93e 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -8,4 +8,12 @@ def next_event_date def localized_recurring_event_date Whitelabel[:localized_recurring] end + + def contact_text + capture do + concat t('home.send_us_an_email', mail_to: mail_to(Whitelabel[:email], 'E-Mail', title: 'E-Mail')).html_safe + concat " #{t('home.or_message_on_twitter', twitter_link: link_to_twitter(Whitelabel[:twitter]))}".html_safe if Whitelabel[:twitter] + concat '.' + end + end end diff --git a/app/views/events/show.slim b/app/views/events/show.slim index 2c4059888..be6c49724 100644 --- a/app/views/events/show.slim +++ b/app/views/events/show.slim @@ -12,4 +12,4 @@ small = I18n.tw("home.like_to_talk") br - = render "home/contact_text" + = contact_text diff --git a/app/views/home/_topics.slim b/app/views/home/_topics.slim index 85cb4b2d0..e4a2bfb65 100644 --- a/app/views/home/_topics.slim +++ b/app/views/home/_topics.slim @@ -1,7 +1,7 @@ = section_box :topics do p strong=> I18n.tw("home.like_to_talk") - = render "home/contact_text" + = contact_text = render 'users/list', users: organizers p== I18n.tw("home.engage") = link_to t("home.add_topic"), new_topic_path, class: 'btn btn-primary'