aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cljssss-g.clj25
-rw-r--r--index.st2
2 files changed, 16 insertions, 11 deletions
diff --git a/cljssss-g.clj b/cljssss-g.clj
index d919abc..05b7d18 100644
--- a/cljssss-g.clj
+++ b/cljssss-g.clj
@@ -257,17 +257,20 @@ to merely being replaced with a div element)?"
(defn show-subscriptions [user feed active-entry-id]
(with-db
- (.toString (doto (.getInstanceOf templates "index")
- (.setAttributes {"feeds" (select-feeds user feed)
- "entries" (when feed (select-entries user
- feed
- active-entry-id))
- "active_feed_id" feed
- "active_feed_title" (and feed
- (select-feed-name user feed))
- "title" "Subscriptions"
- "xhtml_content" (and active-entry-id
- (entry-xhtml-content active-entry-id))})))))
+ (.toString
+ (let [xhtml-content (and active-entry-id
+ (entry-xhtml-content active-entry-id))]
+ (doto (.getInstanceOf templates "index")
+ (.setAttributes {"feeds" (select-feeds user feed)
+ "entries" (when feed (select-entries user
+ feed
+ active-entry-id))
+ "active_feed_id" feed
+ "active_feed_title" (and feed
+ (select-feed-name user feed))
+ "title" "Subscriptions"
+ "xhtml_content_p" (not (nil? xhtml-content))
+ "xhtml_content" xhtml-content}))))))
(defmacro with-session
"Rebind Compojure's magic lexical variables as vars."
diff --git a/index.st b/index.st
index 0008c19..7b505a4 100644
--- a/index.st
+++ b/index.st
@@ -29,7 +29,9 @@ $if(entries)$
$! FIXME: Show content inline if possible. !$
<li class="full-entry">
<a id="entry-$entry.id$" href="$entry.link$"><h3>$entry.title$</h3></a>
+ $if(xhtml_content_p)$
<div class="entry-content">$xhtml_content$</div>
+ $endif$
</li>
$else$
<li class="partial-entry">