class MetaTypeColumn(GetAttrColumn): grok.name('meta_type') grok.context(IFolderColumnTable) header = _(u'Objekt') attrName = 'meta_type' weight = 2 table(IFolderListingTable)
class CreatorColumn(Column): grok.name('creator') grok.context(IFolderColumnTable) header = _(u"Autor") weight = 99 table(IFolderListingTable) def renderCell(self, item): return ', '.join(IZopeDublinCore(item).creators)
class Status(Column): """ """ grok.name('status') table(Altdaten) grok.context(uvcsite.IProductFolder) header = u"Status" weight = 30 def renderCell(self, item): return item['review_state']
class ModifiedColumn(Column): grok.name('modified') grok.context(interface.Interface) header = u"Freigeben" weight = 100 table(ReviewList) def renderCell(self, item): url = grok.url(self.request, item, name="publish") return "<a href='%s'> Freigeben </a>" % url
class Autor(Column): """ """ grok.name('autor') table(Altdaten) grok.context(uvcsite.IProductFolder) header = u"Erstellt von" weight = 20 def renderCell(self, item): return item['Creator']
class ModifiedColumn(Column): grok.name('modified') grok.context(IFolderColumnTable) header = _(u"Datum") weight = 100 table(IFolderListingTable) def getSortKey(self, item): return item.modtime def renderCell(self, item): return uvcsite.fmtDateTime(item.modtime)
class Title(Column): """ """ grok.name('title') table(Altdaten) grok.context(uvcsite.IProductFolder) header = u"Titel" weight = 10 def renderCell(self, item): url = "%s/@@pdf?id=%s" % (self.table.url(), item['id']) link = '<a href="%s"> %s </a>' % (url, item['title']) return link
class StateColumn(GetAttrColumn): grok.name('state') grok.context(IFolderColumnTable) header = _(u'Status') attrName = 'status' weight = 3 table(IFolderListingTable) def getValue(self, obj): state = IWorkflowState(obj).getState() if state is not None: return titleForState(state) return self.defaultValue
class NamColumn(Column): grok.name('unam') grok.context(IUnfallanzeigenFolder) header = u"Name" weight = 200 table(IFolderListingTable) def renderCell(self, item): if item.prsvor is not None: name = item.prsvor + ' ' + item.prsname else: name = '' return name
class UTagColumn(Column): grok.name('utag') grok.context(IUnfallanzeigenFolder) header = u"Unfalltag" weight = 200 table(IFolderListingTable) def renderCell(self, item): if item.unfdatum is not None: udat = item.unfdatum else: udat = '' return udat
class Datum(Column): """ """ grok.name('datum') table(Altdaten) grok.context(uvcsite.IProductFolder) header = u"Datum" weight = 40 def renderCell(self, item): datumString = item['ModificationDate'] datumFmt = "%Y-%m-%d %H:%M:%S" datum = datetime.datetime.fromtimestamp(time.mktime(time.strptime(datumString, datumFmt))) datum = datum.strftime("%d.%m.%Y %H:%M:%S") return datum
class CheckBox(CheckBoxColumn): grok.name('checkBox') grok.context(IFolderColumnTable) table(IFolderListingTable) weight = 0 cssClasses = {'th': 'checkBox'} header = u"" def renderCell(self, item): state = IWorkflowState(item).getState() if state is not None: state = titleForState(state) if state == "Entwurf": return CheckBoxColumn.renderCell(self, item) return ''
class Link(LinkColumn): grok.name('link') grok.context(IFolderColumnTable) weight = 1 table(IFolderListingTable) header = _(u"Titel") linkName = u"edit" def getLinkURL(self, item): """Setup link url.""" state = IWorkflowState(item).getState() if state is not None: state = titleForState(state) if self.linkName is not None and state == "Entwurf": return '%s/%s' % (absoluteURL(item, self.request), self.linkName) return absoluteURL(item, self.request) def getLinkContent(self, item): return item.title def getSortKey(self, item): return item.title