[Jifty-commit] r1186 - in jifty/trunk: lib/Jifty share/web/templates/__jifty share/web/templates/_elements

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 7 15:51:06 EDT 2006


Author: trs
Date: Wed Jun  7 15:51:05 2006
New Revision: 1186

Added:
   jifty/trunk/share/web/templates/__jifty/styles.css
Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/Makefile.PL
   jifty/trunk/lib/Jifty/Web.pm
   jifty/trunk/share/web/templates/_elements/header

Log:
 r12754 at zot:  tom | 2006-06-07 15:50:55 -0400
 * Add CSS::Squish to the prereqs
 * Add and use Jifty->web->include_css
 * Make /__jifty/styles.css return the one-file CSS


Modified: jifty/trunk/Makefile.PL
==============================================================================
--- jifty/trunk/Makefile.PL	(original)
+++ jifty/trunk/Makefile.PL	Wed Jun  7 15:51:05 2006
@@ -10,6 +10,7 @@
 requires('Class::Container');
 requires('Clone');
 requires('Compress::Zlib');
+requires('CSS::Squish' => 0.01 );
 requires('DBD::SQLite' => 1.11 );
 requires('Data::Page');
 requires('DateTime');

Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Wed Jun  7 15:51:05 2006
@@ -962,4 +962,15 @@
     return join( "-", map { $_->name } @{ $self->{'region_stack'} || [] }, @_ );
 }
 
+=head3 include_css
+
+Returns a C<< <link> >> tag for the compressed CSS
+
+=cut
+
+sub include_css {
+    Jifty->web->out('<link rel="stylesheet" type="text/css" href="/__jifty/styles.css" />');
+    return '';
+}
+
 1;

Added: jifty/trunk/share/web/templates/__jifty/styles.css
==============================================================================
--- (empty file)
+++ jifty/trunk/share/web/templates/__jifty/styles.css	Wed Jun  7 15:51:05 2006
@@ -0,0 +1,11 @@
+<%init>
+use CSS::Squish;
+
+$r->content_type("text/css");
+
+Jifty->web->out(
+    CSS::Squish->concatenate(
+        Jifty->config->framework('Web')->{StaticRoot} . "/css/main.css"
+    )
+);
+</%init>

Modified: jifty/trunk/share/web/templates/_elements/header
==============================================================================
--- jifty/trunk/share/web/templates/_elements/header	(original)
+++ jifty/trunk/share/web/templates/_elements/header	Wed Jun  7 15:51:05 2006
@@ -6,7 +6,7 @@
   
   <title><% _($title) %></title>
   
-  <link rel="stylesheet" type="text/css" href="/static/css/main.css" media="all" />
+  <% Jifty->web->include_css %>
   <& javascript &> 
 </head>
 <%args>


More information about the Jifty-commit mailing list