<!-- _заглавѥ -->
% my $множество = ($controller eq 'stranici' && $заглавѥ->{permissions} =~ /^d/);
<section class="заглавѥ<%= $множество ? ' множество' : '' %>">
    %= t 'h' . $level => $заглавѥ->{title} =~ s/<[^>]+>?//gr;
<%
# The content element can be displayed in two contexts.
# 1. Страница a.k.a. List context:
# if ($controller eq 'stranici' && $заглавѥ->{permissions} =~ /^d/)
# This is when it is displayed as part (title) of the page.
# This context is when the url to the page only is accessed
# (e.g. http://local.слово.бг:3000/вести.html). In this context the
# content element looks if it is a directory and lists its context, if yes.
# 2. Цѣлина a.k.a Scalar context:
# This is when it is displayed as the main content of the page. In this case it
# simply shows it's body or does something intended for this context.
%>

% if ($множество) { #List
 %== $заглавѥ->{body}
 %# TODO: Add limit and pagination
    <%
    my $celini = celini->all_for_display_in_stranica(
      $page, $user, $ѩꙁыкъ, $preview,
      {
        where => {

          # avoid recursion
          'celini.pid'       => {'='  => $заглавѥ->{id}, '!=' => {-ident => 'celini.id'}},
          'celini.data_type' => {'!=' => 'заглавѥ'},
          'celini.box'       => {-in  => [qw(главна main)]}}});
    %>
    <%==
    $celini->map(sub {
      my $row = shift;
      return include("partials/_pisanie_otkysy", писанѥ => $row, p => $page);
    })->join($/);
    %>
% } else {
    %== $заглавѥ->{body}
% }
</section>

<%

%>