=extends NEXT in widgets works
matthewt [Wed, 30 Jan 2008 18:17:34 +0000 (18:17 +0000)]
lib/ComponentUI/Controller/Root.pm
lib/Reaction/UI/LayoutSet.pm
share/skin/componentui/layout/site_layout.tt

index 2e2a181..4113a73 100644 (file)
@@ -22,7 +22,7 @@ sub base :Chained('/') :PathPart('') :CaptureArgs(0) {
   my ($self, $c) = @_;
   $self->push_viewport(SiteLayout,
     title => 'ComponentUI test title',
-    static_base_uri => "${\$c->uri_for('static')}",
+    static_base_uri => "${\$c->uri_for('/static')}",
   );
 }
 
index 44a137c..4185033 100644 (file)
@@ -73,7 +73,16 @@ class LayoutSet which {
         $layouts->{$fname} = $text;
       } elsif ($data =~ /^extends (\S+)/) {
         my $super_name = $1;
-        $self->super($build_args->{skin}->create_layout_set($super_name))
+        my $skin;
+        if ($super_name eq 'NEXT') {
+          confess "No next skin and layout extends NEXT"
+            unless $build_args->{next_skin};
+          $skin = $build_args->{next_skin};
+          $super_name = $self->name;
+        } else {
+          $skin = $build_args->{skin};
+        }
+        $self->super($skin->create_layout_set($super_name));
       } elsif ($data =~ /^widget (\S+)/) {
         my $widget_type = $1;
         $self->widget_type($1);
index 0a1448a..8c6b7c2 100644 (file)
@@ -1,18 +1,12 @@
-=for layout widget
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+=extends NEXT
 
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+=for layout head_style
 
-<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" />
+  <link rel="stylesheet" type="text/css"
+    href="[% static_base %]/componentui-basic.css" />
 
-</head>
+=for layout body
 
-<body>
   <div id="container">
     <div id="header">
      [% header %]
@@ -30,9 +24,6 @@
       <div class="spacer"></div>
     </div>
   </div>
-</body>
-
-</html>
 
 =for layout inner
 <!-- main content start -->