Files
grecia/app/views/proposals/_votes.html.erb
Javi Martín 86a205c8fc Extract link to verify account to a mehtod
We were using the same text and the same route in many places.
2019-10-05 14:20:03 +02:00

48 lines
1.6 KiB
Plaintext

<div class="supports text-center">
<%= render "proposals/supports", proposal: proposal %>
<div class="in-favor">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported callout success">
<%= t("proposals.proposal.already_supported") %>
</div>
<% elsif user_signed_in? && proposal.votable_by?(current_user) %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t("proposals.proposal.support_title"), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% else %>
<div class="button button-support small expanded">
<%= t("proposals.proposal.support") %>
</div>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
<div tabindex="0">
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
<p>
<%= t("votes.verified_only", verify_account: link_to_verify_account).html_safe %>
</p>
</div>
</div>
<% elsif !user_signed_in? %>
<div tabindex="0">
<%= render "shared/login_to_vote" %>
</div>
<% end %>
<% if voted_for?(@proposal_votes, proposal) && setting["twitter_handle"] %>
<div class="share-supported">
<%= render "proposals/social_share", proposal: proposal, share_title: false %>
</div>
<% end %>
</div>