1 |
296 |
ahitrov |
% if ( $m->comp_exists ("/comps/$prj/header_rambler.msn") ) { |
2 |
|
|
<& "/comps/$prj/header_rambler.msn", alias => 'main' &> |
3 |
|
|
% } else { |
4 |
|
|
<& "/comps/header_rambler.msn", alias => 'main' &> |
5 |
|
|
% } |
6 |
|
|
|
7 |
|
|
<table class="r--main"> |
8 |
|
|
<tr> |
9 |
|
|
%#<td class="dev--left-10"><div class="dev--left-10"><!-- --></div></td> |
10 |
|
|
<td class="dev--left-menu r--vtop"> |
11 |
|
|
<div class="dev--left-menu"><!-- --></div> |
12 |
|
|
<div class="r--normal"> |
13 |
|
|
% ### Левая колонка |
14 |
|
|
% ############################################### |
15 |
|
|
|
16 |
|
|
% if ( $m->comp_exists ("/comps/$prj/right.msn") ) { |
17 |
|
|
<& "/comps/$prj/right.msn" &> |
18 |
|
|
% }else{ |
19 |
|
|
<& /comps/right.msn &> |
20 |
|
|
% } |
21 |
|
|
% ### /Левая колонка |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
</div> |
25 |
|
|
<br> |
26 |
|
|
|
27 |
|
|
</td> |
28 |
|
|
<td class="dev--left-25"><div class="dev--left-25"><!-- --></div></td> |
29 |
|
|
<td class="r--vtop r--normal"> |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
% |
34 |
|
|
% ### Аннотация проекта |
35 |
|
|
% ############################################################ |
36 |
|
|
% if ( $p == 1 && !ref $document ) { |
37 |
|
|
% if ( $m->comp_exists ("/comps/$prj/block_project_anno.msn") ) { |
38 |
|
|
<& "/comps/$prj/block_project_anno.msn" &> |
39 |
|
|
% } else { |
40 |
|
|
<& "/comps/block_project_anno.msn" &> |
41 |
|
|
% } |
42 |
|
|
% } |
43 |
|
|
% ### /Аннотация проекта |
44 |
|
|
% |
45 |
|
|
|
46 |
|
|
%#<% spacer(h=>10) %> |
47 |
|
|
|
48 |
|
|
<div class="nekot"> |
49 |
|
|
<div class="verh"><div class="ug1"><div class="ug2"></div></div></div> |
50 |
|
|
<div class="zheludokkota"> |
51 |
|
|
% if ( ref $document ) { |
52 |
|
|
% unless ( $VOTED ) { |
53 |
|
|
<& "/comps/$prj/forms/voting.msn", voting => $document &> |
54 |
|
|
% } elsif ( $voted ) { |
55 |
|
|
<span class="status"> |
56 |
|
|
<% $document->submit || 'Спасибо! Ваш голос учтен.' %> |
57 |
|
|
</span> |
58 |
|
|
<% spacer(h=>20) %> |
59 |
|
|
% if ( $document->visible ) { |
60 |
|
|
<& "/comps/$prj/results/voting.msn", voting => $document &> |
61 |
|
|
% } |
62 |
|
|
% } else { |
63 |
|
|
% if ( $document->visible ) { |
64 |
|
|
<& "/comps/$prj/results/voting.msn", voting => $document &> |
65 |
|
|
% } else { |
66 |
|
|
<span class="status"> |
67 |
|
|
<% $document->filled || 'Вы уже проголосовали!' %> |
68 |
|
|
</span> |
69 |
|
|
|
70 |
|
|
% } |
71 |
|
|
% } |
72 |
|
|
% } else { |
73 |
|
|
|
74 |
|
|
% } |
75 |
|
|
|
76 |
|
|
</div> |
77 |
|
|
<div class="niz"><div class="ug1"><div class="ug2"></div></div></div> |
78 |
|
|
</div> |
79 |
|
|
|
80 |
|
|
<div class="dev--content"><!-- --></div> |
81 |
|
|
</td> |
82 |
|
|
</tr> |
83 |
|
|
</table> |
84 |
|
|
|
85 |
|
|
% ### Футер |
86 |
|
|
% ############################################## |
87 |
|
|
% if ( $m->comp_exists ("/comps/$prj/footer_rambler.msn") ) { |
88 |
|
|
<& "/comps/$prj/footer_rambler.msn" &> |
89 |
|
|
% } else { |
90 |
|
|
<& "/comps/footer_rambler.msn" &> |
91 |
|
|
% } |
92 |
|
|
% ### /Футер |
93 |
|
|
<%once> |
94 |
|
|
|
95 |
|
|
use Apache::Cookie; |
96 |
|
|
|
97 |
|
|
</%once> |
98 |
|
|
<%args> |
99 |
|
|
|
100 |
|
|
$p => 1 |
101 |
|
|
$id => undef |
102 |
|
|
$voted => undef |
103 |
|
|
|
104 |
|
|
</%args> |
105 |
|
|
<%init> |
106 |
|
|
|
107 |
|
|
my $prj = $request->{project}; |
108 |
|
|
my $profile = $request->{project_profile}; |
109 |
|
|
my $root = $request->{project_section}; |
110 |
|
|
&abort404 if $id && $id !~ /^\d+$/; |
111 |
|
|
|
112 |
|
|
my $cs = Apache::Cookie->parse($r->header_in('Cookie') || ''); |
113 |
|
|
my $sid = ref $cs && ref $cs->{ruid} && $cs->{ruid}->value ? $cs->{ruid}->value : $r->header_in('X-Real-IP'); |
114 |
|
|
my ($document, $documents); |
115 |
|
|
my $VOTED = 0; |
116 |
|
|
my ($section) = $keeper->get_sections ( |
117 |
|
|
s => $root->id, |
118 |
|
|
class => 'promosuite::VotingSection', |
119 |
|
|
limit => 1, |
120 |
|
|
status => 1, |
121 |
|
|
); |
122 |
|
|
if ( $id && ref $section ) { |
123 |
|
|
$document = $keeper->get_document_by_id ($id, |
124 |
|
|
s => $section->id, |
125 |
|
|
class => 'promosuite::Voting', |
126 |
|
|
status => 1, |
127 |
|
|
); |
128 |
|
|
} elsif ( ref $section ) { |
129 |
|
|
$documents = $keeper->get_documents ( |
130 |
|
|
s => $section->id, |
131 |
|
|
class => 'promosuite::Voting', |
132 |
|
|
status => 'positive', |
133 |
|
|
order_by => 'dtime desc', |
134 |
|
|
return_mode => 'array_ref', |
135 |
|
|
); |
136 |
|
|
$document = shift @$documents if ref $documents eq 'ARRAY' && @$documents; |
137 |
|
|
$VOTED = $keeper->get_documents ( |
138 |
|
|
class => 'promosuite::Voice', |
139 |
|
|
object_id => $document->id, |
140 |
|
|
session_id => $sid, |
141 |
|
|
count => 1, |
142 |
|
|
); |
143 |
|
|
} |
144 |
|
|
|
145 |
|
|
</%init> |