r1846@llin: dpavlin | 2009-04-26 00:26:04 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 25 Apr 2009 22:26:29 +0000 (22:26 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 25 Apr 2009 22:26:29 +0000 (22:26 +0000)
 support for custom vhost/vhost.css file

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1173 07558da8-63fa-0310-ba24-9fe276d99e06

vhost/ecas/ecas.css [new file with mode: 0644]
vhost/webpac2.cgi

diff --git a/vhost/ecas/ecas.css b/vhost/ecas/ecas.css
new file mode 100644 (file)
index 0000000..600eedd
--- /dev/null
@@ -0,0 +1,6 @@
+/* design for this vhost */
+
+.title {
+       font-weight: bold;
+}
+
index 84b6a16..8cadc19 100755 (executable)
@@ -76,9 +76,13 @@ sub show_pager {
 }
 
 my $path = $ENV{PATH_INFO} || 'ecas';
+$path =~ s{^/+}{};
+$path =~ s{/+$}{};
 my $dir = $0;
 $dir =~ s{/[^/]+.cgi}{};
 
+dump_yaml( 'dir', $dir );
+
 my $config = YAML::LoadFile( "$dir/$path/config.yml" );
 
 my $database = (keys %{ $config->{databases} })[0];
@@ -133,10 +137,14 @@ foreach ( @{ $db->{input} } ) {
 
 warn "## only_input = ", dump( $only_input );
 
+my @style = ( '../../style.css' );
+push @style, "../../$path/$path.css" if -e "$dir/$path/$path.css";
+dump_yaml( 'style', \@style );
+
 print
        start_html(
                -title => $db->{name},
-               -style => '../../style.css',
+               -style => [ @style ],
        ),
        h1( $db->{name} ),
        qq|<div id=description>|, $db->{description}, qq|</div>|,