<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,7 @@
   ((title :accessor blog-post.title
 	  :initarg :title
 	  :type string
-	  :index t)
+	  :index t)u
    (body :accessor blog-post.body
 	 :initarg :body
 	 :type string
@@ -20,14 +20,22 @@
 (defmethod remove-comment ((self blog-post) (comm comment))
   (remove-item comm (blog-post.comments self)))
 
+(defmethod have-comments? ((self blog-post))
+  (slot-boundp self 'comments))
+
 (defmethod map-comments (fn (self blog-post))
-  (map-pset fn (blog-post.comments self)))
+  (when (have-comments? self)
+    (map-pset fn (blog-post.comments self))))
 
 (defmethod comments-as-list ((self blog-post))
-  (pset-list (blog-post.comments self)))
+  (if (have-comments? self)
+      (pset-list (blog-post.comments self))
+      '()))
 
 (defun comment-count (blog-post)
-  (length (comments-as-list blog-post)))
+  (if (have-comments? blog-post)
+      (length (comments-as-list blog-post))
+      0))
 
 (defun add-post (title body)
   (with-transaction ()</diff>
      <filename>blog-post.lisp</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>data2.db</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,25 @@
 (defmethod ucw::render ((self summary))
   (&lt;:h1 &quot;Summary of posts&quot;)
   (dolist (post (summary.posts self))
-    (&lt;:h2 (&lt;:as-html (blog-post.title post)))   
+    (&lt;:h2 (&lt;:as-html (blog-post.title post)))
     (&lt;:p (&lt;:as-html (blog-post.body post)))
+    (&lt;:as-html &quot;Yorum: &quot; (comment-count post)) (&lt;:br)
+    (&lt;ucw:a :action (post-detail self post) &quot;Detail&quot;)
     (&lt;:hr)))
 
+(defaction post-detail ((self summary) post)
+  (call 'detail :post post))
+
+(ucw::defcomponent detail ()
+  ((post :accessor detail.post
+	 :initarg :post)))
+
+(defmethod ucw::render ((self detail))
+  (&lt;:a :href &quot;/blog/index.zek&quot; &quot;&lt;&lt;Home&quot;)
+  (&lt;:h1 (&lt;:as-html (blog-post.title (detail.post self))))
+  (&lt;:p (&lt;:as-html (blog-post.body (detail.post self))))
+  (&lt;:h3 &quot;Yorumlar:&quot;)
+  (dolist (comment (comments-as-list (detail.post self)))
+    (&lt;:strong (&lt;:as-html (comment.email comment)))
+    (&lt;:p (&lt;:as-html (comment.body comment)))
+    (&lt;:hr)))
\ No newline at end of file</diff>
      <filename>layout.lisp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e564e0ec050f404a2b55fc69d8d076bba41016a7</id>
    </parent>
  </parents>
  <author>
    <name>Zekeriya KOC</name>
    <email>zekus@zetbook.(none)</email>
  </author>
  <url>http://github.com/zekzekus/zek-blog/commit/5daf6c8602798e6589372a2e80797daad4e97745</url>
  <id>5daf6c8602798e6589372a2e80797daad4e97745</id>
  <committed-date>2009-10-31T03:01:14-07:00</committed-date>
  <authored-date>2009-10-31T03:01:14-07:00</authored-date>
  <message>comments slot unbound problem fixed.</message>
  <tree>8d4fc81548d6fab22113025270ebd106bd926fdd</tree>
  <committer>
    <name>Zekeriya KOC</name>
    <email>zekus@zetbook.(none)</email>
  </committer>
</commit>
