|
a/Allura/allura/controllers/discuss.py |
|
b/Allura/allura/controllers/discuss.py |
|
... |
|
... |
36 |
from allura.lib.security import require, has_access, require_access
|
36 |
from allura.lib.security import require, has_access, require_access
|
37 |
from allura.lib.helpers import DateTimeConverter
|
37 |
from allura.lib.helpers import DateTimeConverter
|
38 |
|
38 |
|
39 |
from allura.lib.widgets import discuss as DW
|
39 |
from allura.lib.widgets import discuss as DW
|
40 |
from .attachments import AttachmentsController, AttachmentController
|
40 |
from .attachments import AttachmentsController, AttachmentController
|
41 |
from .feed import Feed, FeedController
|
41 |
from .feed import FeedArgs, FeedController
|
42 |
|
42 |
|
43 |
log = logging.getLogger(__name__)
|
43 |
log = logging.getLogger(__name__)
|
44 |
|
44 |
|
45 |
class pass_validator(object):
|
45 |
class pass_validator(object):
|
46 |
def validate(self, v, s):
|
46 |
def validate(self, v, s):
|
|
... |
|
... |
104 |
thread['subscription'] = False
|
104 |
thread['subscription'] = False
|
105 |
M.session.artifact_orm_session._get().skip_mod_date = True
|
105 |
M.session.artifact_orm_session._get().skip_mod_date = True
|
106 |
redirect(request.referer)
|
106 |
redirect(request.referer)
|
107 |
|
107 |
|
108 |
def get_feed(self, project, app, user):
|
108 |
def get_feed(self, project, app, user):
|
109 |
"""Return a :class:`allura.controllers.feed.Feed` object describing
|
109 |
"""Return a :class:`allura.controllers.feed.FeedArgs` object describing
|
110 |
the xml feed for this controller.
|
110 |
the xml feed for this controller.
|
111 |
|
111 |
|
112 |
Overrides :meth:`allura.controllers.feed.FeedController.get_feed`.
|
112 |
Overrides :meth:`allura.controllers.feed.FeedController.get_feed`.
|
113 |
|
113 |
|
114 |
"""
|
114 |
"""
|
115 |
return Feed(
|
115 |
return FeedArgs(
|
116 |
dict(ref_id={'$in': [t.index_id() for t in self.discussion.threads]}),
|
116 |
dict(ref_id={'$in': [t.index_id() for t in self.discussion.threads]}),
|
117 |
'Recent posts to %s' % self.discussion.name,
|
117 |
'Recent posts to %s' % self.discussion.name,
|
118 |
self.discussion.url())
|
118 |
self.discussion.url())
|
119 |
|
119 |
|
120 |
|
120 |
|
|
... |
|
... |
222 |
self.thread.spam()
|
222 |
self.thread.spam()
|
223 |
flash('Thread flagged as spam.')
|
223 |
flash('Thread flagged as spam.')
|
224 |
redirect(self.discussion.url())
|
224 |
redirect(self.discussion.url())
|
225 |
|
225 |
|
226 |
def get_feed(self, project, app, user):
|
226 |
def get_feed(self, project, app, user):
|
227 |
"""Return a :class:`allura.controllers.feed.Feed` object describing
|
227 |
"""Return a :class:`allura.controllers.feed.FeedArgs` object describing
|
228 |
the xml feed for this controller.
|
228 |
the xml feed for this controller.
|
229 |
|
229 |
|
230 |
Overrides :meth:`allura.controllers.feed.FeedController.get_feed`.
|
230 |
Overrides :meth:`allura.controllers.feed.FeedController.get_feed`.
|
231 |
|
231 |
|
232 |
"""
|
232 |
"""
|
233 |
return Feed(
|
233 |
return FeedArgs(
|
234 |
dict(ref_id=self.thread.index_id()),
|
234 |
dict(ref_id=self.thread.index_id()),
|
235 |
'Recent posts to %s' % (self.thread.subject or '(no subject)'),
|
235 |
'Recent posts to %s' % (self.thread.subject or '(no subject)'),
|
236 |
self.thread.url())
|
236 |
self.thread.url())
|
237 |
|
237 |
|
238 |
|
238 |
|