use pages/index.html if present
Matt S Trout [Wed, 4 Nov 2009 19:35:18 +0000 (19:35 +0000)]
assets/background_body.jpg [new file with mode: 0644]
assets/background_divmain.jpg [new file with mode: 0644]
assets/cards1.jpg [new file with mode: 0644]
assets/default.css [new file with mode: 0644]
assets/pod.css [new file with mode: 0644]
sdl.cgi

diff --git a/assets/background_body.jpg b/assets/background_body.jpg
new file mode 100644 (file)
index 0000000..ddc6d25
Binary files /dev/null and b/assets/background_body.jpg differ
diff --git a/assets/background_divmain.jpg b/assets/background_divmain.jpg
new file mode 100644 (file)
index 0000000..c7a69b2
Binary files /dev/null and b/assets/background_divmain.jpg differ
diff --git a/assets/cards1.jpg b/assets/cards1.jpg
new file mode 100644 (file)
index 0000000..ab690c7
Binary files /dev/null and b/assets/cards1.jpg differ
diff --git a/assets/default.css b/assets/default.css
new file mode 100644 (file)
index 0000000..c6066ba
--- /dev/null
@@ -0,0 +1,92 @@
+\r
+body\r
+{\r
+       font-family:             Arial, Helvetica, sans-serif;\r
+       font-size:                       12px;\r
+       font-weight:             normal;\r
+       color:                           #000000;\r
+       background-color:        #CAB680;\r
+       text-align:                      left;\r
+       padding:             0;\r
+       margin:              0;\r
+       text-align:          center;\r
+       vertical-align:      middle;\r
+}\r
+\r
+a\r
+{\r
+       font-size:                       14px;\r
+       font-weight:         bold;\r
+       color:               #49241D;\r
+       text-decoration:     none;\r
+}\r
+\r
+a:hover\r
+{\r
+       color:               #864135;\r
+       text-decoration:     underline;\r
+}\r
+\r
+div#background\r
+{\r
+       padding:             0;\r
+       margin:              auto;\r
+       width:               1015;\r
+       height:              749;\r
+       text-align:          left;\r
+       vertical-align:      top;\r
+}\r
+\r
+table#mainTable\r
+{\r
+       table-layout:        fixed;\r
+       background-image:    url(background_body.jpg);\r
+       background-position: top left;\r
+       background-repeat:   no-repeat;\r
+}\r
+\r
+table#mainTable,\r
+table#mainTable td\r
+{\r
+       padding:             0;\r
+       margin:              0;\r
+       border:              0;\r
+}\r
+\r
+td#upperLeft\r
+{\r
+       width:               103px;\r
+       height:              144px;     \r
+}\r
+\r
+td#upperRight\r
+{\r
+       width:               912px;\r
+       background-image:    url(cards1.jpg);\r
+       background-position: 550px 5px;\r
+       background-repeat:   no-repeat;\r
+       text-align:          right;\r
+       vertical-align:      bottom;\r
+       font-variant:        small-caps;\r
+}\r
+\r
+td#lowerRight\r
+{\r
+       background-color:        #D6C796;\r
+       min-height:          603px;\r
+       text-align:          left;\r
+       vertical-align:      top;\r
+       background-image:    url(background_divmain.jpg);\r
+       background-position: 1px 1px;\r
+       background-repeat:   no-repeat;\r
+}\r
+\r
+div#main\r
+{\r
+       padding:             0;\r
+       margin:              0;\r
+       border:              1px solid #FFFFFF;\r
+       width:               910px;\r
+       min-height:          601px;\r
+       overflow:            hidden;\r
+}\r
diff --git a/assets/pod.css b/assets/pod.css
new file mode 100644 (file)
index 0000000..f26c732
--- /dev/null
@@ -0,0 +1,12 @@
+\r
+div.pod\r
+{\r
+       padding:             10px;\r
+}\r
+\r
+pre\r
+{\r
+       border:              1px solid #FFFFFF;\r
+       background-color:        #CAB680;\r
+       padding-top:         10px;\r
+}
\ No newline at end of file
diff --git a/sdl.cgi b/sdl.cgi
index 34415b5..fc58aa4 100755 (executable)
--- a/sdl.cgi
+++ b/sdl.cgi
@@ -42,10 +42,20 @@ dispatch [
 sub layout_zoom {
   my $self = shift;
   $self->{layout_zoom} ||= do {
-    HTML::Zoom->from_string($self->_read_data)
+    HTML::Zoom->from_string($self->_layout_html)
   };
 }
 
+sub _layout_html {
+  my $self = shift;
+  my $file = $self->config->{pages_dir}.'/index.html';
+  if (-f $file) {
+    return do { local(@ARGV, $/) = ($file); <> }
+  } else {
+    return $self->_read_data
+  }
+}
+
 sub render_html {
   my ($self, $data) = @_;
   return $data if ref($data) eq 'ARRAY';