adds already supported proposals

This commit is contained in:
rgarcia
2015-09-14 21:21:34 +02:00
parent fff099e72d
commit eea3b0922e
5 changed files with 40 additions and 28 deletions

View File

@@ -1,4 +1,3 @@
<% voted_classes = css_classes_for_vote(@proposal_votes, proposal) %>
<div class="supports">
<div class="progress small-12 round">
@@ -7,9 +6,7 @@
<span class="total-supports">
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>&nbsp;
<!-- percentage of supports -->
(<%= supports_percentage(proposal) %>)
<!-- /. percentage of supports -->
<span>
<abbr title="<%= t("proposals.proposal.census_percent") %>">
<%= t("proposals.proposal.supports_necessary") %>
@@ -18,15 +15,17 @@
</span>
<div class="in-favor">
<%= link_to vote_proposal_path(proposal, value: 'yes'), class: "button button-support tiny radius expand #{voted_classes[:in_favor]}",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<!-- if user supported dissapear the button and appear this :) -->
<div class="supported" style="display: none;">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported">
<%= t("proposals.proposal.already_supported") %>
</div>
<!-- /. if user supported dissapear the button and appear this :) -->
<% else %>
<%= link_to vote_proposal_path(proposal, value: 'yes'),
class: "button button-support tiny radius expand",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>