1 |
296 |
ahitrov |
<h2><% ref $section ? $section->name : 'NEWS' %></h2> |
2 |
|
|
|
3 |
|
|
% foreach my $doc (@news) { |
4 |
|
|
<p class="std"><% $doc->name %></p> |
5 |
|
|
% } |
6 |
|
|
<%args> |
7 |
|
|
|
8 |
|
|
$n => undef |
9 |
|
|
|
10 |
|
|
</%args> |
11 |
|
|
<%init> |
12 |
|
|
|
13 |
|
|
my $prj = $request->{project}; |
14 |
|
|
my $profile = $request->{project_profile}; |
15 |
|
|
my $root = $request->{project_section}; |
16 |
|
|
$n = $n || $profile->newsblock_count || 5; |
17 |
|
|
my @news; |
18 |
|
|
my ($section) = $keeper->get_sections ( |
19 |
|
|
s => $root->id, |
20 |
|
|
class => 'promosuite::NewsSection', |
21 |
|
|
status => 1, |
22 |
|
|
limit => 1, |
23 |
|
|
); |
24 |
|
|
return unless ref $section; |
25 |
|
|
@news = $keeper->get_documents ( |
26 |
|
|
s => $section->id, |
27 |
|
|
class => 'promosuite::News', |
28 |
|
|
status => 2, |
29 |
|
|
limit => $n, |
30 |
|
|
order => [qw|date direct|], |
31 |
|
|
light => 1, |
32 |
|
|
); |
33 |
|
|
|
34 |
|
|
return unless @news; |
35 |
|
|
|
36 |
|
|
</%init> |