Skip to content

Commit

Permalink
Allow DateRecurringIndex (start and end-date of events provided by
Browse files Browse the repository at this point in the history
plone.app.contenttypes with plone.app.event) for sorting.
  • Loading branch information
pbauer committed Feb 25, 2014
1 parent ba10131 commit 14106f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Changelog
* Feature: plone.app.contenttypes-compatability for select and tagcloud widgets
[pbauer]

* Allow DateRecurringIndex (start and end-date of events provided by plone.app.contenttypes
with plone.app.event) for sorting.
[pbauer]

6.7 - (2014-01-29)
------------------
* Bug fix: Fix labels in "Current filters" widget
Expand Down
11 changes: 8 additions & 3 deletions eea/facetednavigation/widgets/sorting/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ def criteriaByIndexId(self, indexId):
"""
catalog_tool = getToolByName(self.context, 'portal_catalog')
indexObj = catalog_tool.Indexes[indexId]
# allow DateRecurringIndex that is unknown to atct.
# events in plone.app.contenttypes use it for start and end
if indexObj.meta_type == "DateRecurringIndex":
return ('ATFriendlyDateCriteria',
'ATDateRangeCriterion',
'ATSortCriterion')
results = _criterionRegistry.criteriaByIndex(indexObj.meta_type)
return results

Expand All @@ -107,9 +113,8 @@ def listFields(self):

def listSortFields(self):
"""Return a list of available fields for sorting."""
fields = [ field
for field in self.listFields()
if self.validateAddCriterion(field[0], 'ATSortCriterion') ]
fields = [field for field in self.listFields()
if self.validateAddCriterion(field[0], 'ATSortCriterion')]
return fields

def vocabulary(self, **kwargs):
Expand Down

0 comments on commit 14106f8

Please sign in to comment.