diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mulk/benki/book_marx.clj | 11 | ||||
-rw-r--r-- | src/mulk/benki/util.clj | 1 | ||||
-rw-r--r-- | src/mulk/benki/webutil.clj | 8 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/mulk/benki/book_marx.clj b/src/mulk/benki/book_marx.clj index bbaa9f6..ef5da7e 100644 --- a/src/mulk/benki/book_marx.clj +++ b/src/mulk/benki/book_marx.clj @@ -103,7 +103,16 @@ (escape-html (format-date (:date mark)))] [:span {:class "bookmark-owner"} " by " (escape-html (:first_name mark))]] [:div {:class "bookmark-description"} - (htmlize-description (:description mark))]])]])))) + (htmlize-description (:description mark))]])]] + [:div {:id "bookmarx-feed-link"} + (let [feed-link (linkrel :marx :feed)] + [:span {:id "bookmarx-feed-link-text"} + [:a {:href (resolve-uri feed-link)} "Atom"] + (when *user* + (list + " [" + [:a {:href (resolve-uri (authlink feed-link))} "authlink"] + "]"))])])))) (defn marx-feed-for-user [user] (let [marks (bookmarks-visible-by user)] diff --git a/src/mulk/benki/util.clj b/src/mulk/benki/util.clj index 0c91b7d..fa5ca77 100644 --- a/src/mulk/benki/util.clj +++ b/src/mulk/benki/util.clj @@ -52,6 +52,7 @@ [[:login]] (fmt nil "/login") [[:marx]] (fmt nil "/marx") [[:marx :submit]] (fmt nil "/marx/submit") + [[:marx :feed]] (fmt nil "/marx/feed") [[:marx id]] (fmt nil "/marx/~a" id) [[:wiki title & xs]] (fmt nil "/wiki/~a~@[~a~]" title (first xs)) )) diff --git a/src/mulk/benki/webutil.clj b/src/mulk/benki/webutil.clj index 3a2cb1e..cf34724 100644 --- a/src/mulk/benki/webutil.clj +++ b/src/mulk/benki/webutil.clj @@ -13,11 +13,9 @@ -(defn authlink [] +(defn authlink [uri] (with-dbt - (let [req (request/ring-request) - user *user* - uri (:uri req) + (let [user *user* dkey (sql/with-query-results results ["SELECT * FROM page_keys WHERE \"user\" = ? AND page = ?" user uri] @@ -43,5 +41,5 @@ [:div {:class "logged-in-as"} (:first_name user) " " (:last_name user) " " - [:a {:href (authlink)} "[authlink]"]] + "[" [:a {:href (authlink (:uri (request/ring-request)))} "authlink"] "]"] [:div {:class "not-logged-in"} [:a {:href (link :login)} "Log in"]]))) |