remove table code that now lives in pfwbged.collection
This commit is contained in:
parent
9d384eba1a
commit
baf7cef249
|
@ -120,43 +120,10 @@ grok.templatedir('templates')
|
|||
grok.context(IDexterityContainer)
|
||||
|
||||
|
||||
class ItemsTable(ResultsTable):
|
||||
def setUpColumns(self):
|
||||
columns = super(ItemsTable, self).setUpColumns()
|
||||
# do not include the delete column, from classifying folders we only
|
||||
# provide an icon for unlink
|
||||
columns = [x for x in columns if x.__name__ != 'dms.delete']
|
||||
return columns
|
||||
|
||||
|
||||
from collective.dms.basecontent.browser import column
|
||||
|
||||
class UnfileColumn(column.IconColumn, column.LinkColumn):
|
||||
grok.name('pfwbged.folder.unfile')
|
||||
grok.adapts(Interface, Interface, ItemsTable)
|
||||
|
||||
header = u''
|
||||
iconName = "++resource++unlink_icon.png"
|
||||
linkContent = _('Unfile')
|
||||
|
||||
def getLinkURL(self, item):
|
||||
for id, child in item.getObject().contentItems():
|
||||
if not ILink.providedBy(child):
|
||||
continue
|
||||
if child.folder.to_object == self.context:
|
||||
return item.getURL() + '/' + id + '/delete_confirmation'
|
||||
return '#'
|
||||
|
||||
|
||||
class ClassifiedItems:
|
||||
|
||||
@property
|
||||
def table(self):
|
||||
table = ItemsTable(self.context, self.request)
|
||||
table.values = self.documents()
|
||||
table.update()
|
||||
return table
|
||||
|
||||
def documents(self):
|
||||
if self.context.id == 'documents' and aq_parent(self.context).portal_type == 'Plone Site':
|
||||
# never return anything in the main documents folder
|
||||
|
|
Reference in New Issue