Permalink
Browse files

add alt and title tags, closes #25

  • Loading branch information...
1 parent 4dacccc commit 5ca10ff0cd3e94a683cc6116a8cd6f0ac89d3f0d @phoet committed Sep 4, 2012
@@ -4,7 +4,7 @@ def link_to_twitter(thing, params={clung: false}, &block)
nick = thing.respond_to?(:nickname) ? thing.nickname : thing
url = "http://twitter.com/#{nick}"
if block_given?
- link_to url, &block
+ link_to url, title: nick, &block
else
link = "@#{link_to(nick, url, title: nick)}"
raw params[:clung] ? "(#{link})" : link
@@ -32,15 +32,14 @@ def likes
end
end
- def senor_developer_ribbon
- link_to "http://senordevelopershop.spreadshirt.de", id: :senor_developer do
- content_tag :span, "Señor Developer!"
- end
- end
-
- def fork_me_ribbon
- link_to "https://github.com/phoet/on_ruby", id: :github do
- content_tag :span, "Fork me on GitHub!"
+ def ribbon(type)
+ types = {
+ github: ["Fork me on GitHub!", "https://github.com/phoet/on_ruby"],
+ senor_developer: ["Señor Developer!", "http://senordevelopershop.spreadshirt.de"],
+ }
+ text, url = types[type]
+ link_to url, id: type, title: text do
+ content_tag :span, text
end
end
end
@@ -1,4 +1,4 @@
= section_box :companies do
= map(companies)
- p== t("home.company_workers", companies_link: link_to(t("companies"), company_locations_path))
- p== t("home.company_missing", email_link: mail_to(Whitelabel[:email], "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
+ p== t("home.company_workers", companies_link: link_to(t("companies"), company_locations_path, title: t("companies")))
+ p== t("home.company_missing", email_link: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"), twitter_link: link_to_twitter(Whitelabel[:twitter]))
@@ -9,4 +9,4 @@
h3= t("home.past_events")
ul.clearfix
- events.each do |event|
- li= link_to "#{l(event.date, format: :date)} - #{event.name}", event_path(event)
+ li= link_to "#{l(event.date, format: :date)} - #{event.name}", event_path(event), title: event.name
@@ -1,3 +1,3 @@
= section_box :locations do
= map(locations)
- p== t("home.usergroup_locations", location_link: link_to(t("locations"), locations_path))
+ p== t("home.usergroup_locations", location_link: link_to(t("locations"), locations_path, title: t("locations")))
@@ -3,4 +3,4 @@
- users.compact.each do |user|
li
= link_to user, title: user.name do
- = image_tag 'logo.png', alt: user.name, title: user.name, 'data-src' => user.image
+ = image_tag 'logo.png', alt: user.name, 'data-src' => user.image
@@ -1,9 +1,8 @@
= section_box :wishes do
p
- strong= t("home.like_to_talk")
- == t("home.send_us_an_email", mail_to: Whitelabel[:email])
- ul
- = render 'users_list', users: organizers
+ strong=' t("home.like_to_talk")
+ == t("home.send_us_an_email", mail_to: mail_to(Whitelabel[:email], "E-Mail", title: "E-Mail"))
+ = render 'users_list', users: organizers
p== t("home.engage")
p== button_to t("home.add_topic"), new_wish_path, method: :get
- if wishes_undone.present?
@@ -2,6 +2,7 @@
ul
- Whitelabel.labels.each do |label|
li
- = link_to root_url(subdomain: label.label_id) do
+ - name = t("label.#{label.label_id}.name")
+ = link_to root_url(subdomain: label.label_id), title: name do
.whitelabel
- #{image_tag("labels/#{label.label_id}.png")} #{label.host}
+ #{image_tag("labels/#{label.label_id}.png", alt: name)} #{label.host}
@@ -12,8 +12,8 @@ html
= javascript_include_tag "application", "labels/#{Whitelabel[:label_id]}", "https://apis.google.com/js/plusone.js", "https://platform.twitter.com/widgets.js"
= render 'shared/i18njs'
body
- = fork_me_ribbon
- = senor_developer_ribbon
+ = ribbon(:github)
+ = ribbon(:senor_developer)
.container
header#on_ruby.clearfix
= render 'shared/login'
@@ -5,19 +5,19 @@ section.clearfix
li
= link_to_twitter Whitelabel[:twitter] do
= "Twitter"
- li= mail_to Whitelabel[:email], 'E-Mail'
+ li= mail_to Whitelabel[:email], 'E-Mail', title: 'E-Mail'
#links.block
h2= t("footer.links")
ul
- li= link_to 'Github', 'http://github.com/phoet/on_ruby'
- li= link_to 'Mailinglist', (Whitelabel[:mailing_list] || 'https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-ug-germany')
+ li= link_to 'GitHub', 'http://github.com/phoet/on_ruby', title: 'Fork me on GitHub'
+ li= link_to 'Mailinglist', (Whitelabel[:mailing_list] || 'https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-ug-germany'), title: 'Mailinglist'
#imprint.block
h2= t("footer.imprint")
ul
li
- imprint[:contributors].each do |contributor|
- = mail_to contributor[:email], contributor[:name]
+ = mail_to contributor[:email], contributor[:name], title: contributor[:name]
- if imprint[:address]
li== imprint[:address].gsub("\n", "<br/>")
@@ -27,13 +27,14 @@ section.clearfix
ol.clearfix
- other_usergroups.each do |ug|
li
- =' link_to ug[:name], ug[:url]
+ =' link_to ug[:name], ug[:url], title: ug[:name]
= link_to_twitter(ug[:twitter], clung: true) if ug[:twitter]
#railsgroups.block
h2= t("footer.ruby_usergroups")
ol.clearfix
- Whitelabel.labels.each do |label|
li
- =' link_to t("label.#{label.label_id}.name"), "http://#{label.label_id}.onruby.de"
+ - name = t("label.#{label.label_id}.name")
+ =' link_to name, "http://#{label.label_id}.onruby.de", title: name
= link_to_twitter(label.twitter, clung: true)
@@ -1,4 +1,4 @@
-#logo= link_to image_tag("labels/#{Whitelabel[:label_id]}.png"), root_path
-= link_to root_path, id: "title" do
+#logo= link_to image_tag("labels/#{Whitelabel[:label_id]}.png", alt: title), root_path, title: title
+= link_to root_path, id: :title, title: title do
h1= title
h2= subtitle
@@ -1,9 +1,9 @@
#login
-if signed_in?
ul
- li= link_to image_tag(current_user.image, class: "user"), edit_user_path(current_user), title: current_user.nickname
- li= link_to t("login.profile"), edit_user_path(current_user)
- li= link_to t("login.logout"), destroy_session_path(current_user)
+ li= link_to image_tag(current_user.image, class: "user", alt: current_user.nickname), edit_user_path(current_user), title: current_user.nickname
+ li= link_to t("login.profile"), edit_user_path(current_user), title: t("login.profile")
+ li= link_to t("login.logout"), destroy_session_path(current_user), title: t("login.logout")
-else
ul
- li= link_to t("login.twitter_login"), auth_path
+ li= link_to t("login.twitter_login"), auth_path, title: t("login.twitter_login")
@@ -5,4 +5,5 @@ ul
#locale
ul
-[:de, :en].each do |locale|
- li= link_to image_tag("flags/#{locale}.png"), locale: locale
+ - title = t("switch_languages", language: t("languages.#{locale}"))
+ li= link_to image_tag("flags/#{locale}.png", alt: title), url_for(locale: locale), title: title
View
@@ -6,6 +6,10 @@ de:
month: "%B %Y"
countries:
DE: "Deutschland"
+ switch_languages: "Umschalten auf %{language}"
+ languages:
+ de: "Deusch"
+ en: "Englisch"
usergroups: "Usergroups"
companies: "Firmen"
events: "Treffen"
@@ -39,7 +43,7 @@ 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 <a href='mailto:%{mail_to}'>E-Mail</a> oder spreche uns persönlich an:"
+ send_us_an_email: "Dann schicke uns einfach eine %{mail_to} oder spreche uns persönlich an:"
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: "Aktuelle Themen"
View
@@ -6,6 +6,10 @@ en:
month: "%B %Y"
countries:
DE: "Germany"
+ switch_languages: "Switch to %{language}"
+ languages:
+ de: "German"
+ en: "English"
usergroups: "Usergroups"
companies: "Companies"
events: "Events"
@@ -39,7 +43,7 @@ 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 <a href='mailto:%{mail_to}'>E-Mail</a> oder ping us on Twitter:"
+ send_us_an_email: "Then send us an %{mail_to} oder ping us on Twitter:"
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: "New Topics"

0 comments on commit 5ca10ff

Please sign in to comment.