fixes styles when support a proposal
This commit is contained in:
@@ -1,64 +1,66 @@
|
||||
<div class="progress small-12 round">
|
||||
<span class="meter" style="width: <%= progress_bar_percentage(proposal) %>%;"></span>
|
||||
<span class="percentage">
|
||||
<%= supports_percentage(proposal) %> / <%= t("proposals.proposal.total_percent") %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="supports text-center">
|
||||
<div class="progress small-12 round">
|
||||
<span class="meter" style="width: <%= progress_bar_percentage(proposal) %>%;"></span>
|
||||
<span class="percentage">
|
||||
<%= supports_percentage(proposal) %> / <%= t("proposals.proposal.total_percent") %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="total-supports">
|
||||
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>
|
||||
<span>
|
||||
<abbr title="<%= t("proposals.proposal.reason_for_supports_necessary") %>">
|
||||
<%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %>
|
||||
</abbr>
|
||||
<span class="total-supports">
|
||||
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>
|
||||
<span>
|
||||
<abbr title="<%= t("proposals.proposal.reason_for_supports_necessary") %>">
|
||||
<%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %>
|
||||
</abbr>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<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") %>
|
||||
<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 %>
|
||||
<% else %>
|
||||
<div class="button button-support small expanded">
|
||||
<%= t("proposals.proposal.support") %>
|
||||
</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(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif !user_signed_in? %>
|
||||
<div tabindex="0">
|
||||
<div class="participation-not-allowed" 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 %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %>
|
||||
<div class="share-supported">
|
||||
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
|
||||
</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(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif !user_signed_in? %>
|
||||
<div tabindex="0">
|
||||
<div class="participation-not-allowed" 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 %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %>
|
||||
<div class="share-supported">
|
||||
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user