blob: 5f7d2b8a0f3603afbb0db69f40acc90cb9dffe29 [file] [log] [blame]
% my $side_bar = content_block 'sidebar';
% my $classes = '';
%# TODO: This should not check for login!!!
% my $helpers = app->renderer->helpers;
% if (length($side_bar) == 0 && exists($helpers->{'auth.token'}) && $c->auth->token) {
% 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>