Files
grecia/app/views/proposals/_votes.html.erb
2015-09-13 16:22:50 +02:00

38 lines
1.4 KiB
Plaintext

<% voted_classes = css_classes_for_proposal_vote(@proposal_votes, proposal) %>
<div class="supports">
<div class="progress small-12 radius">
<span class="meter" style="width: 10%;"></span>
</div>
<span class="total-supports">
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>&nbsp;<span><%= t("proposals.proposal.supports_necessary") %></span>
</span>
<%= link_to vote_proposal_path(proposal, value: 'yes'), class: "button button-support tiny radius expand #{voted_classes[:in_favor]}",
title: t('proposals.proposal.support'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% if user_signed_in? && current_user.organization? %>
<div class="organizations-votes" style='display:none'>
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user)%>
<div class="anonymous-votes" style='display:none'>
<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'>
<%= 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 %>
</div>
<% end %>
</div>