From 97f0e96dfb923de9294209775c139ff9b6667762 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 19 Jun 2012 00:40:51 +0200 Subject: Profile: Refine FOAF data. --- src/mulk/benki/id.clj | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') 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} -- cgit v1.2.3