Skip to content

Commit

Permalink
Use helper instead of partial for contact text
Browse files Browse the repository at this point in the history
  • Loading branch information
richardboehme committed Oct 31, 2024
1 parent 29220a0 commit 060f13e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/views/events/show.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
small
= I18n.tw("home.like_to_talk")
br
= render "home/contact_text"
= contact_text
2 changes: 1 addition & 1 deletion app/views/home/_topics.slim
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 060f13e

Please sign in to comment.