Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve texts if user group has no twitter account #1077

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/helpers/external_link_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def wheelmap_badge(location, klass: 'wheelmap-status')

def link_to_twitter(thing, params = { clung: false }, &block)
nick = thing.respond_to?(:twitter) ? thing.twitter : thing
return unless nick

url = "https://twitter.com/#{nick}"
if block_given?
link_to url, title: nick, &block
Expand Down
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
7 changes: 4 additions & 3 deletions app/views/application/_footer.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
.col-sm.mb-2
h2= t("footer.contact")
ul
li
= link_to_twitter Whitelabel[:twitter] do
= "Twitter"
- if Whitelabel[:twitter]
li
= link_to_twitter Whitelabel[:twitter] do
= "Twitter"
li= mail_to Whitelabel[:email], 'E-Mail', title: "#{Whitelabel[:twitter]} E-Mail"
li= link_to 'Status', 'http://status.onruby.eu/'

Expand Down
4 changes: 2 additions & 2 deletions app/views/events/show.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.card
.card-header
= render('badges', event: event)

.card-body
= render('info', event: event)
= render('topics', event: event)
Expand All @@ -12,4 +12,4 @@
small
= I18n.tw("home.like_to_talk")
br
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
= contact_text
4 changes: 4 additions & 0 deletions app/views/home/_contact_text.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
== t('home.send_us_an_email', mail_to: mail_to(Whitelabel[:email], 'E-Mail', title: 'E-Mail'))
- if Whitelabel[:twitter]
==< t('home.or_message_on_twitter', twitter_link: link_to_twitter(Whitelabel[:twitter]))
| .
Comment on lines +1 to +4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO: this should be a helper method, instead of a partial. Performance of many small partials isn't great.

7 changes: 5 additions & 2 deletions app/views/home/_locations.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
- options = { location_link: link_to(t("main.locations"), locations_path, title: t("main.locations")) }
p== I18n.tw("home.usergroup_locations", options)
p== I18n.tw("home.company_workers")
- options = { email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]) }
p== I18n.tw("home.company_missing", options)
p
== I18n.tw("home.company_missing", email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"))
- if Whitelabel[:twitter]
==< I18n.tw("home.company_missing_or_message_twitter", twitter_link: link_to_twitter(Whitelabel[:twitter]))
| .
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")
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
= 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
3 changes: 2 additions & 1 deletion app/views/locations/none.de.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ section
' Usergroups suchen immer nach einem zu Hause für ihre Treffen.
' Wenn du oder deine Firma ein Treffen ausrichten möchtest, dann
=> mail_to Whitelabel[:email], "schicke uns einfach eine E-Mail", title: "#{Whitelabel[:twitter]} E-Mail"
' oder erwähne uns unter #{link_to_twitter Whitelabel[:twitter]}
- if Whitelabel[:twitter]
' oder erwähne uns unter #{link_to_twitter Whitelabel[:twitter]}
' oder wende dich an unsere Ansprechpartner:
= render 'users/list', users: organizers

Expand Down
3 changes: 2 additions & 1 deletion app/views/locations/none.en.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ section
' We are always looking for new locations for our Meetups.
' If you want to host one of the events at your company
=> mail_to Whitelabel[:email], "drop us a line", title: "#{Whitelabel[:twitter]} E-Mail"
' or mention us on twitter #{link_to_twitter Whitelabel[:twitter]}
- if Whitelabel[:twitter]
' or mention us on twitter #{link_to_twitter Whitelabel[:twitter]}
' or contact one of the organizers:
= render 'users/list', users: organizers

Expand Down
3 changes: 2 additions & 1 deletion app/views/locations/none.es.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ section
' Siempre estamos buscando nuevos sitios para nuestros Meetups.
' Si deseas albergar alguno de nuestros eventos en tu compañía
=> mail_to Whitelabel[:email], "escríbenos", title: "#{Whitelabel[:twitter]} E-Mail"
' o mencionanos en twitter #{link_to_twitter Whitelabel[:twitter]}
- if Whitelabel[:twitter]
' o mencionanos en twitter #{link_to_twitter Whitelabel[:twitter]}
' o contacta con alguno de los organizadores:
= render 'users/list', users: organizers

Expand Down
3 changes: 2 additions & 1 deletion app/views/locations/none.pl.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ section
' Zawsze szukamy nowych miejsc na nasze spotkania
' Jeśli chesz by takie wydarzenie odbyło się w siedzibie Twojej firmy
=> mail_to Whitelabel[:email], "napisz nam maila", title: "#{Whitelabel[:twitter]} E-Mail"
', skontaktuj się przez Twittera #{link_to_twitter Whitelabel[:twitter]}
- if Whitelabel[:twitter]
', skontaktuj się przez Twittera #{link_to_twitter Whitelabel[:twitter]}
' lub bezpośrednio do jednego z organizatorów:
= render 'users/list', users: organizers

Expand Down
3 changes: 2 additions & 1 deletion app/views/users/show.slim
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@
small
= I18n.tw("home.like_to_talk")
br
== t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
== contact_text
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you already started to use a helper?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, that was a left over. I started using a helper but it felt more messy with things like HTML-Escaping and spaces between translations. I've pushed a commit that re-implements the helper. Let me know what you think. Maybe we could improve it by moving the links out of the translation or something.


6 changes: 4 additions & 2 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ de:
home:
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."
like_to_talk: "Möchtest du einen Vortrag auf der Ruby Usergroup halten oder hast du zusätzliche Themenvorschläge?"
send_us_an_email: "Dann schicke uns einfach eine %{mail_to} oder spreche uns persönlich an: %{twitter_link}"
send_us_an_email: "Dann schicke uns einfach eine %{mail_to}"
or_message_on_twitter: "oder spreche uns persönlich an: %{twitter_link}"
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."
add_topic: "Eigenes Thema eintragen"
new_topics: "Themenvorschläge"
upcoming_topics: "Demnächst vorgestellte Themen"
old_topics: "Kürzlich vorgestellte Themen"
company_workers: "Viele der Teilnehmer an der Ruby Usergroup arbeiten auch dort und wir freuen uns immer über neue Gesichter."
company_missing: "Solltest du eine Firma vermissen, dann schicke uns einfach eine %{email_link} oder Direct-Message an %{twitter_link}"
company_missing: "Solltest du eine Firma vermissen, dann schicke uns einfach eine %{email_link}"
company_missing_or_message_twitter: "oder Direct-Message an %{twitter_link}"
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>."
next_possible_meetup: "Das nächste Ruby / Rails Treffen findet voraussichtlich am %{event_date} statt."
next_meetup: "Das nächste Treffen"
Expand Down
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ en:
home:
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."
like_to_talk: "Do you want to give a Talk at the Ruby Usergroup or do you have additional Topics to talk about?"
send_us_an_email: "Then send us an %{mail_to} or ping us on Twitter: %{twitter_link}"
send_us_an_email: "Then send us an %{mail_to}"
or_message_on_twitter: "or ping us on Twitter: %{twitter_link}"
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."
add_topic: "Add a Topic"
new_topics: "Proposals"
upcoming_topics: "Upcoming Topics"
old_topics: "Recent Topics"
company_workers: "A lot of the Members of the Ruby Usergroup are working there too and we love to see new faces around."
company_missing: "If you think that a Company is missing, send us an %{email_link} or Direct-Message to %{twitter_link}"
company_missing: "If you think that a Company is missing, send us an %{email_link}"
company_missing_or_message_twitter: "or Direct-Message to %{twitter_link}"
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>."
next_possible_meetup: "The next Ruby / Rails Meeting is supposed to be on %{event_date}."
next_meetup: "The next meetup"
Expand Down
6 changes: 4 additions & 2 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ es:
home:
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."
like_to_talk: "Quieres dar una charla en el grupo, o quieres proponer un tema para una?"
send_us_an_email: "Envíanos un %{mail_to} o un tweet: %{twitter_link}"
send_us_an_email: "Envíanos un %{mail_to}"
or_message_on_twitter: "o un tweet: %{twitter_link}"
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."
add_topic: "Proponer un Tema"
new_topics: "Propuestas"
upcoming_topics: "Próximos temas"
old_topics: "Temas recientes"
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."
company_missing: "Si crees que falta una compañía, envíanos un %{email_link} o un tweet a %{twitter_link}"
company_missing: "Si crees que falta una compañía, envíanos un %{email_link}"
company_missing_or_message_twitter: "o un tweet a %{twitter_link}"
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>."
next_possible_meetup: "La siguiente reunión debería tener lugar el %{event_date}."
next_meetup: "La siguiente reunión"
Expand Down
6 changes: 4 additions & 2 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ pl:
home:
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."
like_to_talk: "Chcesz zgłosić prezentację na najbliższe spotkanie albo masz propozycję tematu?"
send_us_an_email: "Wyślij nam %{mail_to} lub skontaktuj się na Twitterze: %{twitter_link}"
send_us_an_email: "Wyślij nam %{mail_to}"
or_message_on_twitter: "lub skontaktuj się na Twitterze: %{twitter_link}"
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."
add_topic: "Dodaj temat"
new_topics: "Propozycje"
upcoming_topics: "Najbliższe tematy"
old_topics: "OStatnie tematy"
company_workers: "Pracuje tu wielu członków grupy. Lubimy widzieć nowe twarze."
company_missing: "Jeśli uważasz że brakuje tu jakiejś firmy, wyślij nam %{email_link} lub wiadomość prywatną na Twitterze (%{twitter_link})"
company_missing: "Jeśli uważasz że brakuje tu jakiejś firmy, wyślij nam %{email_link}"
company_missing_or_message_twitter: "lub wiadomość prywatną na Twitterze (%{twitter_link})"
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ć."
next_possible_meetup: "Najbliższe spotkanie Ruby / Rails powinno odbyć się %{event_date}"
next_meetup: "Najbliższy meetup"
Expand Down