<% if @current_category %> <%= theme_button('Back', 'arrow-left', categories_path(parent_id: @current_category.parent_id), classes: "pull-left mr-10", btn_type: "white") %> <% end %> <%= theme_button('Refresh', 'refresh', categories_path(parent_id: @current_category.try(:id), category_type: @category_type), classes: "pull-left mr-10", btn_type: "white") %> <% if @current_user.has_create_permission?(Dhatu::Category) %> <%= theme_button('Add a Category', 'plus', new_category_path(parent_id: @current_category.try(:id), category_type: @category_type), classes: "pull-left mr-10", btn_type: "success") %> <% end %>
<%= search_form_kuppayam(Dhatu::Category, categories_path, text: @filters[:query]) %>
<%= clear_tag(10) %>
<% c_list = [] %> <% c = @current_category %> <% while c do %> <% c_list << c %> <% c = c.parent %> <% end %> <% if c_list.count >= 1 %> <% end %>
<%= clear_tag %>
<% if display_manage_links? %> <% end %> <% @categories.each_with_index do |category, i| %> <% if category.end_node? %> <% else %> <% end %> <% if display_manage_links? %> <% edit_link = edit_category_path(id: category.id) %> <% delete_link = category_path(id: category.id) %> <% end %> <% end %>
# Name Status Actions
<% if i < 0 %> <% else %> <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %> <% end %> <%= category.display_name %> <%= link_to raw(" #{category.display_name}"), categories_path(parent_id: category.id), remote: true %> <% if category.unpublished? %> Un-Published <% elsif category.published? %> Published <% elsif category.removed? %> Disabled <% end %>
<%= paginate_kuppayam(@categories) %>