Skip to content

Commit 2e4ab08

Browse files
authored
Merge pull request #1077 from richardboehme/rb/improve-ug-without-twitter
Improve texts if user group has no twitter account
2 parents 45b870e + 5c62356 commit 2e4ab08

File tree

15 files changed

+48
-21
lines changed

15 files changed

+48
-21
lines changed

app/helpers/external_link_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def wheelmap_badge(location, klass: 'wheelmap-status')
1212

1313
def link_to_twitter(thing, params = { clung: false }, &block)
1414
nick = thing.respond_to?(:twitter) ? thing.twitter : thing
15+
return unless nick
16+
1517
url = "https://twitter.com/#{nick}"
1618
if block_given?
1719
link_to url, title: nick, &block

app/helpers/home_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ def next_event_date
88
def localized_recurring_event_date
99
Whitelabel[:localized_recurring]
1010
end
11+
12+
def contact_text
13+
capture do
14+
concat t('home.send_us_an_email', mail_to: mail_to(Whitelabel[:email], 'E-Mail', title: 'E-Mail')).html_safe
15+
concat " #{t('home.or_message_on_twitter', twitter_link: link_to_twitter(Whitelabel[:twitter]))}".html_safe if Whitelabel[:twitter]
16+
concat '.'
17+
end
18+
end
1119
end

app/views/application/_footer.slim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
.col-sm.mb-2
1313
h2= t("footer.contact")
1414
ul
15-
li
16-
= link_to_twitter Whitelabel[:twitter] do
17-
= "Twitter"
15+
- if Whitelabel[:twitter]
16+
li
17+
= link_to_twitter Whitelabel[:twitter] do
18+
= "Twitter"
1819
li= mail_to Whitelabel[:email], 'E-Mail', title: "#{Whitelabel[:twitter]} E-Mail"
1920
li= link_to 'Status', 'http://status.onruby.eu/'
2021

app/views/events/show.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.card
22
.card-header
33
= render('badges', event: event)
4-
4+
55
.card-body
66
= render('info', event: event)
77
= render('topics', event: event)
@@ -12,4 +12,4 @@
1212
small
1313
= I18n.tw("home.like_to_talk")
1414
br
15-
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
15+
= contact_text

app/views/home/_locations.slim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
- options = { location_link: link_to(t("main.locations"), locations_path, title: t("main.locations")) }
44
p== I18n.tw("home.usergroup_locations", options)
55
p== I18n.tw("home.company_workers")
6-
- options = { email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]) }
7-
p== I18n.tw("home.company_missing", options)
6+
p
7+
== I18n.tw("home.company_missing", email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"))
8+
- if Whitelabel[:twitter]
9+
==< I18n.tw("home.company_missing_or_message_twitter", twitter_link: link_to_twitter(Whitelabel[:twitter]))
10+
| .

app/views/home/_topics.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= section_box :topics do
22
p
33
strong=> I18n.tw("home.like_to_talk")
4-
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
4+
= contact_text
55
= render 'users/list', users: organizers
66
p== I18n.tw("home.engage")
77
= link_to t("home.add_topic"), new_topic_path, class: 'btn btn-primary'

app/views/locations/none.de.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ section
66
' Usergroups suchen immer nach einem zu Hause für ihre Treffen.
77
' Wenn du oder deine Firma ein Treffen ausrichten möchtest, dann
88
=> mail_to Whitelabel[:email], "schicke uns einfach eine E-Mail", title: "#{Whitelabel[:twitter]} E-Mail"
9-
' oder erwähne uns unter #{link_to_twitter Whitelabel[:twitter]}
9+
- if Whitelabel[:twitter]
10+
' oder erwähne uns unter #{link_to_twitter Whitelabel[:twitter]}
1011
' oder wende dich an unsere Ansprechpartner:
1112
= render 'users/list', users: organizers
1213

app/views/locations/none.en.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ section
66
' We are always looking for new locations for our Meetups.
77
' If you want to host one of the events at your company
88
=> mail_to Whitelabel[:email], "drop us a line", title: "#{Whitelabel[:twitter]} E-Mail"
9-
' or mention us on twitter #{link_to_twitter Whitelabel[:twitter]}
9+
- if Whitelabel[:twitter]
10+
' or mention us on twitter #{link_to_twitter Whitelabel[:twitter]}
1011
' or contact one of the organizers:
1112
= render 'users/list', users: organizers
1213

app/views/locations/none.es.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ section
66
' Siempre estamos buscando nuevos sitios para nuestros Meetups.
77
' Si deseas albergar alguno de nuestros eventos en tu compañía
88
=> mail_to Whitelabel[:email], "escríbenos", title: "#{Whitelabel[:twitter]} E-Mail"
9-
' o mencionanos en twitter #{link_to_twitter Whitelabel[:twitter]}
9+
- if Whitelabel[:twitter]
10+
' o mencionanos en twitter #{link_to_twitter Whitelabel[:twitter]}
1011
' o contacta con alguno de los organizadores:
1112
= render 'users/list', users: organizers
1213

app/views/locations/none.pl.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ section
66
' Zawsze szukamy nowych miejsc na nasze spotkania
77
' Jeśli chesz by takie wydarzenie odbyło się w siedzibie Twojej firmy
88
=> mail_to Whitelabel[:email], "napisz nam maila", title: "#{Whitelabel[:twitter]} E-Mail"
9-
', skontaktuj się przez Twittera #{link_to_twitter Whitelabel[:twitter]}
9+
- if Whitelabel[:twitter]
10+
', skontaktuj się przez Twittera #{link_to_twitter Whitelabel[:twitter]}
1011
' lub bezpośrednio do jednego z organizatorów:
1112
= render 'users/list', users: organizers
1213

0 commit comments

Comments
 (0)