Revision 296 (by ahitrov, 2013/03/26 17:59:01) |
Promosite (anthill) project source
|
<div style="background:#333333; padding:5px 10px 5px 25px; " class="hdr"><a href="./plan.html"><% $today->day.' '.$mdays{$today->month} %></a> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background:#5C5D62; margin-bottom:30px;">
<tr><td class="txt"><div style="padding:20px 10px 14px 25px;">
% foreach my $event ( @$documents ) {
% my $dt = $4.':'.$5 if $event->start =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+)/;
<div class="today"><b><% $dt %></b> <% $event->name %>
<span class="blue"><% $event->abstr %></span></div>
% }
<div style="padding-top: 10px;"><a href="./plan.html"><b>Всё расписание »</b></a></div>
</div>
<br clear="all"></td>
</tr>
<tr>
<td><div style="background: url(/i/<% $prj %>/l_gr.gif) no-repeat bottom left; width:17px; height:17px; float: left;"><spacer type="block"></div>
<div style="background:url(/i/<% $prj %>/r_gr.gif) no-repeat bottom right; width:17px; height:17px; float: right;"><spacer type="block"></div></td>
</tr>
</table>
<%once>
my %mdays = (
1 => 'января',
2 => 'февраля',
3 => 'марта',
4 => 'апреля',
5 => 'мая',
6 => 'июня',
7 => 'июля',
8 => 'августа',
9 => 'сентября',
10 => 'октября',
11 => 'ноября',
12 => 'декабря',
);
</%once>
<%init>
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
my $documents;
my $today = Contenido::DateTime->new;
my $rfw_begin = Contenido::DateTime->new ( postgres => $project->params->{rfw_begin} );
my $rfw_end = Contenido::DateTime->new ( postgres => $project->params->{rfw_end} );
if ( DateTime->compare ($today, $rfw_end) > 0 ) {
$today = $rfw_end;
} elsif ( DateTime->compare ($today, $rfw_begin) < 0 ) {
$today = $rfw_begin;
}
my ($section) = $keeper->get_sections (
s => $root->id,
class => 'promosuite::EventSection',
limit => 1,
status => 1,
);
if ( ref $section ) {
$documents = $keeper->get_documents (
s => $section->id,
class => 'promosuite::Event',
status => 1,
start => $today->year.'-'.sprintf("%02d",$today->month).'-'.sprintf("%02d",$today->day),
order_by => 'start',
return_mode => 'array_ref',
);
}
return unless @$documents;
</%init>