1 |
296 |
ahitrov |
<table border="0" cellspacing="0" cellpadding="0" width="100%" > |
2 |
|
|
<tr valign="top"> |
3 |
|
|
<td> |
4 |
|
|
|
5 |
|
|
<h2><% $id ? 'All news' : $section->name %></h2> |
6 |
|
|
|
7 |
|
|
% foreach my $doc (@news) { |
8 |
|
|
% my ($a1, $a2) = $doc->body ? ('<a href="./news.html?id='.$doc->id.'">','</a>') : ('',''); |
9 |
|
|
% my $dt = Contenido::DateTime->new( postgres => $doc->dtime ); |
10 |
|
|
<p class="<% $class %>"><span style="font-size:10px; color:navy; padding-right:5px;"><% $dt->dmy('.') %>:</span> <% $a1.$doc->name.$a2 %></p> |
11 |
|
|
% if ( $doc->abstr ) { |
12 |
|
|
<p class="abstr"><% $doc->abstr %></p> |
13 |
|
|
% } |
14 |
|
|
<div style="height:10px"><spacer type="block" height="10"></div> |
15 |
|
|
% } |
16 |
|
|
|
17 |
|
|
% if ($total > $n) { |
18 |
|
|
<div align="center" class="pgs">Страница <& /inc/pages_.msn, |
19 |
|
|
total => $total, n => $n, p => $p &></div> |
20 |
|
|
% } |
21 |
|
|
|
22 |
|
|
</td> |
23 |
|
|
</tr> |
24 |
|
|
</table> |
25 |
|
|
<%args> |
26 |
|
|
|
27 |
|
|
$n => 20 |
28 |
|
|
$p => 1 |
29 |
|
|
$id => undef |
30 |
|
|
$class => 'news' |
31 |
|
|
$section => undef |
32 |
|
|
|
33 |
|
|
</%args> |
34 |
|
|
<%init> |
35 |
|
|
|
36 |
|
|
my $prj = $request->{project}; |
37 |
|
|
my $profile = $request->{project_profile}; |
38 |
|
|
my $root = $request->{project_section}; |
39 |
|
|
($section) = $keeper->get_sections ( |
40 |
|
|
s => $root->id, |
41 |
|
|
class => 'promosuite::NewsSection', |
42 |
|
|
status => 1, |
43 |
|
|
limit => 1, |
44 |
|
|
) unless ref $section; |
45 |
|
|
return unless ref $section; |
46 |
|
|
my $total = $keeper->get_documents ( |
47 |
|
|
s => $section->id, |
48 |
|
|
class => 'promosuite::News', |
49 |
|
|
status => 'positive', |
50 |
|
|
count => 1, |
51 |
|
|
); |
52 |
|
|
my @news = $keeper->get_documents ( |
53 |
|
|
s => $section->id, |
54 |
|
|
class => 'promosuite::News', |
55 |
|
|
status => 'positive', |
56 |
|
|
limit => $n, |
57 |
|
|
offset => $n*($p-1), |
58 |
|
|
order => [qw|date direct|], |
59 |
|
|
); |
60 |
|
|
return unless @news; |
61 |
|
|
|
62 |
|
|
</%init> |