.widget header h5 ' Lista de span.fw-semi-bold Categorias / Subcategorias .widget-body - if categorias.empty? h6 Nenhum registro encontrado. - else .table-responsive table.table.table-hover thead tr th Descrição th Tipo th width="150" Qtd. Itens th width="120" tbody - categorias.each do |categoria| - qtd = categoria.quantidade_de_itens tr class="categoria" td - if categoria.tem_subcategorias? i.icone-cadastrar span style="font-weight: 600;" =< categoria.titulo td span style="font-weight: 600;" =< (categoria.localizar :tipo).try(:pluralize).try(:upcase) td span style="font-weight: 600;" = categoria.quantidade_de_itens td - if categoria.pode_ter_itens? = link_to categoria, class: "btn btn-default btn-sm mb-xs", title: "Ver Itens" do i.icone-detalhar - categoria.subcategorias.each do |subcategoria| tr.collapse id="categoria#{categoria.id}" - qtd = subcategoria.itens.count td style="text-indent:20px;" = subcategoria.titulo td td = qtd td = link_to subcategoria, class: "btn btn-default btn-sm mb-xs", title: "Ver Itens" do i.icone-detalhar javascript: $('.categoria').click(function(){ $(this).nextUntil('tr.categoria').slideToggle(100); });