Index: tracdiscussion/api.py
===================================================================
--- tracdiscussion/api.py	(Revision 9434)
+++ tracdiscussion/api.py	(Arbeitskopie)
@@ -483,6 +483,8 @@
                     return ['topic-delete']
                 elif action == 'move':
                     return ['topic-move']
+                elif action == 'answered':
+                    return ['topic-answered']
                 elif action == 'post-move':
                     return ['topic-post-move']
                 elif action == 'set-display':
@@ -1057,6 +1059,29 @@
                 # Set message list display mode to session.
                 context.req.session['message-list-display'] = display
 
+            elif action == 'topic-answered':
+                context.req.perm.assert_permission('DISCUSSION_MODERATE')
+                # MIME
+
+                # Get form values.
+                #message = {'forum'    : context.forum['id'],
+                #           'topic'    : context.topic['id'],
+                #           'answered' : context.req.args.get('answered'),
+                #           'time' : to_timestamp(datetime.now(utc))}
+
+                # Get form values.
+                topic = {'answered' : context.req.args.get('answered')}
+
+                # Edit topic.
+                self.edit_topic(context, context.topic['id'], topic)
+
+                # Notify change listeners.
+                for listener in self.topic_change_listeners:
+                    listener.topic_changed(context, topic, context.topic)
+
+                # Redirect request to prevent re-submit.
+                context.redirect_url = (context.req.path_info, '#topic')
+
             elif action == 'topic-subscriptions-post-edit':
                 context.req.perm.assert_permission('DISCUSSION_MODERATE')
                 if not context.moderator:
@@ -1355,7 +1380,7 @@
     def get_topic(self, context, id):
         # Get topic by ID.
         topic = self._get_item(context, 'topic', ('id', 'forum', 'subject',
-          'time', 'author', 'subscribers', 'body'), 'id = %s', (id,))
+          'time', 'author', 'subscribers', 'body', 'answered'), 'id = %s', (id,))
 
         # Unpack list of subscribers.
         if topic:
@@ -1366,7 +1391,7 @@
     def get_topic_by_time(self, context, time):
         # Get topic by time of creation.
         topic = self._get_item(context, 'topic', ('id', 'forum', 'subject',
-          'time', 'author', 'subscribers', 'body'), 'time = %s', (time,))
+          'time', 'author', 'subscribers', 'body', 'answered'), 'time = %s', (time,))
 
         # Unpack list of subscribers.
         if topic:
@@ -1377,7 +1402,7 @@
     def get_topic_by_subject(self, context, subject):
         # Get topic by subject.
         topic = self._get_item(context, 'topic', ('id', 'forum', 'subject',
-          'time', 'author', 'subscribers', 'body'), 'subject = %s', (subject,))
+          'time', 'author', 'subscribers', 'body', 'answered'), 'subject = %s', (subject,))
 
         # Unpack list of subscribers.
         if topic:
@@ -1615,10 +1640,10 @@
             order_by = 't.' + order_by
         if with_body:
             columns = ('id', 'forum', 'time', 'subject', 'body', 'author',
-              'replies', 'lastreply')
+              'replies', 'lastreply', 'answered')
         else:
             columns = ('id', 'forum', 'time', 'subject', 'author', 'replies',
-              'lastreply')
+              'lastreply', 'answered')
         sql_values = {'with_body' : 't.body, ' if with_body else '',
           'forum_id' : to_unicode(forum_id),
           'order_by' : 'ORDER BY ' + order_by + (' ASC', ' DESC')[bool(desc)]
@@ -1626,7 +1651,7 @@
           'limit' : 'LIMIT ' + to_unicode(limit) if limit else '',
           'offset' : 'OFFSET ' + to_unicode(offset) if offset else ''}
         sql = ("SELECT t.id, t.forum, t.time, t.subject, %(with_body)s"
-                 "t.author, m.replies, m.lastreply "
+                 "t.author, m.replies, m.lastreply, t.answered "
                "FROM topic t "
                "LEFT JOIN "
                  "(SELECT COUNT(id) AS replies, MAX(time) AS lastreply, topic "
Index: tracdiscussion/htdocs/css/discussion.css
===================================================================
--- tracdiscussion/htdocs/css/discussion.css	(Revision 9434)
+++ tracdiscussion/htdocs/css/discussion.css	(Arbeitskopie)
@@ -39,6 +39,24 @@
   font-weight: bold;
 }
 
+.topic-list td, .topic-list tbody td
+{
+  padding-left: 0px;
+}
+
+.topic-list div.subject
+{
+  background: none no-repeat scroll 3px 3px transparent;
+  padding-left: 22px;
+  background-image: url(../discussion.png) !important
+}
+.topic-list div.subjecta
+{
+  background: none no-repeat scroll 3px 3px transparent;
+  padding-left: 22px;
+  background-image: url(../discussiona.png) !important
+}
+
 .forum-list th.group
 {
   padding: 1em;
@@ -237,3 +255,7 @@
 {
   background-image: url(../discussion.png) !important
 }
+dt.discussiona, dt.discussiona a
+{
+  background-image: url(../discussiona.png) !important
+}
Index: tracdiscussion/init.py
===================================================================
--- tracdiscussion/init.py	(Revision 9434)
+++ tracdiscussion/init.py	(Arbeitskopie)
@@ -8,7 +8,7 @@
 from trac.env import IEnvironmentSetupParticipant
 
 # Last discussion database shcema version.
-last_db_version = 4
+last_db_version = 5
 
 class DiscussionInit(Component):
     """
Index: tracdiscussion/timeline.py
===================================================================
--- tracdiscussion/timeline.py	(Revision 9434)
+++ tracdiscussion/timeline.py	(Arbeitskopie)
@@ -57,7 +57,7 @@
                 title = 'New topic on %s created' % (topic['forum_name'])
                 description = topic['subject']
                 ids = ('topic', topic['id'])
-                yield ('discussion', topic['time'], topic['author'], (title,
+                yield ('discussiona' if topic['answered'] == 1 else 'discussion', topic['time'], topic['author'], (title,
                   description, ids))
 
             # Get message events
@@ -65,7 +65,7 @@
                 title = 'New reply on %s created' % (message['forum_name'])
                 description = message['topic_subject']
                 ids = ('message', message['id'])
-                yield ('discussion', message['time'], message['author'], (title,
+                yield ('discussiona' if message['answered'] == 1 else 'discussion', message['time'], message['author'], (title,
                   description, ids))
 
     def render_timeline_event(self, context, field, event):
@@ -105,11 +105,11 @@
 
     def _get_changed_topics(self, context, start, stop):
         columns = ('id', 'subject', 'body', 'author', 'time', 'forum',
-          'forum_name')
+          'forum_name', 'answered')
         sql_values = {'start' : to_timestamp(start),
           'stop' : to_timestamp(stop)}
         sql = ("SELECT t.id, t.subject, t.body, t.author, t.time, t.forum, "
-                 "f.name "
+                 "f.name, t.answered "
                "FROM topic t "
                "LEFT JOIN "
                  "(SELECT id, name "
@@ -127,15 +127,15 @@
 
     def _get_changed_messages(self, context, start, stop):
         columns = ('id', 'author', 'time', 'forum', 'topic', 'body', 'forum_name',
-          'topic_subject')
+          'topic_subject', 'answered')
         sql_values = {'start' : to_timestamp(start),
           'stop' : to_timestamp(stop)}
         sql = ("SELECT m.id, m.author, m.time, m.forum, m.topic, m.body, "
-                 "f.name, t.subject "
+                 "f.name, t.subject, t.answered "
                "FROM message m, "
                  "(SELECT id, name "
                  "FROM forum) f, "
-                 "(SELECT id, subject "
+                 "(SELECT id, subject, answered "
                  "FROM topic) t "
                "WHERE t.id = m.topic AND f.id = m.forum AND time BETWEEN "
                "%(start)s AND %(stop)s" % (sql_values))
Index: tracdiscussion/templates/message-list.html
===================================================================
--- tracdiscussion/templates/message-list.html	(Revision 9434)
+++ tracdiscussion/templates/message-list.html	(Arbeitskopie)
@@ -40,6 +40,21 @@
               <input type="hidden" name="discussion_action" value="move"/>
             </div>
           </form>
+          <form method="answer" action="${href.discussion('topic', discussion.topic.id)}">
+            <div >
+              <py:choose>
+                <py:when test="(discussion.topic.answered == 1)">
+                  <input type="submit" name="answertopic" value="Set topic un-answered"/>
+                  <input type="hidden" name="answered" value="0"/>
+                </py:when>
+                <py:otherwise>
+                  <input type="submit" name="answertopic" value="Set topic answered"/>
+                  <input type="hidden" name="answered" value="1"/>
+                </py:otherwise>
+              </py:choose>
+              <input type="hidden" name="discussion_action" value="answered"/>
+            </div>
+          </form>
         </div>
 
       </div>
Index: tracdiscussion/templates/topic-list-compact.html
===================================================================
--- tracdiscussion/templates/topic-list-compact.html	(Revision 9434)
+++ tracdiscussion/templates/topic-list-compact.html	(Arbeitskopie)
@@ -14,7 +14,7 @@
       <tbody>
         <tr py:for="line, topic in enumerate(discussion.topics)" class="${line % 2 and 'even' or 'odd'}">
           <td colspan="3" class="subject">
-            <div class="subject">
+            <div class="${'subjecta' if topic.answered == 1 else 'subject'}">
               <a href="${href.discussion('topic', topic.id)}">
                 <strong>${format_to_oneliner_no_links(discussion.env, context, topic.subject) or '&nbsp;'}</strong>
               </a> (#${topic.id})<br/>
