aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-09-20 10:27:01 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-09-20 10:27:01 +0200
commitdadcc6af33a953de0878e93ebbb881f26a964570 (patch)
treefaa8782df93fb1ba3f8b0f8a3c8e5957f10737a5
parentd749ae2bf93d4a0665e1c87a6f85050ab9db81dc (diff)
possibility to config default stylesheet
-rwxr-xr-xauthorization_required.cgi5
-rw-r--r--config_sample.rb4
-rw-r--r--dudle.rb4
-rwxr-xr-xerror.cgi5
-rwxr-xr-xnot_found.cgi5
5 files changed, 18 insertions, 5 deletions
diff --git a/authorization_required.cgi b/authorization_required.cgi
index 9d2303a..7f2ff4b 100755
--- a/authorization_required.cgi
+++ b/authorization_required.cgi
@@ -41,10 +41,13 @@ else
GetText.bindtextdomain("dudle",:path => "./locale/")
title = _("Authorization Required")
$h = HTML.new(title)
- $h.add_css("/default.css","default",true)
+ $h.add_css("/#{DEFAULT_CSS}","default",true)
returnstr = _("Return to dudle home and Schedule a new Poll")
authstr = _("You have to authorize in order to request this page!")
$h << <<END
+ <div id='header1'></div>
+ <div id='header2'></div>
+ <div id='header3'></div>
<div id='main'>
<div id='content'>
<h1>#{title}</h1>
diff --git a/config_sample.rb b/config_sample.rb
index aac1ff8..0441d8c 100644
--- a/config_sample.rb
+++ b/config_sample.rb
@@ -79,3 +79,7 @@ NOTICE
}
notice += "</table>"
NOTICE = notice
+
+# choose a default stylesheet
+# e.g., "classic.css", "css/foobar.css", ...
+DEFAULT_CSS = "default.css"
diff --git a/dudle.rb b/dudle.rb
index 21fbf2a..aac7940 100644
--- a/dudle.rb
+++ b/dudle.rb
@@ -137,10 +137,10 @@ class Dudle
}
if $cgi.include?("css")
@user_css = $cgi["css"]
- @html.add_cookie("css",@user_css,"/",Time.now + (1*60*60*24*365 * (@user_css == "default.css" ? -1 : 1 )))
+ @html.add_cookie("css",@user_css,"/",Time.now + (1*60*60*24*365 * (@user_css == DEFAULT_CSS ? -1 : 1 )))
else
@user_css = $cgi.cookies["css"][0]
- @user_css ||= "default.css"
+ @user_css ||= DEFAULT_CSS
end
if $cgi.user_agent =~ /.*MSIE [567]\..*/
diff --git a/error.cgi b/error.cgi
index 3479757..772a22d 100755
--- a/error.cgi
+++ b/error.cgi
@@ -35,8 +35,11 @@ require "html"
title = _("Error")
$h = HTML.new(title)
-$h.add_css("/default.css","default",true)
+$h.add_css("/#{DEFAULT_CSS}","default",true)
$h << <<END
+<div id='header1'></div>
+<div id='header2'></div>
+<div id='header3'></div>
<div id='main'>
<div id='content'>
<h1>#{title}</h1>
diff --git a/not_found.cgi b/not_found.cgi
index a75febe..a22d081 100755
--- a/not_found.cgi
+++ b/not_found.cgi
@@ -25,7 +25,7 @@ GetText.bindtextdomain("dudle",:path => "./locale/")
title = _("Poll Not Found")
$h = HTML.new(title)
-$h.add_css("/default.css","default",true)
+$h.add_css("/#{DEFAULT_CSS}","default",true)
str = [_("The requested Poll was not found."),
_("There are several reasons, why a Poll is deleted:"),
_("Somebody klicked on “Delete Poll” and deleted the poll manually."),
@@ -34,6 +34,9 @@ str = [_("The requested Poll was not found."),
_("Return to dudle home and Schedule a new Poll")]
$h << <<END
+<div id='header1'></div>
+<div id='header2'></div>
+<div id='header3'></div>
<div id='main'>
<div id='content'>
<h1>#{title}</h1>