From 53c653038d4127626ab4506d578a80804ed65439 Mon Sep 17 00:00:00 2001
From: Zach Copley <zach@status.net>
Date: Mon, 4 Apr 2011 15:28:28 -0700
Subject: [PATCH] QnA - Don't output question-description if it's empty; Do
 output question-closed msg if question is closed

---
 plugins/QnA/classes/QnA_Question.php | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/plugins/QnA/classes/QnA_Question.php b/plugins/QnA/classes/QnA_Question.php
index 3f1a33d33c..ed1757e989 100644
--- a/plugins/QnA/classes/QnA_Question.php
+++ b/plugins/QnA/classes/QnA_Question.php
@@ -214,9 +214,18 @@ class QnA_Question extends Managed_DataObject
         $notice = $question->getNotice();
 
         $out = new XMLStringer();
-        $out->elementStart('span', 'question_description');
-        $out->raw(QnAPlugin::shorten($question->description, $notice));
-        $out->elementEnd('span');
+
+        if (!empty($question->description)) {
+            $out->elementStart('span', 'question-description');
+            $out->raw(QnAPlugin::shorten($question->description, $notice));
+            $out->elementEnd('span');
+        }
+
+        if (!empty($question->closed)) {
+            $out->elementStart('span', 'question-closed');
+            $out->text(_m('This question is closed.'));
+            $out->elementEnd('span');
+        }
 
         return $out->getString();
     }
-- 
2.39.5