From: Bastard Super User From Hell Date: Thu, 13 Sep 2007 00:03:24 +0000 (+0200) Subject: Better CSS support X-Git-Tag: v2.0~7 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1c33760fee962c9aa3b77ac6b354485b377e3d9e;p=geekigeeki.git Better CSS support --- diff --git a/geekigeeki.css b/geekigeeki.css index 666659f..e1eb871 100755 --- a/geekigeeki.css +++ b/geekigeeki.css @@ -2,6 +2,7 @@ * $Id: intrafm.css,v 1.10 2002/12/04 17:57:21 gerry Exp $ * * Author: Gerardo Poggiali + * Author: Bernardo Innocenti */ body { @@ -133,7 +134,7 @@ div.preview { border: 2px dashed #FF0000; } -div.navigator { +div.nav { border-color: #cc9933; background-color: #ffcc66; border-style: solid; @@ -151,22 +152,47 @@ div.navigator { margin-right: 0px; } -div.footer { - font-size: smaller; - color: #888888; - border-color: black; +.nav hr { + display: none; +} - margin-top: 10px; - margin-left: 0px; - margin-right: 0px; +.nav .login { + font-size: small; + text-color: red; +} - border-style: solid; - border-top-width: 1px; - border-right-width: 0px; - border-bottom-width: 0px; - border-left-width: 0px; +#footer div { + margin-top: 1em; + margin-left: 0; + margin-right: 0; +} + +#footer hr { + border: none; + border-top: 1px solid #bbbbbb; + margin: 0 0; +} + +#footer :link, #footer :visited { + color: #666666; +} + +#footer p { + color: #888888; + font-size: x-small; + margin-top: 0; +} + +#footer p.copyright { + float: left; + margin-left: 1em; + padding: 0 1em; +} +#footer p.modified { + float: right; text-align: right; + margin-right: 1em; } p.dialog { @@ -254,3 +280,17 @@ pre.notice { background-color: white; border: 1px solid #8cacbb; } + +/* Styles for search word highlighting */ +@media screen { + .searchword0 { background: #ff9 } + .searchword1 { background: #cfc } + .searchword2 { background: #cff } + .searchword3 { background: #ccf } + .searchword4 { background: #fcf } +} + +@media print { + #footer { display: none } + .nav { display: none } +} diff --git a/geekigeeki.py b/geekigeeki.py index ec64ca9..116b03b 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -19,7 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = '$Revision: 1.63+gerry+bernie $'[11:-2]; +__version__ = '$Revision: 1.63+gerry+bernie $'[11:-2] import cgi, sys, string, os, re, errno, time, stat from os import path, environ @@ -43,7 +43,10 @@ def privileged_path(): return privileged_url or script_name() def remote_user(): - return environ.get('REMOTE_USER', 'AnonymousCoward') + user = environ.get('REMOTE_USER', '') + if user is None or user == '' or user == 'anonymous': + user = 'AnonymousCoward' + return user def remote_host(): return environ.get('REMOTE_ADDR', '') @@ -53,7 +56,7 @@ def get_hostname(addr): from socket import gethostbyaddr return gethostbyaddr(addr)[0] + ' (' + addr + ')' except: - return addr; + return addr # Formatting stuff -------------------------------------------------- @@ -62,7 +65,7 @@ def emit_header(type="text/html"): print def send_guru(msg, msg_type): - if msg is None or len(msg) == 0: return + if msg is None or msg == '': return print '
'
     if msg_type == 'error':
         print '    Software Failure.  Press left mouse button to continue.\n'
@@ -117,10 +120,11 @@ def send_title(name, text="Limbo", msg=None, msg_type='error'):
     else:
         print ''
 
+    title_done = True
     send_guru(msg, msg_type)
 
     # Navbar
-    print ''
 
 def link_tag(params, text=None, ss_class=None, authentication=False):
     if text is None:
@@ -253,9 +255,10 @@ def send_footer(name, mod_string=None):
         cgi.print_arguments()
         cgi.print_form(cgi.FieldStorage())
         cgi.print_environ()
-    print '