Merge pull request #1107 from consul/accessibility

Accessibility
This commit is contained in:
Enrique García
2016-05-10 11:23:22 +02:00
9 changed files with 27 additions and 13 deletions

View File

@@ -88,7 +88,7 @@ a {
} }
&:focus { &:focus {
outline: 0; outline: 3px solid #ffbf47;
} }
} }
@@ -656,6 +656,10 @@ form.locale-form {
padding-left: rem-calc(3); padding-left: rem-calc(3);
padding-right: $line-height; padding-right: $line-height;
width: auto; width: auto;
&:focus {
outline: 3px solid #ffbf47;
}
} }
} }
} }

View File

@@ -192,7 +192,7 @@
.button-support { .button-support {
background: white; background: white;
color: $proposals; color: $text;
display: inline-block; display: inline-block;
font-size: $small-font-size; font-size: $small-font-size;
margin-top: rem-calc(12); margin-top: rem-calc(12);

View File

@@ -0,0 +1,7 @@
module AccessibilityHelper
def css_for_aria_hidden(reason)
reason.present? ? "true" : ""
end
end

View File

@@ -22,20 +22,20 @@
</span> </span>
<% if user_signed_in? && current_user.organization? %> <% if user_signed_in? && current_user.organization? %>
<div class="organizations-votes" style='display:none'> <div class="organizations-votes" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.organizations") %> <%= t("votes.organizations") %>
</p> </p>
</div> </div>
<% elsif user_signed_in? && !debate.votable_by?(current_user)%> <% elsif user_signed_in? && !debate.votable_by?(current_user)%>
<div class="anonymous-votes" style='display:none'> <div class="anonymous-votes" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.anonymous", <%= t("votes.anonymous",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %> verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p> </p>
</div> </div>
<% elsif !user_signed_in? %> <% elsif !user_signed_in? %>
<div class="not-logged" style='display:none'> <div class="not-logged" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated", <%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path), signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>

View File

@@ -1,6 +1,6 @@
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h3 class="sidebar-title"><%= t("shared.tags_cloud.districts") %></h3> <h3 class="sidebar-title"><%= t("shared.tags_cloud.districts") %></h3>
<br> <br>
<%= link_to map_proposals_path, id: 'map' do %> <%= link_to map_proposals_path, id: 'map', title: t("shared.tags_cloud.districts_list") do %>
<%= image_tag("map.jpg") %> <%= image_tag("map.jpg", alt: t("shared.tags_cloud.districts_list")) %>
<% end %> <% end %>

View File

@@ -31,20 +31,20 @@
</div> </div>
<% if user_signed_in? && current_user.organization? %> <% if user_signed_in? && current_user.organization? %>
<div class="organizations-votes" style='display:none'> <div class="organizations-votes" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.organizations") %> <%= t("votes.organizations") %>
</p> </p>
</div> </div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user)%> <% elsif user_signed_in? && !proposal.votable_by?(current_user)%>
<div class="anonymous-votes" style='display:none'> <div class="anonymous-votes" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.verified_only", <%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %> verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p> </p>
</div> </div>
<% elsif !user_signed_in? %> <% elsif !user_signed_in? %>
<div class="not-logged" style='display:none'> <div class="not-logged" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated", <%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path), signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>

View File

@@ -16,14 +16,15 @@
<% elsif voting_allowed %> <% elsif voting_allowed %>
<%= link_to vote_url, <%= link_to vote_url,
class: "button button-support small expanded", class: "button button-support small expanded",
title: t('spending_proposals.spending_proposal.support_title'), method: "post", remote: true do %> title: t('spending_proposals.spending_proposal.support_title'), method: "post", remote: true,
"aria-hidden" => css_for_aria_hidden(reason) do %>
<%= t("spending_proposals.spending_proposal.support") %> <%= t("spending_proposals.spending_proposal.support") %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% if reason.present? && !user_voted_for %> <% if reason.present? && !user_voted_for %>
<div class="no-supports-allowed" style='display:none'> <div class="no-supports-allowed" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.spending_proposals.#{reason}", <%= t("votes.spending_proposals.#{reason}",
verify_account: link_to(t("votes.verify_account"), verification_path), verify_account: link_to(t("votes.verify_account"), verification_path),

View File

@@ -409,6 +409,7 @@ en:
tags_cloud: tags_cloud:
tags: Trending tags: Trending
districts: "Districts" districts: "Districts"
districts_list: "Districts list"
categories: "Categories" categories: "Categories"
target_blank_html: " (link opens in new window)" target_blank_html: " (link opens in new window)"
unflag: Unflag unflag: Unflag

View File

@@ -409,6 +409,7 @@ es:
tags_cloud: tags_cloud:
tags: Tendencias tags: Tendencias
districts: "Distritos" districts: "Distritos"
districts_list: "Listado de distritos"
categories: "Categorías" categories: "Categorías"
target_blank_html: " (se abre en ventana nueva)" target_blank_html: " (se abre en ventana nueva)"
unflag: Deshacer denuncia unflag: Deshacer denuncia