rudimentary error / information / warning messages

git-svn-id: http://yolanda.mister-muffin.de/svn@379 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
erlehmann 2008-09-12 01:18:37 +00:00
parent e3c4f65849
commit bd4eb10579
5 changed files with 63 additions and 3 deletions

View file

@ -15,11 +15,15 @@ class AccountController(BaseController):
self.consumer = Consumer(self.openid_session, None) self.consumer = Consumer(self.openid_session, None)
openid = request.params.get('username', None) openid = request.params.get('username', None)
if openid is None: if openid is None:
return "invalid openid" # invalid openid
c.error = "invalid openid"
return render('/xhtml/index.mako')
try: try:
authrequest = self.consumer.begin(openid) authrequest = self.consumer.begin(openid)
except DiscoveryFailure, e: except DiscoveryFailure, e:
return "invalid openid" # invalid openid
c.error = "invalid openid"
return render('/xhtml/index.mako')
redirecturl = authrequest.redirectURL( redirecturl = authrequest.redirectURL(
h.url_for('',qualified=True), h.url_for('',qualified=True),

View file

@ -194,9 +194,34 @@ ul#queries
ul#queries li a 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 */ /* ids */
#copyright #copyright

View file

@ -122,6 +122,11 @@ ul
/* classes */ /* classes */
.messagebox
{
margin-right: 28em;
}
/* ids */ /* ids */
/* sidebar stuff */ /* sidebar stuff */

View file

@ -52,6 +52,29 @@
</div> </div>
</%def> </%def>
<%def name="messagebox()">
%if c.error:
<div class="messagebox error">
${c.error}
</div>
%endif
%if c.information:
<div class="messagebox information">
${c.information}
</div>
%endif
%if c.warning:
<div class="messagebox warning">
${c.warning}
</div>
%endif
</%def>
<%def name="tagcloud()"> <%def name="tagcloud()">
<div id="tagcloud"> <div id="tagcloud">
@ -122,6 +145,8 @@
${self.tagcloud()} ${self.tagcloud()}
${self.messagebox()}
${self.body()} ${self.body()}
<div id="copyright"> <div id="copyright">

View file

@ -6,6 +6,7 @@
<%def name="heading()"> <%def name="heading()">
Welcome to Yolanda, a place for people who hate Adobe Flash. Welcome to Yolanda, a place for people who hate Adobe Flash.
${request.headers.get('REFERER')}
</%def> </%def>
<h1>An introduction to Yolanda</h1> <h1>An introduction to Yolanda</h1>