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", active => $document, sec => $section, docs => $documents &>
% }else{
<& /comps/right.msn, active => $document, sec => $section, docs => $documents &>
% }
% ### /Левая колонка


</div>
<br>

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

% if ( ref $document ) {

<div class="nekot">
<div class="verh"><div class="ug1"><div class="ug2"></div></div></div>
<div class="zheludokkota">

<a href="./result.txt?id=<% $document->id %>">Лог опроса</a>
<% spacer(h=>20) %>
<& "/comps/$prj/results/voting.msn", voting => $document &>

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

% } else {
% }


<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" &>
% }
% ### /Футер
<%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 ($document, $documents);
  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;
  }


</%init>