diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-06-19 00:40:51 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-06-19 00:40:51 +0200 |
commit | 97f0e96dfb923de9294209775c139ff9b6667762 (patch) | |
tree | 182f01450b7d2d0a1e7f3b5f32eba8eb96dc2158 /src | |
parent | 41a9ee97f3c0e41b68342bf7dc22b49a7ca6ab4b (diff) |
Profile: Refine FOAF data.
Diffstat (limited to 'src')
-rw-r--r-- | src/mulk/benki/id.clj | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mulk/benki/id.clj b/src/mulk/benki/id.clj index 2589e80..766a08f 100644 --- a/src/mulk/benki/id.clj +++ b/src/mulk/benki/id.clj @@ -80,20 +80,22 @@ (def profile-page {}) -(defn user-name [uid] - (let [user (query1 "SELECT first_name, last_name FROM users WHERE id = ?" uid)] - (fmt nil "~A ~A" - (:first_name user) - (:last_name user)))) +(defn find-user [uid] + (query1 "SELECT first_name, last_name FROM users WHERE id = ?" uid)) -(defn show-profile-page [user] +(defn show-profile-page [uid] (with-dbt (layout profile-page "A Profile Page" [:div {:typeof "foaf:Person"} [:div {:property "foaf:name"} - (user-name user)] + (:first_name (find-user uid)) " " (:last_name (find-user uid))] + [:div {:style "display: none"} + [:span {:property "foaf:givenName"} + (:first_name (find-user uid))] + [:span {:property "foaf:familyName"} + (:last_name (find-user uid))]] [:h2 "Public Keys"] - (sql/with-query-results keys ["SELECT * FROM user_rsa_keys WHERE \"user\" = ?" user] + (sql/with-query-results keys ["SELECT * FROM user_rsa_keys WHERE \"user\" = ?" uid] (doall (for [{modulus :modulus, exponent :exponent} |