+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;
use Vector::File;
use Vector::Notify;
use Vector::Error;
+use Vector::Template;
use strict;
our ($login_id, $login_user);
}
}
} 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;
font-size: 18pt;
}
+h2 {
+ font-size: 14pt;
+}
+
h1 > a, h2 > a {
color: black;
text-decoration: none;
text-decoration: underline;
}
+td > h2 {
+ margin-top: 0;
+}
+
form {
margin: 0;
}