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", alias => 'main' &>
% } else {
<& "/comps/header.msn", alias => 'main' &>
% }
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td style="padding:0 32px 0 18px;" width="1%" nowrap>
<!--Menus-->
% if ( $m->comp_exists ("/comps/$prj/left.msn") ) {
<& "/comps/$prj/left.msn" &>
% }
<!--/Menus-->
</td>
<td width="1%"><img src="/i/<% $prj %>/diaton_device.png" width="84" height="334" alt="DIATON tonometer"></td>
<td style="padding:0 30px 20px;" width="98%">
<!--Information-->
% ### Список новостей
% #######################################################
% if ( ref $document ) {
% my $dt = Contenido::DateTime->new( postgres => $document->dtime );
<h2><a href="./news.html" style="text-decoration:underline;">news</a></h2>
<h3><% $document->name %>
<span style="padding-left:25px; color:gray; font-size:10px; font-weight:normal;"> <% $dt->dmy('.') %></span>
</h3>
<p><& /inc/text_format.msn, doc => $document &></p>
% if ( @files ) {
<ul>
% foreach my $file ( @files ) {
<li><a href="<% $file->{filename} %>" title="<% $file->{alt} %>"><% $file->{alt} || $file->{filename} %></a></li>
% }
</ul>
% }
% } elsif ( ref $section ) {
% if ( $m->comp_exists ("/comps/$prj/news_list.msn") ) {
<& "/comps/$prj/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10, section => $section &>
% } else {
<& "/comps/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10 &>
% }
% }
<!--/Information-->
</td></tr>
</table>
% ### Футер
% ##############################################
% if ( $m->comp_exists ("/comps/$prj/footer.msn") ) {
<& "/comps/$prj/footer.msn" &>
% } else {
<& "/comps/footer.msn" &>
% }
% ### /Футер
<%args>
$p => 1
$id => undef
</%args>
<%init>
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
&abort404 if $id && $id !~ /^\d+$/;
my $document;
my ($section) = $keeper->get_sections (
s => $root->id,
class => 'promosuite::NewsSection',
limit => 1,
status => 1,
);
if ( $id && ref $section ) {
$document = $keeper->get_document_by_id ($id,
s => $section->id,
class => 'promosuite::News',
status => 'positive',
);
}
my @files;
if ( ref $document ) {
foreach my $fname ( qw( file1 file2 ) ) {
my $file = $document->get_image($fname);
if ( ref $file && exists $file->{filename} ) {
push @files, $file;
}
}
}
</%init>