[Jifty-commit] r2790 - jifty/branches/template-declare/lib/Jifty/View/Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Feb 13 13:49:16 EST 2007


Author: clkao
Date: Tue Feb 13 13:49:15 2007
New Revision: 2790

Modified:
   jifty/branches/template-declare/lib/Jifty/View/Declare/Helpers.pm

Log:
Group the non-layout logic in wrapper together.

Modified: jifty/branches/template-declare/lib/Jifty/View/Declare/Helpers.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/View/Declare/Helpers.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/View/Declare/Helpers.pm	Tue Feb 13 13:49:15 2007
@@ -126,6 +126,23 @@
         '';
     };
 
+
+    my $wrapped_content_code = sub {
+        no warnings qw( uninitialized redefine once );
+
+        local *is::title = sub {
+            shift;
+            $title = "@_";
+            &$render_header;
+        };
+
+        &$content_code;
+        if ( !$done_header ) {
+            $title = _("Untitled");
+            &$render_header;
+        }
+    };
+
     body {
         show('/_elements/sidebar');
         with( id => "content" ), div {
@@ -142,22 +159,7 @@
                   }
             }
             Jifty->web->render_messages;
-
-            {
-                no warnings qw( uninitialized redefine once );
-
-                local *is::title = sub {
-                    shift;
-                    $title = "@_";
-                    &$render_header;
-                };
-
-                &$content_code;
-                if ( !$done_header ) {
-                    $title = _("Untitled");
-                    &$render_header;
-                }
-            }
+	    $wrapped_content_code->();
 
             show('/_elements/keybindings');
             with( id => "jifty-wait-message", style => "display: none" ),
@@ -175,7 +177,7 @@
         };
     };
 
-        Template::Declare->buffer->data( $done_header . Template::Declare->buffer->data);
+    Template::Declare->buffer->data( $done_header . Template::Declare->buffer->data);
 }
 
 sub render_header {


More information about the Jifty-commit mailing list