diff --git a/src/recensio/plone/vocabularies/configure.zcml b/src/recensio/plone/vocabularies/configure.zcml index cc6adc1..203a773 100644 --- a/src/recensio/plone/vocabularies/configure.zcml +++ b/src/recensio/plone/vocabularies/configure.zcml @@ -30,4 +30,9 @@ component=".languages.AvailableContentLanguagesFactory" /> + + diff --git a/src/recensio/plone/vocabularies/sort_options.py b/src/recensio/plone/vocabularies/sort_options.py new file mode 100644 index 0000000..fc5f8a2 --- /dev/null +++ b/src/recensio/plone/vocabularies/sort_options.py @@ -0,0 +1,19 @@ +from recensio.plone import _ +from zope.interface import implementer +from zope.schema.interfaces import IVocabularyFactory +from zope.schema.vocabulary import SimpleTerm +from zope.schema.vocabulary import SimpleVocabulary + + +@implementer(IVocabularyFactory) +class SortOptionsVocabulary: + def __call__(self, *args, **kwargs): + options = { + "relevance": _("Relevance"), + "sortable_title": _("Titel/alphabetisch"), + "modified": _("label_modification_date"), + "created": _("label_creation_date", default="Erstellungsdatum"), + } + return SimpleVocabulary( + [SimpleTerm(key, key, value) for key, value in options.items()] + )