aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-07-15 23:01:07 +0200
committerGravatar Tom Willemse2013-07-15 23:01:07 +0200
commitc1eed7136c6298afe1638c0f748e37742d9088b6 (patch)
treef88c3aea874946ae11f38a3dac3d76e238788071
parentcfab0475f33233a4d36d729e8cf6e34edd45d0aa (diff)
downloadscrumli-c1eed7136c6298afe1638c0f748e37742d9088b6.tar.gz
scrumli-c1eed7136c6298afe1638c0f748e37742d9088b6.zip
Show gravatar avatar
-rw-r--r--scrumli.asd2
-rw-r--r--scrumli.lisp5
-rw-r--r--templates/scrumli.tmpl1
3 files changed, 7 insertions, 1 deletions
diff --git a/scrumli.asd b/scrumli.asd
index 87d124a..473ba00 100644
--- a/scrumli.asd
+++ b/scrumli.asd
@@ -8,7 +8,7 @@
:author "Tom Willemse"
:license "AGPLv3"
:depends-on (:restas :sexml :postmodern :cl-json :drakma
- :closure-template)
+ :closure-template :md5)
:defsystem-depends-on (:closure-template)
:components ((:closure-template "templates/scrumli")
(:file "defmodule")
diff --git a/scrumli.lisp b/scrumli.lisp
index 22ce5d7..8fb5a18 100644
--- a/scrumli.lisp
+++ b/scrumli.lisp
@@ -52,6 +52,10 @@
(<:a :class "brand" "scrumli")
,@body))))
+(defun md5-hash (str)
+ (string-downcase (format nil "~{~2,'0x~}"
+ (coerce (md5:md5sum-string str) 'list))))
+
(define-route main ("")
(if (logged-in-p)
(scrumli-templates:main
@@ -64,6 +68,7 @@
*scrumli-react-js-location*
*scrumli-jsxtransformer-js-location*)
:username ,(hunchentoot:session-value :username)
+ :usermd5 ,(md5-hash (hunchentoot:session-value :username))
:ulogout ,(genurl 'logout-page)
:umainjs ,(genurl 'main-js)))
(redirect 'login-page)))
diff --git a/templates/scrumli.tmpl b/templates/scrumli.tmpl
index 1deb32c..5f4930c 100644
--- a/templates/scrumli.tmpl
+++ b/templates/scrumli.tmpl
@@ -21,6 +21,7 @@
<a class="brand">scrumli</a>
<div class="pull-right">
<span class="navbar-text">
+ <img src="https://secure.gravatar.com/avatar/{$usermd5}?s=16" />
{$username}
</span>
<ul class="nav pull-right">