prepare for multiactions

This commit is contained in:
Frédéric Péters 2018-07-11 21:37:36 +02:00
parent 602b06c10e
commit de252eabd5
2 changed files with 18 additions and 1 deletions

View File

@ -168,7 +168,16 @@ class ColourColumn(Column):
cssClasses = {'td': 'colour-column'}
def renderCell(self, item):
return u""
if hasattr(item, 'path_string'):
path = item.path_string
else:
path = item.getPath()
if item.portal_type in ('opinion', 'validation'):
return u''
return u"""<label><input type="checkbox" data-value="%s"></label>""" % path
def renderHeadCell(self):
return u"""<span class="colour-column-head"></span>"""
class DeleteColumn(IconColumn, LinkColumn):

View File

@ -100,5 +100,13 @@ class Table(z3c.table.table.Table):
if state_value:
cssClass += ' row-state-%s' % state_value
from pfwbged.collection.searchview import TaskTypeColumn
type_column = [x for x in row if isinstance(x[1], TaskTypeColumn)]
if type_column:
type_column = type_column[0]
type_value = get_value(type_column[0], 'portal_type')
if type_value:
cssClass += ' row-type-%s' % type_value
cssClass = self.getCSSClass('tr', cssClass)
return u'\n <tr%s>%s\n </tr>' % (cssClass, u''.join(cells))