bd48a201bae2e617c7efe5dcfdbd7a73648d9dd5
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
7 import spline
.model
as model
8 import spline
.model
.meta
as meta
10 import spline
.plugins
.forum
.controllers
.forum
11 import spline
.plugins
.forum
.model
13 def add_routes_hook(map, *args
, **kwargs
):
14 """Hook to inject some of our behavior into the routes configuration."""
15 map.connect('/forums', controller
='forum', action
='forums')
16 map.connect('/forums/{forum_id}', controller
='forum', action
='threads')
17 map.connect('/forums/{forum_id}/threads/{thread_id}', controller
='forum', action
='posts')
20 class ForumPlugin(PluginBase
):
21 def controllers(self
):
23 forum
= spline
.plugins
.forum
.controllers
.forum
.ForumController
,
33 def template_dirs(self
):
35 (resource_filename(__name__
, 'templates'), Priority
.NORMAL
)
40 ('routes_mapping', Priority
.NORMAL
, add_routes_hook
),