[%- SET nav = scaffold.nav_sections -%]

[% FOREACH i IN nav %] [% SET is_current = 0 %] [% IF i.path == request_path %] [% SET is_current = 1 %] [% ELSIF i.children %] [% FOREACH child IN i.children %] [% SET is_current = 1 IF child.path == request_path %] [% END %] [% END %] [% SET cls = '' %] [% SET cls = cls _ 'current' IF is_current %] [% SET cls = cls _ ' has_children' IF i.children %] [% SET href = i.path || '#' %]
- [% i.title %] [% IF i.children %]
  [% FOREACH child IN i.children %]
  - [% child.title %]
  [% END %]
  [% END %]
[% END %] [%- IF User -%]
- [% SET img_url = User.image_url || 'images/user-01.png' %] [% User.username %] ▼
  - New Post
  - Admin area
  - User Profile
  - Sign out
[%- ELSE -%]
- Sign in
[%- END -%]