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