Switch to unified view

a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
...
...
61
            self.AttachmentController = DiscussionAttachmentController
61
            self.AttachmentController = DiscussionAttachmentController
62
        self.thread = ThreadsController(self)
62
        self.thread = ThreadsController(self)
63
        if not hasattr(self, 'moderate'):
63
        if not hasattr(self, 'moderate'):
64
            self.moderate = ModerationController(self)
64
            self.moderate = ModerationController(self)
65
65
66
    @expose('jinja:discussion/index.html')
66
    @expose('jinja:allura:templates/discussion/index.html')
67
    def index(self, threads=None, limit=None, page=0, count=0, **kw):
67
    def index(self, threads=None, limit=None, page=0, count=0, **kw):
68
        c.discussion = self.W.discussion
68
        c.discussion = self.W.discussion
69
        if threads is None:
69
        if threads is None:
70
            threads = self.discussion.threads
70
            threads = self.discussion.threads
71
        return dict(discussion=self.discussion, limit=limit, page=page, count=count, threads=threads)
71
        return dict(discussion=self.discussion, limit=limit, page=page, count=count, threads=threads)
...
...
154
    @expose()
154
    @expose()
155
    def _lookup(self, id, *remainder):
155
    def _lookup(self, id, *remainder):
156
        id=unquote(id)
156
        id=unquote(id)
157
        return self.PostController(self._discussion_controller, self.thread, id), remainder
157
        return self.PostController(self._discussion_controller, self.thread, id), remainder
158
158
159
    @expose('jinja:discussion/thread.html')
159
    @expose('jinja:allura:templates/discussion/thread.html')
160
    def index(self, limit=None, page=0, count=0, **kw):
160
    def index(self, limit=None, page=0, count=0, **kw):
161
        c.thread = self.W.thread
161
        c.thread = self.W.thread
162
        c.thread_header = self.W.thread_header
162
        c.thread_header = self.W.thread_header
163
        limit, page, start = g.handle_paging(limit, page)
163
        limit, page, start = g.handle_paging(limit, page)
164
        self.thread.num_views += 1
164
        self.thread.num_views += 1
...
...
259
            redirect(result[0].url())
259
            redirect(result[0].url())
260
        else:
260
        else:
261
            redirect('..')
261
            redirect('..')
262
262
263
    @h.vardec
263
    @h.vardec
264
    @expose('jinja:discussion/post.html')
264
    @expose('jinja:allura:templates/discussion/post.html')
265
    @validate(pass_validator)
265
    @validate(pass_validator)
266
    def index(self, version=None, **kw):
266
    def index(self, version=None, **kw):
267
        c.post = self.W.post
267
        c.post = self.W.post
268
        if request.method == 'POST':
268
        if request.method == 'POST':
269
            require(has_artifact_access('moderate', self.post))
269
            require(has_artifact_access('moderate', self.post))
...
...
387
    @LazyProperty
387
    @LazyProperty
388
    def discussion(self):
388
    def discussion(self):
389
        return self._discussion_controller.discussion
389
        return self._discussion_controller.discussion
390
390
391
    @h.vardec
391
    @h.vardec
392
    @expose('jinja:discussion/moderate.html')
392
    @expose('jinja:allura:templates/discussion/moderate.html')
393
    @validate(pass_validator)
393
    @validate(pass_validator)
394
    def index(self, **kw):
394
    def index(self, **kw):
395
        kw = WidgetConfig.post_filter.validate(kw, None)
395
        kw = WidgetConfig.post_filter.validate(kw, None)
396
        page = kw.pop('page', 0)
396
        page = kw.pop('page', 0)
397
        limit = kw.pop('limit', 50)
397
        limit = kw.pop('limit', 50)