Skip to content

Instantly share code, notes, and snippets.

@fortl
Created April 28, 2015 15:57
Show Gist options
  • Save fortl/e63b173f540533ece489 to your computer and use it in GitHub Desktop.
Save fortl/e63b173f540533ece489 to your computer and use it in GitHub Desktop.
<ul class='categories__list__section'>
% foreach my $cat (@$categories) {
% next if !$active_categories->{stash('is_brand') ? 'u' : stash('sex') || 'u'}->{$cat->{_id}} && !$cat->{agregate};
<li <%== 'class=\'current\'' if stash('category') eq $cat->{_id} %> >
<a class='categorie__title' href="/admin/shop/<%= $cat->{_id} %>"><%= $cat->{name} %></a>
<a href="#" class="plus"></a>
% if (0) {
<select name="pos">
% foreach (0..@$categories) {
<option value="<%= $_ %>" <%= 'selected' if $cat->{pos} == $_ %>><%= $_ %></option>
% }
</select>
% }
<ul class='second__lvl'>
% foreach my $subcat (@{$cat->{subcats}}) {
<li <%== 'class=\'current\'' if stash('subcategory') eq $subcat->{_id} %>>
<a href="/admin/shop/<%== $cat->{_id} %>/<%= $subcat->{_id} %>"><%= $subcat->{name} %></a>
</li>
% }
</ul>
</li>
% }
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment