Sha256: 3cc127df50a5457d975ec6afb549f4f15c8662619fa17c9e762ff9afcb545378

Contents?: true

Size: 1.96 KB

Versions: 24

Compression:

Stored size: 1.96 KB

Contents

<div id="proposal-<%= proposal.id %>-vote-button">
  <% if !current_user %>
    <% if current_settings.votes_blocked? %>
      <%= action_authorized_button_to :vote, t('.votes_blocked'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "card__button button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
    <% else %>
      <%= action_authorized_button_to :vote, t('.vote'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "card__button button #{vote_button_classes(from_proposals_list)}" %>
    <% end %>
  <% else %>
    <% if @voted_proposals ? @voted_proposals.include?(proposal.id) : proposal.voted_by?(current_user) %>
      <%= action_authorized_button_to :vote, t('.already_voted'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), method: :delete, remote: true, data: { disable: true }, class: "card__button button #{vote_button_classes(from_proposals_list)} success" %>
    <% else %>
      <% if vote_limit_enabled? && remaining_votes_count_for(current_user) == 0 %>
        <%= action_authorized_button_to :vote, t('.no_votes_remaining'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), remote: true, data: { disable: true }, class: "card__button button #{vote_button_classes(from_proposals_list)}", disabled: true %>
      <% elsif current_settings.votes_blocked? %>
        <button class="card__button button <%= vote_button_classes(from_proposals_list) %> disabled" disabled>
          <%= t('.votes_blocked') %>
        </button>
      <% else %>
        <%= action_authorized_button_to :vote, t('.vote'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), remote: true, data: { disable: true }, class: "card__button button #{vote_button_classes(from_proposals_list)}" %>
      <% end %>
    <% end %>
  <% end %>
</div>

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
decidim-proposals-0.3.1 app/views/decidim/proposals/proposals/_vote_button.html.erb
decidim-0.3.1 decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb
decidim-proposals-0.3.0 app/views/decidim/proposals/proposals/_vote_button.html.erb
decidim-0.3.0 decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb