Newer
Older
"""Comment notification hooks
:organization: Logilab
:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"
from cubicweb import RegistryException
from cubicweb.selectors import implements
from cubicweb.sobjects import notification
class CommentAddedView(notification.NotificationView):
"""get notified from new comments"""
id = 'notif_after_add_relation_comments'
msgid_timestamp = False
def subject(self):
root = self.entity(self.row, self.col).root()
return '%s %s %s' % (self.req._('new comment for'),
root.dc_type(),
root.dc_title())
view = self.vreg['views'].select('fullthreadtext', self.req,
rset=self.rset, row=row, col=col)
return view.render(row=row, col=col, w=self.w, **kwargs)