Sha256: 75ca41e3be4c02b7edca3dc2d5cbb9f14d9f75fe80a45944c470f1555b245053

Contents?: true

Size: 1.17 KB

Versions: 36

Compression:

Stored size: 1.17 KB

Contents

var $proposalVotesCount = $('#proposal-<%= proposal.id %>-votes-count');
var $proposalVoteButton = $('#proposal-<%= proposal.id %>-vote-button');

morphdom($proposalVotesCount[0], '<%= j(render partial: 'decidim/proposals/proposals/votes_count', locals: { proposal: proposal, from_proposals_list: @from_proposals_list }).strip.html_safe %>');
morphdom($proposalVoteButton[0], '<%= j(render partial: 'decidim/proposals/proposals/vote_button', locals: { proposal: proposal, from_proposals_list: @from_proposals_list }).strip.html_safe %>');

<% if vote_limit_enabled? %>
  var $remainingVotesCount = $('#remaining-votes-count');
  var $notVotedButtons = $('.card__button.button').not('.success');

  morphdom($remainingVotesCount[0], '<%= j(render partial: 'decidim/proposals/proposals/remaining_votes_count').strip.html_safe %>');

  <% if remaining_votes_count_for(current_user) == 0 %>
    $notVotedButtons.attr('disabled', true);
    $notVotedButtons.val('<%= t('decidim.proposals.proposals.vote_button.no_votes_remaining') %>');
  <% else %>
    $notVotedButtons.attr('disabled', false);
    $notVotedButtons.val('<%= t('decidim.proposals.proposals.vote_button.vote') %>');
  <% end %>
<% end %>

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
decidim-proposals-0.13.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.12.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.13.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.12.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.13.0.pre1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.12.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.11.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.12.0.pre app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.11.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.11.0.pre1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.10.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.10.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.9.3 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.9.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.9.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.9.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.8.4 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.8.3 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.8.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.8.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb