Switch to unified view

a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
...
...
79
            thread = self.M.Thread.query.find(dict(_id=t['_id'])).first()
79
            thread = self.M.Thread.query.find(dict(_id=t['_id'])).first()
80
            if 'subscription' in t:
80
            if 'subscription' in t:
81
                thread['subscription'] = True
81
                thread['subscription'] = True
82
            else:
82
            else:
83
                thread['subscription'] = False
83
                thread['subscription'] = False
84
            M.session.artifact_orm_session._get().skip_mod_date = True
84
        redirect(request.referer)
85
        redirect(request.referer)
85
86
86
class AppDiscussionController(DiscussionController):
87
class AppDiscussionController(DiscussionController):
87
88
88
    @LazyProperty
89
    @LazyProperty
...
...
133
    def index(self, limit=None, page=0, count=0, **kw):
134
    def index(self, limit=None, page=0, count=0, **kw):
134
        c.thread = self.W.thread
135
        c.thread = self.W.thread
135
        c.thread_header = self.W.thread_header
136
        c.thread_header = self.W.thread_header
136
        limit, page, start = g.handle_paging(limit, page)
137
        limit, page, start = g.handle_paging(limit, page)
137
        self.thread.num_views += 1
138
        self.thread.num_views += 1
139
        M.session.artifact_orm_session._get().skip_mod_date = True # the update to num_views shouldn't affect it
138
        count = self.thread.query_posts(page=page, limit=int(limit)).count()
140
        count = self.thread.query_posts(page=page, limit=int(limit)).count()
139
        return dict(discussion=self.thread.discussion,
141
        return dict(discussion=self.thread.discussion,
140
                    thread=self.thread,
142
                    thread=self.thread,
141
                    page=page,
143
                    page=page,
142
                    count=count,
144
                    count=count,