diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 18:23:45 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 18:23:45 +0200 |
commit | 87c5b1867511f538ba44f57b50276eec533ccb44 (patch) | |
tree | 31abf52510360fdc3ecf53c117b6832f60af2d4a | |
parent | 0aa7927b0c7c746dd0bd0422598fc3a5f414bd49 (diff) | |
download | sites-87c5b1867511f538ba44f57b50276eec533ccb44.tar.gz sites-87c5b1867511f538ba44f57b50276eec533ccb44.tar.bz2 sites-87c5b1867511f538ba44f57b50276eec533ccb44.zip |
added simple check for mantainance/offline message
-rwxr-xr-x | index.py | 10 | ||||
-rw-r--r-- | templates/index.html | 13 |
2 files changed, 15 insertions, 8 deletions
@@ -1,11 +1,10 @@ #!/usr/bin/env python -import sys -sys.path += ['/usr/lib/mailman'] - +import sys, os, re from web import template, form, application, ctx, wsgi, config from socket import gethostbyaddr, gethostbyname -import re + +sys.path += ['/usr/lib/mailman'] import Mailman.Utils valid_ips = [ @@ -61,7 +60,8 @@ create_form = form.Form( class index: def GET(self): - return render.index() + running = not os.path.exists('./offline') + return render.index(running) class spam: def GET(self): diff --git a/templates/index.html b/templates/index.html index 4322153..ef415b8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,5 @@ +$def with (running) + $var title: Mailinglisten $var headline: Willkommen auf dem Mailinglistenserver von @@ -68,8 +70,13 @@ $var headline: <div id="status" class="center"> system status:<br /> - <span class="ok"> - <b>+++ RUNNING +++</b> - </span> + $if running: + <span class="ok"> + <b>+++ RUNNING +++</b> + </span> + $else: + <span class="wrong"> + <b>+++ MAINTENANCE / OFFLINE +++</b> + </span> </div> |