--- a/src/pyams_workflow/zmi/versions.py Wed Jul 12 13:58:09 2017 +0200
+++ b/src/pyams_workflow/zmi/versions.py Wed Jul 12 13:58:50 2017 +0200
@@ -80,7 +80,7 @@
@property
def values(self):
- return reversed(IWorkflowState(self.context).history)
+ return IWorkflowState(self.context).history
@adapter_config(name='date', context=(Interface, IPyAMSLayer, WorkflowVersionHistoryTable), provides=IColumn)
@@ -132,41 +132,6 @@
return text_to_html(item.comment or '--')
-@adapter_config(name='transition', context=(Interface, IPyAMSLayer, WorkflowVersionHistoryTable), provides=IColumn)
-class WorkflowVersionHistoryTransitionColumn(I18nColumn, GetAttrColumn):
- """Workflow version history source column"""
-
- _header = _("Transition")
- attrName = 'transition'
- weight = 20
-
- def renderCell(self, item):
- workflow = IWorkflow(self.context)
- if item.transition_id:
- transition = workflow.get_transition_by_id(item.transition_id)
- label = self.request.localizer.translate(transition.user_data.get('history_label', item.transition))
- else:
- label = item.transition
- return label
-
-
-@adapter_config(name='source', context=(Interface, IPyAMSLayer, WorkflowVersionHistoryTable), provides=IColumn)
-class WorkflowVersionHistorySourceColumn(I18nColumn, GetAttrColumn):
- """Workflow version history source column"""
-
- _header = _("Previous state")
- weight = 25
-
- def renderCell(self, item):
- translate = self.request.localizer.translate
- if item.source_version:
- return translate(_("{status} (version {version})")).format(
- version=item.source_version,
- status=item.source_state)
- else:
- return item.source_state or '--'
-
-
@pagelet_config(name='version-history.html', context=IWorkflowVersion, layer=IPyAMSLayer,
permission=VIEW_SYSTEM_PERMISSION)
@implementer(IInnerPage, IAdminView)