Modify

Opened 14 years ago

Closed 14 years ago

#8068 closed enhancement (fixed)

Patch to add "answered" status flag to the forums and timeline

Reported by: Michael Medin Owned by: Radek Bartoň
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Since I wanted a way to indicate that questions (on my forum) have been answered I added a status filed which translates to a icon indicator so it is simple to know when a topic has been answered or not.

This is kind of hard to describe but in essence you can toggle "answered" and once a topic is answered it will get a "check box" on top of the regular yellow icon. Really useful if you ask me.

You can see it in action here: http://www.nsclient.org/nscp/discussion/forum/1 and http://www.nsclient.org/nscp/timeline (look for a green checkbox over the yellow bubble).

The patch is created using svn diff so let me know if that is an incorrect syntax. *NOTICE* this changes the database so create a backup first as there is no "downgrade" (ie. it will not remove the extra column from the topic table). The alteration to the database is very slim (just adds a column to the topic table).

The icon did not seem to make it into the patch to I attached it separately.

Script to remove the column from the database (ie. if you want to uninstall, but this is manual work and not very tested so take care, and always do a backup):

BEGIN TRANSACTION;
CREATE TEMPORARY TABLE t1_backup(id integer PRIMARY KEY,
    forum integer,
    time integer,
    author text,
    subscribers text,
    subject text,
    body text);
INSERT INTO t1_backup SELECT id, forum, time, author, subscribers, subject, body  FROM topic;
DROP TABLE topic;
CREATE TABLE topic (
    id integer PRIMARY KEY,
    forum integer,
    time integer,
    author text,
    subscribers text,
    subject text,
    body text);
INSERT INTO topic SELECT id, forum, time, author, subscribers, subject, body  FROM t1_backup;
DROP TABLE t1_backup;
COMMIT;

*please note* this is only visible in timeline and "compact" forum view as that is what I use so set:

[discussion]
default_topic_display = compact

Michael Medin

Attachments (3)

answered-flag.diff (9.8 KB) - added by Michael Medin 14 years ago.
answered-flag.2.diff (9.8 KB) - added by Michael Medin 14 years ago.
discussiona.png (213 bytes) - added by Michael Medin 14 years ago.

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by Michael Medin

Attachment: answered-flag.diff added

Changed 14 years ago by Michael Medin

Attachment: answered-flag.2.diff added

Changed 14 years ago by Michael Medin

Attachment: discussiona.png added

comment:1 Changed 14 years ago by Michael Medin

Type: defectenhancement

comment:2 Changed 14 years ago by Michael Medin

A few notes to the implementer/maintainer:

  • I guess a better approach would be to have some "nice toggle" thingy instead of the ugly button
  • A custom privilege might be good as well so we can allow end-users to set the flag (I might change this myself but was to lazy).
  • Use a better class/icon name then adding 'a' to the end
  • The other views need to get the flag as well (probably just to add the class if statement to them as well.
  • There is a very annoying padding on the "td" element which makes the icon to "far right" but I was unable to get rid of it.
  • The CSS is a hack but it works...

Michael Medin

comment:3 Changed 14 years ago by Radek Bartoň

Status: newassigned

Thank you for the patch! Very nice feature indeed. When I'll find some free time, I'll review it and give you the opportunity to commit it with your nick tagged on. Then I'll make some further corrections/finishments.

comment:4 Changed 14 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Implemented in a different way from changeset r9764.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.