Sha256: 3a3324da91627952dd07680e73a94a5035c576ad0ec6d1a3110645fe91846f8e

Contents?: true

Size: 977 Bytes

Versions: 7

Compression:

Stored size: 977 Bytes

Contents

<% if current_user.user_groups.empty? %>
update_main_page_button();
<% end %>
update_identities_rows();

function update_main_page_button() {
  var $proposalEndorsementButton = $('#proposal-<%= proposal.id %>-endorsement-button');
  morphdom($proposalEndorsementButton[0], '<%= j(endorsement_button(proposal, false)).strip.html_safe %>');
}
function update_identities_rows() {
  <% fully_endorsed= fully_endorsed?(proposal, current_user) %>
  var $proposalEndorsementsRowCount = $('#proposal-<%= proposal.id %>-endorsements-count');
  morphdom($proposalEndorsementsRowCount[0], '<%= j(render partial: 'decidim/proposals/proposals/endorsements_count', locals: { proposal: proposal, fully_endorsed: fully_endorsed }).strip.html_safe %>');
  var $proposalEndorsementsRowButton = $($('#select-identity-button')[0]);
  <% if fully_endorsed %>
    $proposalEndorsementsRowButton.addClass('success')
  <% else %>
    $proposalEndorsementsRowButton.removeClass('success')
  <% end %>
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-proposals-0.12.2 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.12.1 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.12.0 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.11.2 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.12.0.pre app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.11.1 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb
decidim-proposals-0.11.0.pre1 app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb