|
@@ -45,8 +45,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="actions">
|
|
<div class="actions">
|
|
|
<% if can? :create, Category %>
|
|
<% if can? :create, Category %>
|
|
|
- <%= link_to new_category_path, {:class=>"btn bold green pull-right filtros"} do %> Nueva Línea de producto <i class="fa fa-plus"></i>
|
|
|
|
|
- <% end %>
|
|
|
|
|
|
|
+ <%= link_to new_category_path, {:class=>"btn bold green pull-right filtros"} do %> Nueva Línea de producto <i class="fa fa-plus"></i><% end %>
|
|
|
<% end %>
|
|
<% end %>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -62,26 +61,26 @@
|
|
|
<th>Total de productos</th>
|
|
<th>Total de productos</th>
|
|
|
<th>Status</th>
|
|
<th>Status</th>
|
|
|
<% if can? :manage, Category %>
|
|
<% if can? :manage, Category %>
|
|
|
- <th>Acciones</th>
|
|
|
|
|
|
|
+ <th>Acciones</th>
|
|
|
<% end %>
|
|
<% end %>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
<% @categories.each_with_index do |category, key| %>
|
|
<% @categories.each_with_index do |category, key| %>
|
|
|
- <tr <% if !category.children.empty? %> class="bold" <% end %> >
|
|
|
|
|
|
|
+ <tr <% if category.parent_id.zero? %> class="bold" <% end %> >
|
|
|
<td><%= key + 1 %></td>
|
|
<td><%= key + 1 %></td>
|
|
|
<td><%= category.category %></td>
|
|
<td><%= category.category %></td>
|
|
|
<td><%= category.description %></td>
|
|
<td><%= category.description %></td>
|
|
|
<td>
|
|
<td>
|
|
|
- <% if category.children.empty? %>
|
|
|
|
|
- <%= category.products.length %>
|
|
|
|
|
- <% else %>
|
|
|
|
|
- <% @productsofchildren = 0 %>
|
|
|
|
|
|
|
+ <% total_products = category.products.length %>
|
|
|
|
|
+ <% if !category.children.empty? %>
|
|
|
|
|
+ <% productsofchildren = 0 %>
|
|
|
<% category.children.each_with_index do |child, k|%>
|
|
<% category.children.each_with_index do |child, k|%>
|
|
|
- <% @productsofchildren += child.products.length %>
|
|
|
|
|
|
|
+ <% productsofchildren += child.products.length %>
|
|
|
<% end %>
|
|
<% end %>
|
|
|
- <%= @productsofchildren %>
|
|
|
|
|
|
|
+ <% total_products += productsofchildren %>
|
|
|
<% end %>
|
|
<% end %>
|
|
|
|
|
+ <%= total_products %>
|
|
|
</td>
|
|
</td>
|
|
|
<td class="text-center">
|
|
<td class="text-center">
|
|
|
<% if category.active? %>
|
|
<% if category.active? %>
|
|
@@ -112,7 +111,7 @@
|
|
|
</td>
|
|
</td>
|
|
|
<% end %>
|
|
<% end %>
|
|
|
</tr>
|
|
</tr>
|
|
|
- <% category.children.each_with_index do |child, k|%>
|
|
|
|
|
|
|
+ <% category.children.each_with_index do |child, k| %>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td><%= key + 1 %> - <%= k + 1 %></td>
|
|
<td><%= key + 1 %> - <%= k + 1 %></td>
|
|
|
<td><span class="text-muted"> <%= child.category %> </span></td>
|
|
<td><span class="text-muted"> <%= child.category %> </span></td>
|