1 |
296 |
ahitrov |
% if ($total > $size) { |
2 |
|
|
<p> |
3 |
|
|
<strong>Страницы:</strong> |
4 |
|
|
<& /inc/pages_.msn, p => $p, n => $size, total => $total, delimiter => ' ' &> |
5 |
|
|
</p> |
6 |
|
|
% } |
7 |
|
|
|
8 |
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="10"> |
9 |
|
|
% my $i=1; |
10 |
|
|
% foreach my $doc (@docs) { |
11 |
|
|
% my ($rate1, $rate2, $rate3); |
12 |
|
|
% if ($doc->rating) { |
13 |
|
|
% $rate3 = 10 % $doc->rating; |
14 |
|
|
% $rate2 = (10 - $rate3) % 2; |
15 |
|
|
% $rate1 = int ((10 - $rate2 - $rate3) / 2); |
16 |
|
|
% $rate3 = int ($rate3 / 2); |
17 |
|
|
% } |
18 |
|
|
% my $date = $3.'.'.$2.'.'.$1 if ($doc->dtime =~ /(\d+)-(\d+)-(\d+)/); |
19 |
|
|
% if ($i % 2) { |
20 |
|
|
<tr valign="top"> |
21 |
|
|
% } |
22 |
|
|
<td width="50%">\ |
23 |
|
|
% ##### Картинко |
24 |
|
|
% my $img = $doc->get_image('icon'); |
25 |
|
|
% if (ref $img && exists $img->{filename}) { |
26 |
|
|
<a href="./?id=<% $doc->id %>"><img src="<% $img->{filename} %>" border="0" align="left" class="imageBorder1" width="<% $img->{width} %>" height="<% $img->{height} %>" alt="<% $doc->name %>" title="<% $doc->name %>" align="left"></a> |
27 |
|
|
% } |
28 |
|
|
<a href="./?id=<% $doc->id %>" style="font-weight: bold; font-size: 11pt;"><% $doc->name %></a><br> |
29 |
|
|
% if ( $doc->abstr ) { |
30 |
|
|
<% $doc->abstr %><br> |
31 |
|
|
% } |
32 |
|
|
% if ( $doc->country ) { |
33 |
|
|
<b>Страна:</b> <% $doc->country %><br> |
34 |
|
|
% } |
35 |
|
|
% if ($doc->rating) { |
36 |
|
|
<table cellspacing="0" cellpadding="0" border="0"> |
37 |
|
|
<tr><td style="padding: 0px;"><b>Рейтинг: </b></td> |
38 |
|
|
<td width="100%" style="padding: 0px;"> |
39 |
|
|
<div style="white-space: nowrap;">\ |
40 |
|
|
% foreach (1 .. $rate1) { |
41 |
|
|
<img src="/i/<% $prj %>/star-on.gif" width="16" height="15">\ |
42 |
|
|
% } |
43 |
|
|
% foreach (1 .. $rate2) { |
44 |
|
|
<img src="/i/<% $prj %>/star-half.gif" width="16" height="15">\ |
45 |
|
|
% } |
46 |
|
|
% foreach (1 .. $rate3) { |
47 |
|
|
<img src="/i/<% $prj %>/star-off.gif" width="16" height="15">\ |
48 |
|
|
% } |
49 |
|
|
</div> |
50 |
|
|
</td></tr> |
51 |
|
|
</table> |
52 |
|
|
% } ###/ Рейтинг |
53 |
|
|
% if ( $doc->url && $doc->url_label ) { |
54 |
|
|
<a href="<% $doc->url %>" target="_blank"><% $doc->url_label %></a><br> |
55 |
|
|
% } |
56 |
|
|
<a href="./?id=<% $doc->id %>" style="text-decoration:none;">подробнее >></a><br> |
57 |
|
|
</td> |
58 |
|
|
% unless ($i++ % 2) { |
59 |
|
|
</tr> |
60 |
|
|
% } |
61 |
|
|
% } |
62 |
|
|
% unless ( $i % 2 ) { |
63 |
|
|
<td></td></tr> |
64 |
|
|
% } |
65 |
|
|
</table> |
66 |
|
|
|
67 |
|
|
|
68 |
|
|
% if ( $total > $size ) { |
69 |
|
|
<p> |
70 |
|
|
<strong>Страницы:</strong> |
71 |
|
|
<& /inc/pages_.msn, p => $p, n => $size, total => $total, delimiter => ' ' &> |
72 |
|
|
</p> |
73 |
|
|
% } |
74 |
|
|
<%args> |
75 |
|
|
|
76 |
|
|
$p => 1 |
77 |
|
|
$size => 4 |
78 |
|
|
$section => undef |
79 |
|
|
|
80 |
|
|
</%args> |
81 |
|
|
<%init> |
82 |
|
|
|
83 |
|
|
my $prj = $request->{project}; |
84 |
|
|
my $profile = $request->{project_profile}; |
85 |
|
|
my $root = $request->{project_section}; |
86 |
|
|
|
87 |
|
|
($section) = $keeper->get_sections ( |
88 |
|
|
s => $root->id, |
89 |
|
|
class => 'promosuite::AnnoSection', |
90 |
|
|
limit => 1, |
91 |
|
|
status => 1, |
92 |
|
|
) unless ref $section; |
93 |
|
|
my $total = $keeper->get_documents ( |
94 |
|
|
s => $section->id, |
95 |
|
|
class => 'promosuite::Anons', |
96 |
|
|
count => 1, |
97 |
|
|
); |
98 |
|
|
my @docs; |
99 |
|
|
if ($p <= (int($total/$size) + ($total % $size ? 1 : 0)) ) { |
100 |
|
|
if ( $section->_sorted ) { |
101 |
|
|
@docs = $keeper->get_sorted_documents ( |
102 |
|
|
s => $section->id, |
103 |
|
|
class => 'promosuite::Anons', |
104 |
|
|
limit => $size, |
105 |
|
|
offset => ($p-1)*$size, |
106 |
|
|
); |
107 |
|
|
}else{ |
108 |
|
|
@docs = $keeper->get_documents ( |
109 |
|
|
s => $section->id, |
110 |
|
|
class => 'promosuite::Anons', |
111 |
|
|
limit => $size, |
112 |
|
|
offset => ($p-1)*$size, |
113 |
|
|
); |
114 |
|
|
} |
115 |
|
|
} |
116 |
|
|
|
117 |
|
|
</%init> |