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


% ### контент

<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr><td width="4%"><div style="width: 10px; height: 1px"><spacer height="1" width="10" type="block"></div></td>
<td width="92%" valign="top" style="padding-top:11px;">
<div  style="padding:14px 15px; width:890px;" class="hdr"><% $section->name %></div>
% if ( ref $document && $document->html ) {
<div style="padding:14px 10px;"align="center">
%#<iframe id="player" src="<% $document->url %>" width="700" height="380" frameborder="0" scrolling="no"></iframe>
<% $document->html %>
</div>
%#<img src="/i/<% $prj %>/player_full.jpg" width="673" height="370">
% }

<div align="center"  >
<div style="width:865px;" class="video">
% foreach my $doc ( @$documents ) {
%	my $img = $doc->get_image ('picture');
%	my $mini = $img->{mini}->{'100x100'};
<div style="float:left; width:120px; height:142px;">\
%	if ( exists $mini->{filename} && $mini->{filename} ) {
<a href="?id=<% $doc->id %>"><img src="<% $mini->{filename} %>" width="<% $mini->{width} %>" height="<% $mini->{height} %>" border="0"></a><br>
<a href="?id=<% $doc->id %>"><% $doc->name %></a>
%	}
</div>
% }
</div></div>
</td>
<td width="4%"><div style="width: 10px; height: 1px"><spacer height="1" width="10" 
      type="block"></div>
</td>
</tr>
</table>

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

        $id     => undef

</%args>
<%init>

  my $prj = $request->{project};
  my $profile = $request->{project_profile};
  my $root = $request->{project_section};
  &abort404     if $id && $id !~ /^\d+$/;

  my ($section) = $keeper->get_sections (
		s	=> $root->id,
		class	=> 'promosuite::PromoSection',
		limit	=> 1,
		status	=> 1,
	);
  my ($documents, $document);
  if ( ref $section ) {
	if ( $id ) {
		$document = $keeper->get_document_by_id ($id,
			s	=> $section->id,
			class	=> 'promosuite::Promoblock',
			status	=> 1,
		);
	}
	$documents = $keeper->get_documents (
		s	=> $section->id,
		class	=> 'promosuite::Promoblock',
		status	=> 1,
		order	=> ['date', 'direct'],
		return_mode	=> 'array_ref',
	);
	$document = shift @$documents	if !$document && @$documents;
  }
</%init>