1 |
296 |
ahitrov |
% if ( $m->comp_exists ("/comps/$prj/header.msn") ) { |
2 |
|
|
<& "/comps/$prj/header.msn" &> |
3 |
|
|
% } else { |
4 |
|
|
<& "/comps/header.msn" &> |
5 |
|
|
% } |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
% ### контент |
9 |
|
|
|
10 |
|
|
<table cellspacing="0" cellpadding="0" width="100%" border="0"> |
11 |
|
|
<tr><td width="4%"><div style="width: 10px; height: 1px"><spacer height="1" width="10" type="block"></div></td> |
12 |
|
|
<td width="92%" valign="top" style="padding-top:11px;"> |
13 |
|
|
<div style="padding:14px 15px; width:890px;" class="hdr"><a href="./photo.html"><% $section->name %></a></div> |
14 |
|
|
|
15 |
|
|
% if ( ref $document ) { |
16 |
|
|
|
17 |
|
|
<div style="background:#333333;padding:10px 15px;" class="hdr"><% $document->name %></div> |
18 |
|
|
|
19 |
|
|
% if ( $m->comp_exists ("/comps/$prj/block_rep_photos.msn") ) { |
20 |
|
|
<& "/comps/$prj/block_rep_photos.msn", doc => $document &> |
21 |
|
|
% } else { |
22 |
|
|
<& "/comps/block_rep_photos.msn", doc => $document &> |
23 |
|
|
% } |
24 |
|
|
<br clear="all" style="font-size:5px;"> |
25 |
|
|
<div style="background:#333333; height:1px; margin-bottom: 10px;" ><spacer type="block"></div> |
26 |
|
|
<div class="photo-l" style="padding-bottom:20px; padding-left: 15px;"><a href="./photo.html">Вернуться к фотогалерее</a></div> |
27 |
|
|
|
28 |
|
|
|
29 |
|
|
% } elsif ( ref $section &&ref $documents eq 'ARRAY' && @$documents ) { |
30 |
|
|
% foreach my $photorep ( @$documents ) { |
31 |
|
|
<div style="background:#333333;padding:10px 15px;" class="hdr"><% $photorep->name %></div> |
32 |
|
|
|
33 |
|
|
% if ( $m->comp_exists ("/comps/$prj/block_rep_photos.msn") ) { |
34 |
|
|
<& "/comps/$prj/block_rep_photos.msn", doc => $photorep, show => 'rubber', max => 10 &> |
35 |
|
|
% } else { |
36 |
|
|
<& "/comps/block_rep_photos.msn", doc => $photorep, show => 'rubber', max => 10 &> |
37 |
|
|
% } |
38 |
|
|
|
39 |
|
|
<br clear="all" style="font-size:5px;"> |
40 |
|
|
<div style="background:#333333; height:1px; margin-bottom: 10px;" ><spacer type="block"></div> |
41 |
|
|
<div class="photo-l" style="padding-bottom:20px; padding-left: 15px;"><a href="?id=<% $photorep->id %>">Весь фоторепортаж</a></div> |
42 |
|
|
|
43 |
|
|
% } |
44 |
|
|
% } |
45 |
|
|
|
46 |
|
|
% if ( ($total > $size) && !$id ) { |
47 |
|
|
<div class="photo-l" style="padding-bottom:20px; padding-left: 15px;">Страницы: |
48 |
|
|
<& /inc/pages_.msn, p => $p, total => $total, n => $size, delimiter => ' ' &> |
49 |
|
|
</div> |
50 |
|
|
% } |
51 |
|
|
|
52 |
|
|
</td> |
53 |
|
|
<td width="4%"><div style="width: 10px; height: 1px"><spacer height="1" width="10" type="block"></div> |
54 |
|
|
</td> |
55 |
|
|
</tr> |
56 |
|
|
</table> |
57 |
|
|
|
58 |
|
|
% ### Футер |
59 |
|
|
% ############################################## |
60 |
|
|
% if ( $m->comp_exists ("/comps/$prj/footer.msn") ) { |
61 |
|
|
<& "/comps/$prj/footer.msn" &> |
62 |
|
|
% } else { |
63 |
|
|
<& "/comps/footer.msn" &> |
64 |
|
|
% } |
65 |
|
|
% ### /Футер |
66 |
|
|
<%args> |
67 |
|
|
|
68 |
|
|
$id => undef |
69 |
|
|
$p => 1 |
70 |
|
|
|
71 |
|
|
</%args> |
72 |
|
|
<%init> |
73 |
|
|
|
74 |
|
|
my $prj = $request->{project}; |
75 |
|
|
my $profile = $request->{project_profile}; |
76 |
|
|
my $root = $request->{project_section}; |
77 |
|
|
&abort404 if $id && $id !~ /^\d+$/; |
78 |
|
|
|
79 |
|
|
my $size = 5; |
80 |
|
|
my ($documents, $document, $total) = ([], undef, 0); |
81 |
|
|
my ($section) = $keeper->get_sections ( |
82 |
|
|
s => $root->id, |
83 |
|
|
class => 'promosuite::MultimediaSection', |
84 |
|
|
limit => 1, |
85 |
|
|
status => 1, |
86 |
|
|
); |
87 |
|
|
if ( ref $section ) { |
88 |
|
|
if ( $id ) { |
89 |
|
|
$document = $keeper->get_document_by_id ($id, |
90 |
|
|
s => $section->id, |
91 |
|
|
class => 'promosuite::Photorep', |
92 |
|
|
status => 1, |
93 |
|
|
); |
94 |
|
|
&abort404 unless ref $document; |
95 |
|
|
}else{ |
96 |
|
|
$documents = $keeper->get_documents ( |
97 |
|
|
s => $section->id, |
98 |
|
|
class => 'promosuite::Photorep', |
99 |
|
|
status => 1, |
100 |
|
|
order => ['date', 'direct'], |
101 |
|
|
limit => $size, |
102 |
|
|
offset => $size * ($p-1), |
103 |
|
|
return_mode => 'array_ref', |
104 |
|
|
); |
105 |
|
|
if ( @$documents ) { |
106 |
|
|
$request->{photorep} = $documents; |
107 |
|
|
} |
108 |
|
|
} |
109 |
|
|
$total = $keeper->get_documents ( |
110 |
|
|
s => $section->id, |
111 |
|
|
class => 'promosuite::Photorep', |
112 |
|
|
status => 1, |
113 |
|
|
count => 1, |
114 |
|
|
); |
115 |
|
|
} |
116 |
|
|
</%init> |