diff options
-rw-r--r-- | componentui.conf | 4 | ||||
-rw-r--r-- | lib/Reaction/UI/Skin.pm | 15 | ||||
-rw-r--r-- | share/skin/componentui/layout/site_layout.tt | 56 | ||||
-rw-r--r-- | share/skin/componentui/skin.conf | 1 | ||||
-rw-r--r-- | share/skin/componentui/web/componentui-basic.css (renamed from share/skin/default/web/componentui-basic.css) | 0 | ||||
-rw-r--r-- | share/skin/default/layout/site_layout.tt | 60 |
6 files changed, 96 insertions, 40 deletions
diff --git a/componentui.conf b/componentui.conf index 008ce1d..54ea3d3 100644 --- a/componentui.conf +++ b/componentui.conf @@ -1,5 +1,5 @@ using_frontend_proxy 1 <View Site> - skin_name default -</View>
\ No newline at end of file + skin_name componentui +</View> diff --git a/lib/Reaction/UI/Skin.pm b/lib/Reaction/UI/Skin.pm index ff31a3a..7f3f1ca 100644 --- a/lib/Reaction/UI/Skin.pm +++ b/lib/Reaction/UI/Skin.pm @@ -33,6 +33,21 @@ class Skin which { my $base = $self->skin_base_path; confess "No such skin base directory ${base}" unless -d $base; + if (-e (my $conf_file = $base->file('skin.conf'))) { + # we get [ { $file => $conf } ] + my ($cfg) = values %{ + Config::Any->load_files({ + files => [ $conf_file ], use_ext => 1 + })->[0] + }; + if (my $super_name = $cfg->{extends}) { + my $super_dir = $base->parent->subdir($super_name); + my $super = $self->new( + view => $self->view, skin_base_path => $super_dir + ); + $self->super($super); + } + } } implements 'create_layout_set' => as { diff --git a/share/skin/componentui/layout/site_layout.tt b/share/skin/componentui/layout/site_layout.tt new file mode 100644 index 0000000..0a1448a --- /dev/null +++ b/share/skin/componentui/layout/site_layout.tt @@ -0,0 +1,56 @@ +=for layout widget +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + +<head> + <title>Component UI Test Title</title> + + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + <link rel="stylesheet" type="text/css" href="/static/componentui-basic.css" /> + +</head> + +<body> + <div id="container"> + <div id="header"> + [% header %] + </div> + + <div id="nav"> + [% menu %] + </div> + + <div id="contents"> + <div id="wrapper"> + [% sidebar %] + [% inner %] + </div> + <div class="spacer"></div> + </div> + </div> +</body> + +</html> + +=for layout inner +<!-- main content start --> +[% call_next %] +<!-- main content end --> +=for layout header + +<h1>Component UI Header</h1> + +=for layout sidebar + <div class="sidebar"> + Nothing to see here. Move along. + </div> + +=for layout menu + <ul class="menu"> + <li> <a href="/testmodel/foo">Foo</a> </li> + <li> <a href="/testmodel/bar">Bar</a> </li> + <li> <a href="/testmodel/baz">Baz</a> </li> + </ul> +=cut diff --git a/share/skin/componentui/skin.conf b/share/skin/componentui/skin.conf new file mode 100644 index 0000000..a9827b2 --- /dev/null +++ b/share/skin/componentui/skin.conf @@ -0,0 +1 @@ +extends default diff --git a/share/skin/default/web/componentui-basic.css b/share/skin/componentui/web/componentui-basic.css index 1f25ddb..1f25ddb 100644 --- a/share/skin/default/web/componentui-basic.css +++ b/share/skin/componentui/web/componentui-basic.css diff --git a/share/skin/default/layout/site_layout.tt b/share/skin/default/layout/site_layout.tt index 0a1448a..1e7afa1 100644 --- a/share/skin/default/layout/site_layout.tt +++ b/share/skin/default/layout/site_layout.tt @@ -5,52 +5,36 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> - <title>Component UI Test Title</title> - - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> - <link rel="stylesheet" type="text/css" href="/static/componentui-basic.css" /> - + [% head %] </head> <body> - <div id="container"> - <div id="header"> - [% header %] - </div> - - <div id="nav"> - [% menu %] - </div> - - <div id="contents"> - <div id="wrapper"> - [% sidebar %] - [% inner %] - </div> - <div class="spacer"></div> - </div> - </div> + [% body %] </body> </html> -=for layout inner -<!-- main content start --> -[% call_next %] -<!-- main content end --> -=for layout header +=for layout head + + <title>[% title %]</title> + + [% head_meta %] + [% head_style %] + +=for layout head_meta -<h1>Component UI Header</h1> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + +=for layout head_style + + <!-- stylesheet links go here --> + +=for layout body + +[% inner %] + +=for layout header -=for layout sidebar - <div class="sidebar"> - Nothing to see here. Move along. - </div> +<h1>[% title %]</h1> -=for layout menu - <ul class="menu"> - <li> <a href="/testmodel/foo">Foo</a> </li> - <li> <a href="/testmodel/bar">Bar</a> </li> - <li> <a href="/testmodel/baz">Baz</a> </li> - </ul> =cut |