& "/contenido/components/title.msn" &>
% if ( ref $docs eq 'ARRAY' && @$docs ) {
% if ($total > $size) {
<& /inc/pages_.msn, p => $p, n => $size, total => $total, params => {%ARGS} &>
% }
% my @props = sort { $a->{column} <=> $b->{column} } grep { exists $_->{column} } $docs->[0]->required_properties;
% foreach my $prop (@props) {
<% $prop->{rusname} %> |
% }
% foreach my $doc (@$docs) {
% my $color = $doc->contenido_status_style ? $doc->contenido_status_style :
% $doc->status == 1 ? 'blue' :
% $doc->status == 0 ? 'gray' : 'blue';
%# my ($stat) = grep { $_->{attr} eq 'status' } @props;
%# my ($case) = grep { $_->[0] == $banner->status } @{ $stat->{cases} } if ref $stat eq 'HASH' && exists $stat->{cases};
% foreach my $prop (@props) {
% my $attr = $prop->{attr};
% if ( $attr =~ /dtime/ ) {
<& "/contenido/components/show_dtime.msn", dtime => $doc->$attr &> |
% }else{
<% $doc->$attr %> |
% }
% }
% }
% }
%#<% Dumper($docs->[0]->required_properties) %>
<%args>
$id => undef
$filter => undef
$field => undef
$class => undef
$order_by => undef
$p => 1
%args>
<%init>
my ($docs, $total);
my $size = 15;
if ( $id && $filter && $class ) {
my %opts = ();
$opts{$filter} = $id;
$opts{order_by} = $order_by if $order_by;
$docs = $keeper->get_documents (
class => $class,
return_mode => 'array_ref',
offset => ($p-1)*$size,
limit => $size,
%opts,
);
$total = $keeper->get_documents (
class => $class,
count => 1,
%opts,
);
} else {
return;
}
%init>