Skip to content

Commit

Permalink
More available columns in folder_contents.
Browse files Browse the repository at this point in the history
Add ``Creator``, ``Description``, ``end``, ``start`` and ``location`` to the available columns and context attributes for folder_contents.
Exclude ``Creator`` from the list of ``_unsafe_metadata``.
  • Loading branch information
thet committed Apr 6, 2016
1 parent 115c8db commit 68abf18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Incompatibilities:

New:

- *add item here*
- Add ``Creator``, ``Description``, ``end``, ``start`` and ``location`` to the available columns and context attributes for folder_contents.
Exclude ``Creator`` from the list of ``_unsafe_metadata``.
[thet]

Fixes:

Expand Down
17 changes: 11 additions & 6 deletions plone/app/content/browser/contents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,42 +173,42 @@ def get_columns(self):
# Base set of columns
columns = {
'CreationDate': translate(_('Created on'), context=self.request), # noqa
'Creator': translate(_('Creator'), context=self.request),
'Description': translate(_('Description'), context=self.request),
'EffectiveDate': translate(_('Publication date'), context=self.request), # noqa
'end': translate(_('End Date'), context=self.request),
'exclude_from_nav': translate(_('Excluded from navigation'), context=self.request), # noqa
'ExpirationDate': translate(_('Expiration date'), context=self.request), # noqa
'getObjSize': translate(_('Object Size'), context=self.request), # noqa
'id': translate(_('ID'), context=self.request),
'is_folderish': translate(_('Folder'), context=self.request),
'last_comment_date': translate(_('Last comment date'), context=self.request), # noqa
'location': translate(_('Location'), context=self.request),
'ModificationDate': translate(_('Last modified'), context=self.request), # noqa
'portal_type': translate(_('Type'), context=self.request),
'review_state': translate(_('Review state'), context=self.request), # noqa
'start': translate(_('Start Date'), context=self.request),
'Subject': translate(_('Tags'), context=self.request),
'total_comments': translate(_('Total comments'), context=self.request), # noqa
}
# These columns either have alternatives or are probably not useful
ignored = [
'Creator',
'Date',
'Description',
'Title',
'Type',
'author_name',
'cmf_uid',
'commentators',
'created',
'effective',
'end',
'expires',
'getIcon',
'getId',
'getRemoteUrl',
'in_response_to',
'listCreators',
'location',
'meta_type',
'modified',
'start',
'sync_uid'
]
# Add in extra metadata columns
Expand Down Expand Up @@ -270,22 +270,27 @@ class ContextInfo(BrowserView):

attributes = [
'CreationDate',
'Creator',
'Description',
'EffectiveDate',
'end',
'exclude_from_nav',
'getObjSize',
'getURL',
'id',
'is_folderish',
'last_comment_date',
'location'
'ModificationDate',
'path',
'portal_type',
'review_state',
'start',
'Subject',
'Title',
'total_comments',
'Type',
'UID'
'UID',
]

def __call__(self):
Expand Down
1 change: 0 additions & 1 deletion plone/app/content/browser/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _parseJSON(s):
_unsafe_metadata = [
'author_name',
'commentors',
'Creator',
'listCreators',
]
_safe_callable_metadata = [
Expand Down

0 comments on commit 68abf18

Please sign in to comment.