% layout 'upravlenie', title => 'Blog/Stranici';
% my @columns = qw(id pid dom_id alias page_type permissions user_id group_id published hidden); #table columns
%= link_to 'New record in table "stranici"' => 'create_stranici'
<table>
<thead>
<tr>
% for my $column (@columns) {
<th><%= uc($column) %></th>
% }
</tr>
</thead>
<tbody>
% for my $s (@$stranici) {
% my $class = join ' ', map {$s->{$_}? $_:undef} qw(hidden deleted);
% $class .= $s->{stop} != 0 && $s->{stop} < time ? ' expired' : '';
% $class .= $s->{start} != 0 && $s->{start} > time ? ' upcoming' : '';
%= t tr => (class=> $class) => begin
<td><%= link_to $s->{id} => show_stranici => {id => $s->{id}} %></td>
% for my $column (@columns[1 .. $#columns]) {
<td><%= $s->{$column} %></td>
% }
<td>
%#TODO: Implement I18N
% my $l = $c->dbx->db->select('celini','language',{page_id=>$s->{id},sorting => 0,data_type => 'заглавѥ'})->hash->{language};
<%= link_to Edit =>
url_with('edit_stranici',{id => $s->{id}})->query([language=>$l]) %>
<%= link_to 'Add here' =>
url_with('create_stranici')->query([pid => $s->{id}, dom_id => $s->{dom_id}]),
(title => 'Add page under '. $s->{alias})
%>
<%= link_to 'Add content' =>
url_with('create_celini')->query([page_id => $s->{id}, ]),
(title => 'Add content to page '. $s->{alias})
%>
<%= link_to 'List content' =>
url_with('home_celini')->query([page_id => $s->{id}, ]),
(title => 'List content of page '. $s->{alias})
%>
<%= link_to 'Preview' =>
url_with('покажи_страница' =>{ страница => $s->{alias} })->query([прегледъ => 1]),
(title => 'List content of page '. $s->{alias}, target => 'new')
%>
</td>
% end
% }
</tbody>
</table>