Skip to content
Snippets Groups Projects
Commit faac017938d0 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

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

parent 2b46da8af305
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
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,6 +134,7 @@
entity.reverse_parts[0].view('outofcontext', w=self.w)
class EmailThreadPrimaryView(primary.PrimaryView):
class EmailThreadView(EntityView):
__regid__ = 'emailthread'
__select__ = is_instance('EmailThread')
......@@ -137,8 +139,6 @@
__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 @@
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment