Includes aria hidden attribute on support buttons
This commit is contained in:
7
app/helpers/accessibility_helper.rb
Normal file
7
app/helpers/accessibility_helper.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module AccessibilityHelper
|
||||||
|
|
||||||
|
def css_for_aria_hidden(reason)
|
||||||
|
reason.present? ? "true" : ""
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -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 %>
|
||||||
|
|||||||
@@ -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 %>
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user