Sha256: 4a61a1884dc3bb42247ed66cf490f3cfdf47a0ff5f110166e9d7a4c6a5250152

Contents?: true

Size: 1.34 KB

Versions: 6

Compression:

Stored size: 1.34 KB

Contents

<% if allowed_to? :vote, :initiative, initiative: initiative %>
  <% if steps %>
    <%= link_to(
      vote_label,
      initiative_signatures_path(initiative_slug: current_initiative.slug),
      class: "button button__xl w-full button__secondary"
    ) %>
  <% else %>
    <%= button_to(
      vote_label,
      initiative_signatures_path(initiative_slug: current_initiative.slug),
      remote: true,
      data: { disable: true },
      class: "button button__xl w-full button__secondary"
    ) %>
  <% end %>
<% else %>
  <% if initiative.voted_by?(current_user) %>
    <% if allowed_to? :unvote, :initiative, initiative: initiative %>
      <%= button_to(
        initiative_initiative_vote_path(initiative_slug: current_initiative.slug),
        method: :delete,
        remote: true,
        data: { disable: true },
        class: "button button__xl w-full button__secondary success"
      ) do %>
        <%= icon "check-line" %>
        <%= unvote_label %>
      <% end %>
    <% else %>
      <button class='button button__xl w-full button__secondary success' disabled>
        <%= icon "check-line" %>
        <%= unvote_label %>
      </button>
    <% end %>
  <% else %>
    <%= authorized_vote_modal_button(initiative, remote: true, class: "button button__xl w-full button__secondary") do %>
      <%= verification_label %>
    <% end %>
  <% end %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-initiatives-0.29.1 app/views/decidim/initiatives/initiatives/_vote_button.html.erb
decidim-initiatives-0.29.0 app/views/decidim/initiatives/initiatives/_vote_button.html.erb
decidim-initiatives-0.29.0.rc4 app/views/decidim/initiatives/initiatives/_vote_button.html.erb
decidim-initiatives-0.29.0.rc3 app/views/decidim/initiatives/initiatives/_vote_button.html.erb
decidim-initiatives-0.29.0.rc2 app/views/decidim/initiatives/initiatives/_vote_button.html.erb
decidim-initiatives-0.29.0.rc1 app/views/decidim/initiatives/initiatives/_vote_button.html.erb