Includes aria hidden attribute on support buttons

This commit is contained in:
Alberto Garcia Cabeza
2016-05-04 15:21:20 +02:00
parent ddd061a17f
commit d46a2f9335
4 changed files with 16 additions and 8 deletions

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>
<% 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>
<%= t("votes.organizations") %>
</p>
</div>
<% 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>
<%= t("votes.anonymous",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
<% elsif !user_signed_in? %>
<div class="not-logged" style='display:none'>
<div class="not-logged" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>

View File

@@ -31,20 +31,20 @@
</div>
<% 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>
<%= t("votes.organizations") %>
</p>
</div>
<% 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>
<%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
<% elsif !user_signed_in? %>
<div class="not-logged" style='display:none'>
<div class="not-logged" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>

View File

@@ -16,14 +16,15 @@
<% elsif voting_allowed %>
<%= link_to vote_url,
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") %>
<% end %>
<% end %>
</div>
<% 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>
<%= t("votes.spending_proposals.#{reason}",
verify_account: link_to(t("votes.verify_account"), verification_path),