Permalink
Browse files

Styling changes and added hCard to OpenIDs

  • Loading branch information...
singpolyma committed Jun 21, 2009
1 parent 1f492a3 commit 6a46cc616ec72fbc0fad97f1e1bf868dc55fa330
Showing with 36 additions and 4 deletions.
  1. +6 −2 provider.py
  2. +15 −0 static/base.css
  3. BIN static/openid-logo.png
  4. +5 −1 templates/base.html
  5. +10 −1 templates/index.html
View
@@ -45,7 +45,7 @@
import store
# Set to True if stack traces should be shown in the browser, etc.
-_DEBUG = False
+_DEBUG = True
# the global openid server instance
oidserver = None
@@ -244,6 +244,7 @@ class FrontPage(Handler):
"""Show the default OpenID page, with the last 10 logins for this user."""
def get(self, error=False):
logins = []
+ unverified_email = False
if self.user:
query = datastore.Query('Login')
@@ -270,7 +271,10 @@ def get(self):
return
elif oidrequest is None:
# this is a request from a browser
- self.ShowFrontPage()
+ unverified_email = urllib.unquote(urlparse.urlparse(self.request.uri)[2][4:])
+ email_md5 = hashlib.md5(unverified_email).hexdigest()
+ nickname = unverified_email.rsplit('@',1)[0]
+ self.Render('index', vars())
elif oidrequest.mode in ['checkid_immediate', 'checkid_setup']:
if self.HasCookie() and self.CheckUser():
logging.debug('Has cookie, confirming identity to ' +
View
@@ -25,6 +25,8 @@ body {
h1 {
margin-bottom: 2em;
+ font-size: 22pt;
+ font-weight: normal
}
h1 img {
@@ -47,6 +49,19 @@ p, form {
text-align: center;
}
+.vcard {
+ max-width: 25em;
+ margin: auto;
+ margin-bottom: 2em;
+ padding: 1em;
+ border: 1px groove #ccc;
+}
+ .vcard .photo {
+ float: left;
+ background-color: #ccc;
+ padding:0.3em;
+ margin-right:1em;
+ }
/*
* Links
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -26,7 +26,11 @@ <h1>
{% if user %}
{{ user }}
{% else %}
- Email
+ {% if unverified_email %}
+ {{ unverified_email }}
+ {% else %}
+ Email
+ {% endif %}
{% endif %}
</h1>
{% endblock %}
View
@@ -6,8 +6,17 @@
<p class="warning">{{ error }}</p>
{% endif %}
+
+{% if unverified_email %}
+<div class="vcard">
+ <img class="photo" alt="Avatar" src="http://www.gravatar.com/avatar/{{ email_md5 }}?d=wavatar" />
+ <p class="fn nickname">{{ nickname }}</p>
+ <p><a class="email" href="mailto:{{ unverified_email }}">{{ unverified_email }}</a></p>
+</div>
+{% endif %}
+
<p>You can use your email address to log into any site that supports
-<a href="http://openid.net/"><img src="/static/openid-icon.png" />OpenID</a>.</p>
+<img src="/static/openid-icon.png" alt="" /><a href="http://openid.net/">OpenID</a>.</p>
<p>Just enter
<span class="url">{{ request_url_without_path }}/id/<span style="font-style:italic;font-weight:bold;">your-email-address</span></a></span> as
your OpenID.</p>

0 comments on commit 6a46cc6

Please sign in to comment.