[Jifty-commit] r2788 -
jifty/branches/template-declare/lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Feb 13 13:13:32 EST 2007
Author: clkao
Date: Tue Feb 13 13:13:31 2007
New Revision: 2788
Added:
jifty/branches/template-declare/lib/Jifty/View/Declare/Yullio.pm
Log:
Add yullio layout bundle by hlb.
Added: jifty/branches/template-declare/lib/Jifty/View/Declare/Yullio.pm
==============================================================================
--- (empty file)
+++ jifty/branches/template-declare/lib/Jifty/View/Declare/Yullio.pm Tue Feb 13 13:13:31 2007
@@ -0,0 +1,60 @@
+package Jifty::View::Declare::Yullio;
+use strict;
+use warnings;
+
+# XXX: To be converted to a plugin with included css and images.
+
+use Jifty::View::Declare -base;
+
+use base 'Exporter';
+our @EXPORT = qw(yullio);
+
+=head1 NAME
+
+Jifty::View::Declare::Yullio - Yullio layout bundles
+
+=head1 SYNOPSIS
+
+ use Jifty::View::Declare::Yullio
+ template 'index2.html' => page {
+ with ( width => 'doc2', column_template => 'yui-t6' ),
+ yullio
+ { outs('This is main content') }
+ sub { outs('This is something on the side') } };
+
+=head1 DESCRIPTION
+
+C<Jifty::View::Declare::Yullio> provides an alternative C<page>
+temlpate constructor that makes use of yui grid layouts.
+
+=cut
+
+sub _yullio_content {
+ my ($code1, $code2) = @_;
+ # XXX: fix get_current_attr with multiple arguments
+ my ($width, $column_template) = map {get_current_attr($_)}
+ qw(width column_template);
+ sub {
+ div {
+ { id is $width, class is $column_template }
+
+ div { { id is 'hd' }
+ div { { id is 'yui-main' }
+ div { { class is 'yui-b' }
+ div { { id is 'content' }
+ $code1->() } } };
+ if ($column_template ne 'yui-t7') {
+ div { { id is 'yui-b' }
+ div { { id is 'utility' }
+ $code2->() } }
+ } } }
+ };
+}
+
+sub yullio(&&) {
+ my ($code1, $code2) = @_;
+ _yullio_content($code1, $code2)->();
+}
+
+1;
+
More information about the Jifty-commit
mailing list