% if ( $m->comp_exists ("/comps/$prj/header_rambler.msn") ) { <& "/comps/$prj/header_rambler.msn", alias => 'main' &> % } else { <& "/comps/header_rambler.msn", alias => 'main' &> % } %#
% ### Левая колонка % ############################################### % if ( $m->comp_exists ("/comps/$prj/right.msn") ) { <& "/comps/$prj/right.msn" &> % }else{ <& /comps/right.msn &> % } % ### /Левая колонка

% % ### Аннотация проекта % ############################################################ % if ( $p == 1 && !ref $document ) { % if ( $m->comp_exists ("/comps/$prj/block_project_anno.msn") ) { <& "/comps/$prj/block_project_anno.msn" &> % } else { <& "/comps/block_project_anno.msn" &> % } % } % ### /Аннотация проекта % %#<% spacer(h=>10) %>
% if ( ref $document ) { % unless ( $VOTED ) { <& "/comps/$prj/forms/voting.msn", voting => $document &> % } elsif ( $voted ) { <% $document->submit || 'Спасибо! Ваш голос учтен.' %> <% spacer(h=>20) %> % if ( $document->visible ) { <& "/comps/$prj/results/voting.msn", voting => $document &> % } % } else { % if ( $document->visible ) { <& "/comps/$prj/results/voting.msn", voting => $document &> % } else { <% $document->filled || 'Вы уже проголосовали!' %> % } % } % } else { % }
% ### Футер % ############################################## % if ( $m->comp_exists ("/comps/$prj/footer_rambler.msn") ) { <& "/comps/$prj/footer_rambler.msn" &> % } else { <& "/comps/footer_rambler.msn" &> % } % ### /Футер <%once> use Apache::Cookie; <%args> $p => 1 $id => undef $voted => undef <%init> my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; &abort404 if $id && $id !~ /^\d+$/; my $cs = Apache::Cookie->parse($r->header_in('Cookie') || ''); my $sid = ref $cs && ref $cs->{ruid} && $cs->{ruid}->value ? $cs->{ruid}->value : $r->header_in('X-Real-IP'); my ($document, $documents); my $VOTED = 0; my ($section) = $keeper->get_sections ( s => $root->id, class => 'promosuite::VotingSection', limit => 1, status => 1, ); if ( $id && ref $section ) { $document = $keeper->get_document_by_id ($id, s => $section->id, class => 'promosuite::Voting', status => 1, ); } elsif ( ref $section ) { $documents = $keeper->get_documents ( s => $section->id, class => 'promosuite::Voting', status => 'positive', order_by => 'dtime desc', return_mode => 'array_ref', ); $document = shift @$documents if ref $documents eq 'ARRAY' && @$documents; $VOTED = $keeper->get_documents ( class => 'promosuite::Voice', object_id => $document->id, session_id => $sid, count => 1, ); }