blob: f8d81f05d6d0e01fade7a73c5bd8ae32114dd09a [file] [log] [blame]
% my $side_bar = content_block 'sidebar';
% my $classes = '';
% if (length($side_bar) == 0) {
% if (my $nav = navigation('settings')) {
% $side_bar = b('<nav>' . $nav . '</nav>');
% $classes = 'settings ';
% };
% }
% my $is_empty_sidebar = $side_bar =~ /^\s*(<div[^>]*>\s*<\/div>\s*)*$/i;
% if ($is_empty_sidebar) {
% $classes .= ' invisible';
% };
% if (length($side_bar) == 0 || stash('sidebar_off')) {
% $classes .= ' off';
% } elsif (stash('sidebar_active')) {
% $classes .= ' active';
% } elsif (stash('login_active') && !$classes) {
% $classes .= ' invisible';
% } elsif (!stash('login_active') && $side_bar =~ /<form.*class=".*login.*".*>/i) {
% $classes .= ' invisible';
% };
<aside tabindex="0" class="<%= $classes %>">
<div>
%= $side_bar
</div>
</aside>