Sha256: 04ba383c158292359524afa659571d18a9057135e99171e1fdcbad9f4a329c4f

Contents?: true

Size: 1.6 KB

Versions: 6

Compression:

Stored size: 1.6 KB

Contents

<% if Decidim::Initiatives.creation_enabled %>
  <% if current_user && available_initiative_types.size > 1 %>
    <%= link_to create_initiative_path(:select_initiative_type), class: "!px-4 title-action__action button button__xl button__secondary w-full" do %>
      <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
      <%= icon "add-fill" %>
    <% end %>
  <% elsif current_user %>
    <% if allowed_to?(:create, :initiative, { initiative_type: available_initiative_types.first }) %>
      <%= link_to create_initiative_path(:select_initiative_type), class: "!px-4 title-action__action button button__xl button__secondary w-full" do %>
        <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
        <%= icon "add-fill" %>
      <% end %>
    <% else %>
      <%= authorized_create_modal_button(available_initiative_types.first, remote: true, class: "!px-4 title-action__action button button__xl button__secondary w-full") do %>
        <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
        <%= icon "add-fill" %>
      <% end %>
    <% end %>
  <% else %>
    <% content_for(:redirect_after_login) { create_initiative_url(:select_initiative_type) } %>
    <button type="button" class="button button__xl button__secondary w-full" data-dialog-open="loginModal" aria-controls="loginModal" aria-haspopup="dialog" tabindex="0">
      <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
      <%= icon "add-fill" %>
    </button>
  <% end %>
<% end %>

<%= render partial: "decidim/initiatives/modal" %>

Version data entries

6 entries across 6 versions & 1 rubygems

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