07db391a01f52cb1268d4045e9b655853e4bdb6a
1 from pkg_resources
import resource_filename
3 from pylons
import c
, session
5 from spline
.lib
.plugin
import PluginBase
6 from spline
.lib
.plugin
import PluginBase
, PluginLink
, Priority
8 import splinext
.forum
.controllers
.forum
10 def add_routes_hook(map, *args
, **kwargs
):
11 """Hook to inject some of our behavior into the routes configuration."""
12 require_POST
= dict(conditions
=dict(method
=['POST']))
14 map.connect('/forums', controller
='forum', action
='forums')
15 map.connect('/forums/{forum_id}', controller
='forum', action
='threads')
16 map.connect('/forums/{forum_id}/threads/{thread_id}', controller
='forum', action
='posts')
18 map.connect('/forums/{forum_id}/write', controller
='forum', action
='write_thread')
19 map.connect('/forums/{forum_id}/threads/{thread_id}/write', controller
='forum', action
='write')
22 class ForumPlugin(PluginBase
):
23 def controllers(self
):
25 forum
= splinext
.forum
.controllers
.forum
.ForumController
,
30 ('routes_mapping', Priority
.NORMAL
, add_routes_hook
),
33 # frontpage plugin may or may not be installed
35 from splinext
.forum
.frontpage_sources
import ForumSource
37 ('frontpage_updates_forum', Priority
.NORMAL
, ForumSource
))