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)
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),

View file

@ -197,6 +197,31 @@ ul#queries
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

View file

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

View file

@ -52,6 +52,29 @@
</div>
</%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()">
<div id="tagcloud">
@ -122,6 +145,8 @@
${self.tagcloud()}
${self.messagebox()}
${self.body()}
<div id="copyright">

View file

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