src/pyams_content/shared/view/interfaces.py
changeset 1238 6c23614804f2
parent 1235 3291493e9680
child 1262 0833a105b06b
--- a/src/pyams_content/shared/view/interfaces.py	Tue Jan 15 09:58:09 2019 +0100
+++ b/src/pyams_content/shared/view/interfaces.py	Wed Jan 16 15:55:23 2019 +0100
@@ -35,12 +35,14 @@
 UPDATE_DATE_ORDER = 'modified_date'
 PUBLICATION_DATE_ORDER = 'publication_date'
 FIRST_PUBLICATION_DATE_ORDER = 'first_publication_date'
+VISIBLE_PUBLICATION_DATE_ORDER = 'visible_publication_date'
 
 VIEW_ORDERS = (
     {'id': CREATION_DATE_ORDER, 'title': _("Published version creation date")},
     {'id': UPDATE_DATE_ORDER, 'title': _("Published version last update date")},
     {'id': PUBLICATION_DATE_ORDER, 'title': _("Current version publication date")},
-    {'id': FIRST_PUBLICATION_DATE_ORDER, 'title': _("First version publication date")}
+    {'id': FIRST_PUBLICATION_DATE_ORDER, 'title': _("Current version first publication date")},
+    {'id': VISIBLE_PUBLICATION_DATE_ORDER, 'title': _("Visible publication date")}
 )
 
 VIEW_ORDER_VOCABULARY = SimpleVocabulary([SimpleTerm(item['id'], title=item['title'])
@@ -52,7 +54,8 @@
     {'id': CREATION_DATE_ORDER, 'title': _("Published version creation date")},
     {'id': UPDATE_DATE_ORDER, 'title': _("Published version last update date")},
     {'id': PUBLICATION_DATE_ORDER, 'title': _("Current version publication date")},
-    {'id': FIRST_PUBLICATION_DATE_ORDER, 'title': _("First version publication date")}
+    {'id': FIRST_PUBLICATION_DATE_ORDER, 'title': _("Current version first publication date")},
+    {'id': VISIBLE_PUBLICATION_DATE_ORDER, 'title': _("Visible publication date")}
 )
 
 USER_VIEW_ORDER_VOCABULARY = SimpleVocabulary([SimpleTerm(item['id'], title=item['title'])
@@ -106,10 +109,12 @@
         """Get data types for given context"""
 
     order_by = Choice(title=_("Order by"),
-                      description=_("Property to use to sort results"),
+                      description=_("Property to use to sort results; publication date can be different from first "
+                                    "publication date for contents which have been retired and re-published with a "
+                                    "different publication date"),
                       vocabulary=VIEW_ORDER_VOCABULARY,
                       required=True,
-                      default=FIRST_PUBLICATION_DATE_ORDER)
+                      default=VISIBLE_PUBLICATION_DATE_ORDER)
 
     reversed_order = Bool(title=_("Reversed order?"),
                           description=_("If 'yes', items order will be reversed"),