Revision 296 (by ahitrov, 2013/03/26 17:59:01) Promosite (anthill) project source
% if ( $m->comp_exists ("/comps/$prj/header_rambler.msn") ) {
<& "/comps/$prj/header_rambler.msn", alias => 'main' &>
% } else {
<& "/comps/header_rambler.msn", alias => 'main' &>
% }

<table class="r--main">
<tr>
%#<td class="dev--left-10"><div class="dev--left-10"><!-- --></div></td>
<td class="dev--left-menu r--vtop">
<div class="dev--left-menu"><!-- --></div>
<div class="r--normal">
% ### Левая колонка
% ###############################################

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


</div>
<br>

</td>
<td class="dev--left-25"><div class="dev--left-25"><!-- --></div></td>
<td class="r--vtop r--normal">



%
% ### Аннотация проекта
% ############################################################
% 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) %>

<div class="nekot">
<div class="verh"><div class="ug1"><div class="ug2"></div></div></div>
<div class="zheludokkota">
% if ( ref $document ) {
%	unless ( $VOTED ) {
<& "/comps/$prj/forms/voting.msn", voting => $document &>
%	} elsif ( $voted ) {
<span class="status">
<% $document->submit || 'Спасибо! Ваш голос учтен.' %>
</span>
<% 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 {
<span class="status">
<% $document->filled || 'Вы уже проголосовали!' %>
</span>

%		}
%	}
% } else {

% }

</div>
<div class="niz"><div class="ug1"><div class="ug2"></div></div></div>
</div>

<div class="dev--content"><!-- --></div>
</td>
</tr>
</table>

% ### Футер
% ##############################################
% if ( $m->comp_exists ("/comps/$prj/footer_rambler.msn") ) {
<& "/comps/$prj/footer_rambler.msn" &>
% } else {
<& "/comps/footer_rambler.msn" &>
% }
% ### /Футер
<%once>

  use Apache::Cookie;

</%once>
<%args>

        $p      => 1
        $id     => undef
	$voted	=> undef

</%args>
<%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,
	);
  }

</%init>