<% add_decidim_page_title(t("decidim.admin.titles.initiatives")) %>

<%= t("decidim.admin.titles.initiatives") %> <% if allowed_to? :export, :initiatives %> <%= export_dropdowns(query) %> <% end %>

<%= admin_filter_selector(:initiatives) %>
<% @initiatives.each do |initiative| %> <% end %>
<%= t("models.initiatives.fields.id", scope: "decidim.admin") %> <%= t("models.initiatives.fields.title", scope: "decidim.admin") %> <%= t("models.initiatives.fields.state", scope: "decidim.admin") %> <%= sort_link(query, :supports_count, t("models.initiatives.fields.supports_count", scope: "decidim.admin"), default_order: :desc) %> <%= sort_link(query, :created_at, t("models.initiatives.fields.created_at", scope: "decidim.admin"), default_order: :desc) %> <%= sort_link(query, :published_at, t("models.initiatives.fields.published_at", scope: "decidim.admin"), default_order: :desc) %> <%= t ".actions_title" %>
<%= initiative.id %> <% if allowed_to? :edit, :initiative, initiative: initiative %> <%= link_to translated_attribute(initiative.title), decidim_admin_initiatives.edit_initiative_path(initiative.to_param) %> <% else %> <%= translated_attribute(initiative.title) %> <% end %> <%= humanize_admin_state initiative.state %> <%= initiative.supports_count %>/<%= initiative.scoped_type.supports_required %> <%= l initiative.created_at, format: :short %> <%= initiative.published_at? ? l(initiative.published_at, format: :short) : "" %> <% if allowed_to? :edit, :initiative, initiative: initiative %> <%= icon_link_to "pencil-line", decidim_admin_initiatives.edit_initiative_path(initiative.to_param), t("actions.configure", scope: "decidim.admin"), class: "action-icon--edit" %> <% else %> <% end %> <% if allowed_to?(:answer, :initiative, initiative: initiative) %> <%= icon_link_to "chat-1-line", edit_initiative_answer_path(initiative.slug), t("actions.answer", scope: "decidim.initiatives"), class: "action-icon action-icon--answer" %> <% else %> <%= icon "chat-1-line", scope: "decidim.admin", class: "action-icon action-icon--disabled", role: "img", "aria-hidden": true %> <% end %> <% if allowed_to? :read, :initiative, initiative: initiative %> <%= icon_link_to "printer-line", decidim_initiatives.print_initiative_path(initiative), t(".print"), class: "action-icon--print", target: "_blank", data: { "external-link": false } %> <% else %> <% end %> <% if allowed_to? :preview, :initiative, initiative: initiative %> <%= icon_link_to "eye-line", decidim_initiatives.initiative_path(initiative.to_param), t(".preview"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %> <% else %> <% end %> <%= free_resource_permissions_link(initiative) || content_tag(:span, nil, class: "action-space icon") %>
<%= decidim_paginate @initiatives %>