Add document list item view.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-07-13 17:20:02 -04:00
parent c3d4884d34
commit ff59f34b7f
18 changed files with 420 additions and 126 deletions

View File

@@ -433,11 +433,14 @@ class WorkflowDocumentListView(DocumentListView):
return Document.objects.filter(workflows__workflow=self.workflow)
def get_extra_context(self):
return {
'hide_links': True,
'object': self.workflow,
'title': _('Documents with the workflow: %s') % self.workflow
}
context = super(WorkflowDocumentListView, self).get_extra_context()
context.update(
{
'object': self.workflow,
'title': _('Documents with the workflow: %s') % self.workflow
}
)
return context
class WorkflowStateDocumentListView(DocumentListView):
@@ -446,19 +449,22 @@ class WorkflowStateDocumentListView(DocumentListView):
def get_extra_context(self):
workflow_state = self.get_workflow_state()
return {
'hide_links': True,
'object': workflow_state,
'navigation_object_list': ('object', 'workflow'),
'workflow': WorkflowRuntimeProxy.objects.get(
pk=workflow_state.workflow.pk
),
'title': _(
'Documents in the workflow "%s", state "%s"'
) % (
workflow_state.workflow, workflow_state
)
}
context = super(WorkflowStateDocumentListView, self).get_extra_context()
context.update(
{
'object': workflow_state,
'navigation_object_list': ('object', 'workflow'),
'workflow': WorkflowRuntimeProxy.objects.get(
pk=workflow_state.workflow.pk
),
'title': _(
'Documents in the workflow "%s", state "%s"'
) % (
workflow_state.workflow, workflow_state
)
}
)
return context
def get_workflow_state(self):
workflow_state = get_object_or_404(