Sha256: feaea1348ca1a8dba58d28f2ae31518fd7133d32d587cf8ffa88373f56ae3385

Contents?: true

Size: 1.12 KB

Versions: 40

Compression:

Stored size: 1.12 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 }) %>');
morphdom($proposalVoteButton[0], '<%= j(render partial: 'decidim/proposals/proposals/vote_button', locals: { proposal: proposal, from_proposals_list: @from_proposals_list }) %>');

<% 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') %>');

  <% 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

40 entries across 40 versions & 2 rubygems

Version Path
decidim-proposals-0.6.3 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.6.3 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.6.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.6.2 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.6.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.6.1 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.6.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.6.0 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.5.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.5.1 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.5.0 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.5.0 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.4.4 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.4.4 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.4.3 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.4.2 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-proposals-0.4.1 app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.4.3 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.4.2 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb
decidim-0.4.1 decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb