commit:151ce2106e1170d58b686ab19ca9ca70afd73c47
author:Norris
committer:Norris
date:Thu Dec 3 01:50:48 2009 -0800
parents:f2e492457474f5991501f8a5bc4f05b2d8156c48
Start on a front-page
diff --git a/Vector/Template.pm b/Vector/Template.pm
line changes: +16/-0
index 0000000..53ebad1
--- /dev/null
+++ b/Vector/Template.pm
@@ -0,0 +1,16 @@
+package Vector::Template;
+use strict;
+
+sub process {
+	my ($templatefile, $env) = @_;
+
+	open FILE, "templates/$templatefile.frag"
+		or die "Could not open template: $templatefile";
+	while (<FILE>) {
+		s/\$(\w+)/$env->{$1}/ge;
+		print;
+	}
+	close FILE;
+}
+
+1;

diff --git a/index.fcgi b/index.fcgi
line changes: +8/-3
index 221ccc0..6a98f76
--- a/index.fcgi
+++ b/index.fcgi
@@ -11,6 +11,7 @@ use Vector::Paginator;
 use Vector::File;
 use Vector::Notify;
 use Vector::Error;
+use Vector::Template;
 use strict;
 
 our ($login_id, $login_user);
@@ -166,12 +167,16 @@ HEAD
 			}
 		}
 	} else {
+		my %env;
 		if ($login_id) {
-			print start_form,
-			      textfield('channel', '', 20),
-			      submit('Create or Join Channel'),
+			$env{GETSTARTED} = start_form .
+			      textfield('channel', '', 20) .
+			      submit('Create or Join Channel') .
 			      end_form;
+		} else {
+			$env{GETSTARTED} = "After you log in, you can create a channel";
 		}
+		Vector::Template::process('home', \%env);
 	}
 
 	print end_html;

diff --git a/static/style.css b/static/style.css
line changes: +8/-0
index f371d32..b9f3da6
--- a/static/style.css
+++ b/static/style.css
@@ -12,6 +12,10 @@ h1 {
 	font-size: 18pt;
 }
 
+h2 {
+	font-size: 14pt;
+}
+
 h1 > a, h2 > a {
 	color: black;
 	text-decoration: none;
@@ -21,6 +25,10 @@ h1 > a:hover, h2 > a:hover {
 	text-decoration: underline;
 }
 
+td > h2 {
+	margin-top: 0;
+}
+
 form {
 	margin: 0;
 }