[Catalyst-commits] r12412 - in trunk/examples/CatalystAdvent: .
lib/CatalystAdvent/Controller root
hobbs at dev.catalyst.perl.org
hobbs at dev.catalyst.perl.org
Wed Dec 16 23:02:21 GMT 2009
Author: hobbs
Date: 2009-12-16 23:02:20 +0000 (Wed, 16 Dec 2009)
New Revision: 12412
Modified:
trunk/examples/CatalystAdvent/Makefile.PL
trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
trunk/examples/CatalystAdvent/root/year.tt
Log:
Temporarily revert r12410 in hopes of fixing the site
Modified: trunk/examples/CatalystAdvent/Makefile.PL
===================================================================
--- trunk/examples/CatalystAdvent/Makefile.PL 2009-12-16 22:36:05 UTC (rev 12411)
+++ trunk/examples/CatalystAdvent/Makefile.PL 2009-12-16 23:02:20 UTC (rev 12412)
@@ -20,7 +20,6 @@
requires 'XML::Atom::SimpleFeed';
requires 'HTTP::Date';
requires 'List::Util';
-requires 'Template::Plugin::DateTime'; # EWWWWW
test_requires 'Test::More' => '0.88';
Modified: trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
===================================================================
--- trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm 2009-12-16 22:36:05 UTC (rev 12411)
+++ trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm 2009-12-16 23:02:20 UTC (rev 12412)
@@ -92,12 +92,6 @@
$c->detach( '/calendar/index' ) unless $day =~ /^\d{1,2}$/;
my $year = $c->stash->{year};
-
- # Don't show articles before the appropriate day, even if they're ready
- if (!$c->debug && $year == $c->stash->{now}->year) {
- $c->detach( 'year', [$year] ) unless ($day <= $c->stash->{now}->day);
- }
-
$c->detach( 'year', [$year] )
unless ( -e ( my $file = $c->path_to( 'root', $year, "$day.pod" ) ) );
Modified: trunk/examples/CatalystAdvent/root/year.tt
===================================================================
--- trunk/examples/CatalystAdvent/root/year.tt 2009-12-16 22:36:05 UTC (rev 12411)
+++ trunk/examples/CatalystAdvent/root/year.tt 2009-12-16 23:02:20 UTC (rev 12412)
@@ -10,9 +10,6 @@
<th>Friday</th>
<th>Saturday</th>
</tr>
-[%# Just to make this totally clear, this template is hatefule, and is an example of what not to do, ever
- We embed all the datetime handling logic in here, whereas it should be in a model object which is passed into the template.
-%]
[% USE date %]
[% calc = date.calc %]
[% FOR week = calendar %]
@@ -26,10 +23,8 @@
[% today = 1 UNLESS calc.Delta_Days( now.year, now.month, now.day, year, 12, day ) %]
[% TRY %]
[% USE File( c.path_to( 'root', year, "${day}.pod" ) ) %]
- [% USE date = DateTime(year = year, month = 12, day = day) %]
- [% IF c.stash.now < date; THROW too.early; END; %]
<td class="link[% IF today %] today[% END %]"><a href="[% c.uri_for( '/', year, day ) %]">[% day %]</a></td>
- [% CATCH %]
+ [% CATCH File %]
<td[% IF today %] class="today"[% END %]>[% day %]</td>
[% END %]
[% END %]
More information about the Catalyst-commits
mailing list