my eye

Render content on RSVPs

Committed 89e473

--- a/webint_posts/templates/entry.html
+++ b/webint_posts/templates/entry.html

 
 $ type = discover_post_type(entry)
 
-$if type == "note":
-    ...
-    $# <div id=previewContent>
-    $#     <div class=e-content>$:post_mkdn(entry["content"][0]["html"])</div>
-    $# </div>
-$elif type == "article":
-    $var title = entry["name"][0]
-    $# <h2 class=p-name>$entry["name"][0]</h2>
-    <div id=previewContent>
+$def render_content(entry)
     $ content = entry["content"][0]
     $if isinstance(content, dict) and "html" in content:
         <div class=e-content>$:post_mkdn(content["html"])</div>
     $else:
         <div class=p-content>$:post_mkdn(content)</div>
-    </div>
+
+$if type == "note":
+    <div id=previewContent>$render_content(entry)</div>
+$elif type == "article":
+    $var title = entry["name"][0]
+    <div id=previewContent>$render_content(entry)</div>
 $elif type == "weight":
     <h2 class=p-summary>$entry["summary"][0]</h2>
     $ weight = entry["weight"][0]
     <a class="p-name u-url" href=$like>$like</a></big></p>
 $elif type == "rsvp":
     $ in_reply_to = entry["in-reply-to"][0]
+    $# var title: RSVP'd $entry["rsvp"] to $event["name"]
+    $var show_title = False
     <p>RSVP <strong class=p-rsvp>$entry["rsvp"][0]</strong> to
     <a class=u-in-reply-to href=$in_reply_to>$in_reply_to</a></p>
-    $# $ event = entry["in-reply-to"][0]
-    $# $var title: RSVP'd $entry["rsvp"] to $event["name"]
-    $# <p><big>RSVP'd <code>$entry["rsvp"]</code> <a class=u-bookmark-of
-    $# href=$event["url"]>$event["name"]</a></big></p>
+    <div id=previewContent>$render_content(entry)</div>
 $else:
     <p>$type</p>