From bd4eb105794627a86d252b5f57cabdcede32505e Mon Sep 17 00:00:00 2001 From: erlehmann Date: Fri, 12 Sep 2008 01:18:37 +0000 Subject: [PATCH] rudimentary error / information / warning messages git-svn-id: http://yolanda.mister-muffin.de/svn@379 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/yolanda/controllers/account.py | 8 ++++-- trunk/yolanda/public/css/colors/tango.css | 27 +++++++++++++++++++- trunk/yolanda/public/css/structure/fake6.css | 5 ++++ trunk/yolanda/templates/xhtml/base.mako | 25 ++++++++++++++++++ trunk/yolanda/templates/xhtml/index.mako | 1 + 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/trunk/yolanda/controllers/account.py b/trunk/yolanda/controllers/account.py index 11981ef..94d1d60 100644 --- a/trunk/yolanda/controllers/account.py +++ b/trunk/yolanda/controllers/account.py @@ -15,11 +15,15 @@ class AccountController(BaseController): self.consumer = Consumer(self.openid_session, None) openid = request.params.get('username', None) if openid is None: - return "invalid openid" + # invalid openid + c.error = "invalid openid" + return render('/xhtml/index.mako') try: authrequest = self.consumer.begin(openid) except DiscoveryFailure, e: - return "invalid openid" + # invalid openid + c.error = "invalid openid" + return render('/xhtml/index.mako') redirecturl = authrequest.redirectURL( h.url_for('',qualified=True), diff --git a/trunk/yolanda/public/css/colors/tango.css b/trunk/yolanda/public/css/colors/tango.css index 96d74d2..19e2c28 100644 --- a/trunk/yolanda/public/css/colors/tango.css +++ b/trunk/yolanda/public/css/colors/tango.css @@ -194,9 +194,34 @@ ul#queries ul#queries li a { - color: #FFD95A; + color: #FFD95A; } +/* classes */ + +.messagebox +{ + +} + + .messagebox.error + { + /* "Scarlet Red 1" + 30 luminosity */ + background-color: #f46060; + } + + .messagebox.information + { + /* "Chameleon 1" + 30 luminosity */ + background-color: #a9ec68; + } + + .messagebox.warning + { + /* "Orange 1" */ + background-color: #fcaf3e; + } + /* ids */ #copyright diff --git a/trunk/yolanda/public/css/structure/fake6.css b/trunk/yolanda/public/css/structure/fake6.css index 5269216..f1dd7f4 100644 --- a/trunk/yolanda/public/css/structure/fake6.css +++ b/trunk/yolanda/public/css/structure/fake6.css @@ -122,6 +122,11 @@ ul /* classes */ +.messagebox +{ + margin-right: 28em; +} + /* ids */ /* sidebar stuff */ diff --git a/trunk/yolanda/templates/xhtml/base.mako b/trunk/yolanda/templates/xhtml/base.mako index a1ae017..cadcd91 100644 --- a/trunk/yolanda/templates/xhtml/base.mako +++ b/trunk/yolanda/templates/xhtml/base.mako @@ -52,6 +52,29 @@ +<%def name="messagebox()"> + +%if c.error: +
+ ${c.error} +
+%endif + +%if c.information: +
+ ${c.information} +
+%endif + +%if c.warning: +
+ ${c.warning} +
+%endif + + + + <%def name="tagcloud()">
@@ -122,6 +145,8 @@ ${self.tagcloud()} + ${self.messagebox()} + ${self.body()}