Show gravatar avatar

This commit is contained in:
Tom Willemse 2013-07-15 23:01:07 +02:00
parent cfab0475f3
commit c1eed7136c
3 changed files with 7 additions and 1 deletions

View file

@ -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")

View file

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

View file

@ -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">