Revision 296 (by ahitrov, 2013/03/26 17:59:01) Promosite (anthill) project source
<table border="0" cellspacing="0" cellpadding="0" width="100%" >
<tr valign="top">
<td>

<h2><% $id ? 'All news' : $section->name %></h2>

% foreach my $doc (@news) {
%	my ($a1, $a2) = $doc->body ? ('<a href="./news.html?id='.$doc->id.'">','</a>') : ('','');
%	my $dt = Contenido::DateTime->new( postgres => $doc->dtime );
<p class="<% $class %>"><span style="font-size:10px; color:navy; padding-right:5px;"><% $dt->dmy('.') %>:</span> <% $a1.$doc->name.$a2 %></p>
%	if ( $doc->abstr ) {
<p class="abstr"><% $doc->abstr %></p>
%	}
<div style="height:10px"><spacer type="block" height="10"></div>
% }

% if ($total > $n) {
<div align="center" class="pgs">Страница <& /inc/pages_.msn,
        total => $total, n => $n, p => $p  &></div>
% }

</td>
</tr>
</table>
<%args>

	$n		=> 20
	$p		=> 1
	$id		=> undef
	$class		=> 'news'
	$section	=> undef

</%args>
<%init>

  my $prj = $request->{project};
  my $profile = $request->{project_profile};
  my $root = $request->{project_section};
  ($section) = $keeper->get_sections (
		s       => $root->id,
		class   => 'promosuite::NewsSection',
		status  => 1,
		limit   => 1,
	)			unless ref $section;
  return        unless  ref $section;
  my $total = $keeper->get_documents (
		s	=> $section->id,
		class   => 'promosuite::News',
		status	=> 'positive',
		count	=> 1,
	);
  my @news = $keeper->get_documents (
		s	=> $section->id,
		class   => 'promosuite::News',
		status	=> 'positive',
		limit	=> $n,
		offset	=> $n*($p-1),
		order	=> [qw|date direct|],
	);
  return	unless @news;

</%init>