Line # Revision Author
1 296 ahitrov
2 <table border="0" cellspacing="0" cellpadding="10" width="100%" >
3 <tr valign="top">
4 <td>
5
6 <h2><% $id ? 'Все новости' : 'Новости' %></h2>
7
8 <table cellpadding=0 cellspacing=0 border=0 width=100%>
9 % foreach my $doc (@news) {
10 <tr valign=top>
11 <td class=ppp><p><img src="/i/<% $prj %>/plus.gif" width="12" height="12" alt="" border="0" vspace=3 align=left></td>
12 <td width=100%><p>
13 % if ($id && $id == $doc->id) {
14 <b><% $doc->name %></b>
15 % }else{
16 <a href="news.html?id=<% $doc->id %>"><% $doc->name %></a>
17 % }
18 </td>
19 </tr>
20 % }
21 </table>
22
23 % if ($total > $n) {
24 <div align="center" class="pgs">Страница <& /inc/pages_.msn,
25 total => $total, n => $n, p => $p &></div>
26 % }
27
28 </td>
29 </tr>
30 </table>
31
32
33 <%args>
34
35 $n => 20
36 $p => 1
37 $id => undef
38
39 </%args>
40 <%init>
41
42 my $prj = $request->{project};
43 my $profile = $request->{project_profile};
44 my $root = $request->{project_section};
45 my ($section) = $keeper->get_sections (
46 s => $root->id,
47 class => 'promosuite::NewsSection',
48 status => 1,
49 limit => 1,
50 );
51 return unless ref $section;
52 my $total = $keeper->get_documents (
53 s => $section->id,
54 # class => 'promosuite::Article',
55 class => 'promosuite::News',
56 status => [1,2],
57 count => 1,
58 );
59 my @news = $keeper->get_documents (
60 s => $section->id,
61 # class => 'promosuite::Article',
62 class => 'promosuite::News',
63 status => [1,2],
64 limit => $n,
65 offset => $n*($p-1),
66 order => [qw|date direct|],
67 light => 1,
68 );
69 return unless @news;
70
71 </%init>