Commit b905a85e authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

[views] separate threadview from primary view (closes #2441584)

parent 2b46da8af305
......@@ -11,6 +11,7 @@ from logilab.mtconverter import xml_escape
from cubicweb.selectors import is_instance
from cubicweb.uilib import soup2xhtml
from cubicweb.view import EntityView
from cubicweb.web import uicfg, formwidgets
from cubicweb.web.views import baseviews, primary
......@@ -133,12 +134,11 @@ class EmailPartOutOfContextView(baseviews.OutOfContextView):
entity.reverse_parts[0].view('outofcontext', w=self.w)
class EmailThreadPrimaryView(primary.PrimaryView):
class EmailThreadView(EntityView):
__regid__ = 'emailthread'
__select__ = is_instance('EmailThread')
def cell_call(self, row, col):
entity = self.cw_rset.complete_entity(row, col)
self.w(u'<h1>%s</h1>' % xml_escape(entity.title))
def entity_call(self, entity):
# get top level emails in this thread (ie message which are not a reply
# of a message in this thread)
#
......@@ -161,3 +161,11 @@ class EmailThreadPrimaryView(primary.PrimaryView):
self.w(u'</ul>')
class EmailThreadPrimaryView(primary.PrimaryView):
__select__ = is_instance('EmailThread')
def cell_call(self, row, col):
entity = self.cw_rset.complete_entity(row, col)
self.w(u'<h1>%s</h1>' % xml_escape(entity.title))
entity.view('emailthread', w=self.w)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment