Open links to social networks in the same window
As mentioned in earlier commits, opening external links in a new tab/window results in usability and accessibility issues. Since these links are usually at the top or bottom of the page and contain icons of well-known sites, IMHO there's no need to even notify people that these are external links. Since we're no longer using the `shared.target_blank` translation inside a sentence, we can remove the space and parenthesis in the translations.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<% sites.each do |name, url| %>
|
<% sites.each do |name, url| %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "#{url}/#{setting["#{name}_handle"]}", target: "_blank", title: link_title(name) do %>
|
<%= link_to "#{url}/#{setting["#{name}_handle"]}", title: link_title(name) do %>
|
||||||
<span class="show-for-sr"><%= link_text(name) %></span>
|
<span class="show-for-sr"><%= link_text(name) %></span>
|
||||||
<span class="icon-<%= name %>" aria-hidden="true"></span>
|
<span class="icon-<%= name %>" aria-hidden="true"></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Layout::SocialComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
|
|
||||||
def link_title(site_name)
|
def link_title(site_name)
|
||||||
t("shared.go_to_page") + link_text(site_name) + t("shared.target_blank")
|
t("shared.go_to_page") + link_text(site_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_text(site_name)
|
def link_text(site_name)
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ en:
|
|||||||
districts: "Districts"
|
districts: "Districts"
|
||||||
districts_list: "Districts list"
|
districts_list: "Districts list"
|
||||||
categories: "Categories"
|
categories: "Categories"
|
||||||
target_blank: " (link opens in new window)"
|
target_blank: "Link opens in new window"
|
||||||
you_are_in: "You are in"
|
you_are_in: "You are in"
|
||||||
unflag: Unflag
|
unflag: Unflag
|
||||||
unfollow_entity: "Unfollow %{entity}"
|
unfollow_entity: "Unfollow %{entity}"
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ es:
|
|||||||
districts: "Distritos"
|
districts: "Distritos"
|
||||||
districts_list: "Listado de distritos"
|
districts_list: "Listado de distritos"
|
||||||
categories: "Categorías"
|
categories: "Categorías"
|
||||||
target_blank: " (se abre en ventana nueva)"
|
target_blank: "Se abre en ventana nueva"
|
||||||
you_are_in: "Estás en"
|
you_are_in: "Estás en"
|
||||||
unflag: Deshacer denuncia
|
unflag: Deshacer denuncia
|
||||||
unfollow_entity: "Dejar de seguir %{entity}"
|
unfollow_entity: "Dejar de seguir %{entity}"
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ describe Shared::AgreeWithTermsOfServiceFieldComponent do
|
|||||||
expect(page).to have_link count: 2
|
expect(page).to have_link count: 2
|
||||||
expect(page).to have_link "Privacy Policy"
|
expect(page).to have_link "Privacy Policy"
|
||||||
expect(page).to have_link "Terms and conditions of use"
|
expect(page).to have_link "Terms and conditions of use"
|
||||||
expect(page).to have_link " (link opens in new window)", count: 2
|
expect(page).to have_link "Link opens in new window", count: 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user