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

15 files changed

+48
-21
lines changed

app/helpers/external_link_helper.rb

+2
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

+8
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

+4-3
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

+2-2
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

+5-2
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

+1-1
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

+2-1
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

+2-1
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

+2-1
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

+2-1
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

app/views/users/show.slim

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@
7171
small
7272
= I18n.tw("home.like_to_talk")
7373
br
74-
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
74+
== contact_text
75+

config/locales/de.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ de:
6161
home:
6262
the_usergroup: "Die <strong>%{usergroup}</strong> ist eine Benutzergruppe, Anwendergruppe, Interessengemeinschaft oder auch einfach nur ein Haufen Leute, die Spaß an der Programmiersprache Ruby haben. Tausch dich mit uns aus und komm zu unserem nächsten Treffen! Neue Gesichter sind immer gerne gesehen."
6363
like_to_talk: "Möchtest du einen Vortrag auf der Ruby Usergroup halten oder hast du zusätzliche Themenvorschläge?"
64-
send_us_an_email: "Dann schicke uns einfach eine %{mail_to} oder spreche uns persönlich an: %{twitter_link}"
64+
send_us_an_email: "Dann schicke uns einfach eine %{mail_to}"
65+
or_message_on_twitter: "oder spreche uns persönlich an: %{twitter_link}"
6566
engage: "Usergroups leben von Vorträgen und dem Engagement der Teilnehmer. Wenn du ein Thema vermisst, oder nähre Informationen zu speziellen Bereichen suchst, dann <strong>kannst du hier gerne etwas in die Wunschliste eintragen</strong>. Solltest du schon eine Idee zu einem Vortrag oder ähnlichem haben, dann <strong>kannst du ihn hier eintragen</strong>, um Feedback von der Ruby / Rails Community zu bekommen."
6667
add_topic: "Eigenes Thema eintragen"
6768
new_topics: "Themenvorschläge"
6869
upcoming_topics: "Demnächst vorgestellte Themen"
6970
old_topics: "Kürzlich vorgestellte Themen"
7071
company_workers: "Viele der Teilnehmer an der Ruby Usergroup arbeiten auch dort und wir freuen uns immer über neue Gesichter."
71-
company_missing: "Solltest du eine Firma vermissen, dann schicke uns einfach eine %{email_link} oder Direct-Message an %{twitter_link}"
72+
company_missing: "Solltest du eine Firma vermissen, dann schicke uns einfach eine %{email_link}"
73+
company_missing_or_message_twitter: "oder Direct-Message an %{twitter_link}"
7274
next_possible_meetup_recurring: "Derzeit ist noch kein Termin festgelegt, die Usergroup trifft sich aber %{recurring} und es wird <a href='%{none_url}'>noch eine Location gesucht</a>."
7375
next_possible_meetup: "Das nächste Ruby / Rails Treffen findet voraussichtlich am %{event_date} statt."
7476
next_meetup: "Das nächste Treffen"

config/locales/en.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ en:
6161
home:
6262
the_usergroup: "The <strong>%{usergroup}</strong> is a usergroup, group of interest or just a bunch of people loving Ruby. Get in contact with us at our next meetup! Newbees are always welcome."
6363
like_to_talk: "Do you want to give a Talk at the Ruby Usergroup or do you have additional Topics to talk about?"
64-
send_us_an_email: "Then send us an %{mail_to} or ping us on Twitter: %{twitter_link}"
64+
send_us_an_email: "Then send us an %{mail_to}"
65+
or_message_on_twitter: "or ping us on Twitter: %{twitter_link}"
6566
engage: "Usergroups need engaging People. If you think some Topic is missing, or you want to have more Infos on something, <strong>you are encouraged to add it to our Wishlist</strong>. If you have an Idea for a Talk or anything else <strong>add it here</strong> to get instant Feedback of the Ruby / Rails Community."
6667
add_topic: "Add a Topic"
6768
new_topics: "Proposals"
6869
upcoming_topics: "Upcoming Topics"
6970
old_topics: "Recent Topics"
7071
company_workers: "A lot of the Members of the Ruby Usergroup are working there too and we love to see new faces around."
71-
company_missing: "If you think that a Company is missing, send us an %{email_link} or Direct-Message to %{twitter_link}"
72+
company_missing: "If you think that a Company is missing, send us an %{email_link}"
73+
company_missing_or_message_twitter: "or Direct-Message to %{twitter_link}"
7274
next_possible_meetup_recurring: "There is no Event planned right now, the Usergroup usually meets %{recurring} and still <a href='%{none_url}'>looking for a location</a>."
7375
next_possible_meetup: "The next Ruby / Rails Meeting is supposed to be on %{event_date}."
7476
next_meetup: "The next meetup"

config/locales/es.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ es:
6161
home:
6262
the_usergroup: "<strong>%{usergroup}</strong> es un grupo de usuarios, grupo de interés o simplemente de personas interesadas en Ruby. Contacta con nosotros en la siguiente reunión! Todo el mundo es bienvenido, incluso si no tienes mucha experiencia con Ruby."
6363
like_to_talk: "Quieres dar una charla en el grupo, o quieres proponer un tema para una?"
64-
send_us_an_email: "Envíanos un %{mail_to} o un tweet: %{twitter_link}"
64+
send_us_an_email: "Envíanos un %{mail_to}"
65+
or_message_on_twitter: "o un tweet: %{twitter_link}"
6566
engage: "Los grupos de usuarios necesitan interacción. Si crees que estaría bien dar una charla sobre un Tema, o quieres profundizar sobre alguno, <strong>por favor añádelo en nuestra Wishlist</strong>. Si tienes una idea para una charla o actividad <strong>proponla aquí</strong> para obtener feedback de la comunidad de Ruby/Rails."
6667
add_topic: "Proponer un Tema"
6768
new_topics: "Propuestas"
6869
upcoming_topics: "Próximos temas"
6970
old_topics: "Temas recientes"
7071
company_workers: "En ocasiones serán lugares de trabajo de los miembros del Grupo de Usuarios; esto es normal, y les encanta ver caras nuevas."
71-
company_missing: "Si crees que falta una compañía, envíanos un %{email_link} o un tweet a %{twitter_link}"
72+
company_missing: "Si crees que falta una compañía, envíanos un %{email_link}"
73+
company_missing_or_message_twitter: "o un tweet a %{twitter_link}"
7274
next_possible_meetup_recurring: "De momento no hay ningún evento planeado, el grupo normalmente se reúne %{recurring} y ¡pero <a href='%{none_url}'>todavía no tenemos sitio!</a>."
7375
next_possible_meetup: "La siguiente reunión debería tener lugar el %{event_date}."
7476
next_meetup: "La siguiente reunión"

config/locales/pl.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ pl:
6161
home:
6262
the_usergroup: "<strong>%{usergroup}</strong> jest grupą ludzi, którzy kochają Ruby. Spotkaj się z nami na najbliższym meetupie! Początkujący są zawsze mile widziani."
6363
like_to_talk: "Chcesz zgłosić prezentację na najbliższe spotkanie albo masz propozycję tematu?"
64-
send_us_an_email: "Wyślij nam %{mail_to} lub skontaktuj się na Twitterze: %{twitter_link}"
64+
send_us_an_email: "Wyślij nam %{mail_to}"
65+
or_message_on_twitter: "lub skontaktuj się na Twitterze: %{twitter_link}"
6566
engage: "Grupy potrzebują zaangażoanych uczestników. Jeśli uważasz że brakuje jakiegoś tematu lub poszukujesz dodatkowych informacji, <strong>zachęcamy Cię do dodania tych rzeczy do naszej Listy życzeń</strong>. Jeśli masz pomysł na prezentację, <strong>dodaj go tutaj</strong> i otrzymaj natychmiastowy feedback od środowiska Ruby / Rails."
6667
add_topic: "Dodaj temat"
6768
new_topics: "Propozycje"
6869
upcoming_topics: "Najbliższe tematy"
6970
old_topics: "OStatnie tematy"
7071
company_workers: "Pracuje tu wielu członków grupy. Lubimy widzieć nowe twarze."
71-
company_missing: "Jeśli uważasz że brakuje tu jakiejś firmy, wyślij nam %{email_link} lub wiadomość prywatną na Twitterze (%{twitter_link})"
72+
company_missing: "Jeśli uważasz że brakuje tu jakiejś firmy, wyślij nam %{email_link}"
73+
company_missing_or_message_twitter: "lub wiadomość prywatną na Twitterze (%{twitter_link})"
7274
next_possible_meetup_recurring: "Obecnie nie ma zaplanowanych żadnych spotkań. Grupa zazwyczaj spotyka się %{recurring} i wciąż <a href='%{none_url}'>poszukuje miejsca</a>, gdzie mogłaby się spotkać."
7375
next_possible_meetup: "Najbliższe spotkanie Ruby / Rails powinno odbyć się %{event_date}"
7476
next_meetup: "Najbliższy meetup"

0 commit comments

Comments
 (0)