<%= t("categories.index.categories_title", scope: "decidim.admin") %> <% if can? :create, Decidim::Category %> <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_category_path(current_participatory_space), class: 'button tiny button--title new' %> <% end %>

<% if current_participatory_space.categories.any? %>
<% current_participatory_space.categories.first_class.each do |category| %> <% category.subcategories.each do |subcategory| %> <% end %> <% end %>
<%= t("activemodel.attributes.category.name") %>
<%= link_to translated_attribute(category.name), edit_category_path(current_participatory_space, category) %>
<% if can? :update, category %> <%= icon_link_to "pencil", edit_category_path(current_participatory_space, category), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> <% if can? :destroy, category %> <% if category.unused? %> <%= icon_link_to "circle-x", category_path(current_participatory_space, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> <% else %> " data-tooltip="true" data-disable-hover="false"> <%= icon "circle-x", class: "action-icon action-icon--disabled" %> <% end %> <% end %>
<%= link_to translated_attribute(subcategory.name), edit_category_path(current_participatory_space, subcategory) %>
<% if can? :update, subcategory %> <%= icon_link_to "pencil", edit_category_path(current_participatory_space, subcategory), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> <% if can? :destroy, subcategory %> <%= icon_link_to "circle-x", category_path(current_participatory_space, subcategory), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> <% end %>
<% end %>