|Version 70 (modified by Blackhex, 4 years ago) (diff)|
Discussion Forum Plugin
The DiscussionPlugin adds discussion forums to Trac. An arbitrary number of forums can be added, organised to forum groups. Users can create topics in forums and reply to them which together creates discussion threads. Threaded or flat view to topics and its replies is supported. Each forum has a list of moderators who can delete topics, replies, etc. Plugin is administrated directly or via WebAdminPlugin with appropriate rights. Appending new forums and topics either as new replies shows up in timeline. Searching capability in topics and replies is supported too.
To get an idea how the forums look, see BlackTrac discussion.
Download and Source
As many other plugins in this site even this plugin names its branches according to Trac versions. Here is a simple table explaining this convention for DiscussionPlugin:
|Plugin Branch||Trac Branch||Plugin Version|
Main difference between 0.5 and 0.6 version is that 0.6 uses Genshi templates and 0.5 ClearSilver ones.
For general information about Trac plugins installation see TracPlugins. Plugin is configurable from trac.ini file, see TracIni for more on this topic. The following variables controls DiscussionPlugin's behavior:
[discussion] title = Discussion default_display = tree forum_sort = id forum_sort_direction = asc topic_sort = id topic_sort_direction = asc
Option title changes title of main navigation bar button, default_display defines default display mode for message list. Possible values are tree, flat, flat-asc and flat-desc. flat is synonym for flat-desc. forum_sort is column by which will be sorted forum lists. Possible values are: id, group, name, subject, time, moderators, description, topics, replies, lasttopic and lastreply. Topic lists may be sorted with topic_sort option. It has values id, forum, subject, time, author, body, replies and lastreply. Options forum_sort_direction and topic_sort_direction are directions of that sorting. They may be asc and desc. Previous example shows default values for these options.
If you run Trac in environment which needs to enable plugins explicitly put in trac.ini these lines:
[components] # Enable this component for 0.11 branch and 0.10 branch from revision r3518. tracdiscussion.api.DiscussionApi = enabled tracdiscussion.admin.DiscussionWebAdmin = enabled tracdiscussion.core.DiscussionCore = enabled tracdiscussion.init.DiscussionInit = enabled tracdiscussion.search.DiscussionSearch = enabled tracdiscussion.timeline.DiscussionTimeline = enabled tracdiscussion.wiki.DiscussionWiki = enabled tracdiscussion.notification.DiscussionNotifyEmail = enabled
The next step is to upgrade your environment:
# trac-admin <path_to_environment> upgrade
For now sqlite version 3 or PostgreSQL is required as SQL backend for running this plugin.
Discussion plugin defines four permissions. With DISCUSSION_VIEW permission you can view all topics and you can post replies to them with DISCUSSION_APPEND permission. DISCUSSION_MODERATE permission gives you rights to delete replies or topics where are you defined as moderator. DISCUSSION_ADMIN permission gives you administrator rights to create, modify or delete forum groups, forums and topics. You can add these permissions by typing following commands from commandline or you can use WebAdminPlugin to do it for you.
# trac-admin <path_to_environment> permission add <user> DISCUSSION_VIEW # trac-admin <path_to_environment> permission add <user> DISCUSSION_APPEND # trac-admin <path_to_environment> permission add <user> DISCUSSION_MODERATE # trac-admin <path_to_environment> permission add <user> DISCUSSION_ADMIN
There are few wiki macros available:
Displays link to forum with id <id> and text <text>. Second argument is optional.
Displays link to topic with id <id> and text <text>. Second argument is optional.
Displays link to reply with id <id> and text <text>. Second argument is optional.
Displays content of topic with subject <topic_subject>. If no subject given displays content of topic with same subject as name of current wiki page. Currently there is a limitation of post length using this macro because of using GET method of HTML form.
Discuss this on the [forum:5 Trac Development forum]. Useful threads are [topic:23 this one] and [topic:96 this one].
Foreign files can also be attached to topics and then linked in replies. For this purpose you can use general Trac attachment link syntax with disscussion domain and topic resource:
[attachment:discussion:topic/<topic_id>:<filename>] [raw-attachment:discussion:topic/<topic_id>:<filename>] [[Image(discussion:topic/<topic_id>:<filename>)]]
There are also two custom macros doing the same and they simplifies the syntax a bit:
- Better permission system (maybe using 0.11 permissions policies).
- email2trac support.
- Branch 0.9 of plugin is considered as deprecated and not developed anymore.
- Please test if all links and forms redirects page to proper location after request processing in 0.11 branch. If they don't or any error occurs, create a ticket describing error or behavior you expect.
If you have any troubles with plugin's installation or configuration and your problem is generally Trac related, you can ask on #trac channel at Freenode IRC network to get the quickiest answer. If the problem is purely DiscussionPlugin related, you can create a topic at BlackTrac discussion - DiscussionPlugin forum
-  by hasienda on 2014-05-31 23:44:08
DiscussionPlugin: Extend use of new attribute getter api method, refs #11706.
Preventing TypeError in case of invalid ID argument is required for this
use, and doesn't hurt for others anyway.
-  by hasienda on 2014-05-31 23:14:21
DiscussionPlugin: Review wiki macros and syntax provider code, refs #756 and #11706.
This includes a wide range of changes from adding another db access method to
api over moving SQL into model module to correcting resource ID as
required for fine-grained permission support.
-  by hasienda on 2014-05-30 22:32:02
DiscussionPlugin: Hotfix for topic (attachment parent) Trac resource, refs #756 and #11800.
I've been expecting issues when moving on towards unified resources and
resource permissions. This is another hack before being able to associate
attachments with full resource path, not just topic, the current shortcut.
-  by hasienda on 2014-05-24 00:44:45
DiscussionPlugin: Change listeners got incomplete objects, refs #6783 and #8981.
Fixed tag-related change listeners to get discussion item IDs, what caused
KeyErrors before, just raised a couple of other issues. Not all of these
issues are resolved yet. I decided to initially catch listener errors with
logged warnings for improved API method robustness.
Moved time stamp generation nearer to db action and letting _add_item()
return the added item ID obsoleted four api methods at once.
-  by hasienda on 2014-05-23 21:43:39
DiscussionPlugin: Narrow user selection according to granted permissions, refs #756.
You should be able to choose only users with appropriate permissions as
moderators, and the same applies to subscriptions. This is still not 100%
correct, because ultately fine-grained permisions could affect this too.
-  by hasienda on 2014-05-22 22:47:08
DiscussionPlugin: Reorganize search source code, refs #756 and #11706.
In fixing discussion resource links this is a follow-up to .
The remains after moving db access code to model don't justify to keep
search as a separate module. Added search should help preventing further
regressions for this functionality.
-  by hasienda on 2014-05-22 22:27:13
DiscussionPlugin: Complete db access API methods, refs #11706.
A missing import from previous modifications has been spotted on creation of
(101.9 KB) -
added by Blackhex 3 years ago.
Screenshot of discussion listing.
(139.7 KB) -
added by Blackhex 3 years ago.
Screenshot of administration interface.
(144.1 KB) -
added by Blackhex 3 years ago.
Screenshot of message list in a thread.
Download all attachments as: .zip