diff --git a/tests/admin_pages/test_workflow.py b/tests/admin_pages/test_workflow.py index 031384bd0..0a0407658 100644 --- a/tests/admin_pages/test_workflow.py +++ b/tests/admin_pages/test_workflow.py @@ -1863,7 +1863,7 @@ def test_workflows_global_actions_external_workflow_action(pub): resp = resp.forms[0].submit('submit') resp.forms[0]['trigger_id'] = 'action:%s' % trigger.identifier resp = resp.forms[0].submit('submit').follow().follow() - assert 'External workflow (action "Global action" on external)' in resp.text + assert 'External workflow (action "Global action" on external)' in resp.text assert Workflow.get(workflow.id).possible_status[0].items[0].target_mode == 'all' assert Workflow.get(workflow.id).possible_status[0].items[0].target_id is None diff --git a/wcs/admin/workflows.py b/wcs/admin/workflows.py index 94cd0847a..74331b4cc 100644 --- a/wcs/admin/workflows.py +++ b/wcs/admin/workflows.py @@ -514,6 +514,7 @@ class WorkflowStatusPage(Directory): ('schema.svg', 'svg'), 'svg', ] + do_not_call_in_templates = True def __init__(self, workflow, status_id, html_top): self.html_top = html_top @@ -528,82 +529,36 @@ class WorkflowStatusPage(Directory): def _q_index(self): self.html_top('%s - %s' % (_('Workflow'), self.workflow.name)) - r = TemplateIO(html=True) get_response().add_javascript( - ['jquery.js', 'jquery-ui.js', 'biglist.js', 'svg-pan-zoom.js', 'qommon.wysiwyg.js'] + [ + 'jquery.js', + 'jquery-ui.js', + 'biglist.js', + 'svg-pan-zoom.js', + 'qommon.wysiwyg.js', + 'popup.js', + 'jquery.colourpicker.js', + ] + ) + return template.QommonTemplateResponse( + templates=['wcs/backoffice/workflow-status.html'], + context={'view': self, 'workflow': self.workflow, 'status': self.status, 'has_sidebar': True}, + is_django_native=True, ) - r += htmltext('
') - r += _('Use drag and drop with the handles to reorder items.') - r += htmltext('
') - r += htmltext('') - if not self.workflow.is_readonly(): - if hasattr(item, 'fill_admin_form'): - r += command_icon('items/%s/' % item.id, 'edit') - r += command_icon('items/%s/delete' % item.id, 'remove', popup=True) - r += htmltext('
') - r += htmltext('%s ') % _('This status is reachable from the following status:') - r += htmltext(', ').join( - [htmltext('%s') % (x.id, x.name) for x in source_status] - ) - r += htmltext('.
') - r += htmltext('') - r += _( - '''This is the default workflow, you cannot edit it but you can - duplicate it to base your own workflow on it.''' - ) - r += htmltext('
') - elif self.workflow.is_readonly(): - r += htmltext('%s
{% trans "Use drag and drop with the handles to reorder items." %}
++ {% if not workflow.is_readonly %} + {% trans "Edit" %} + {% trans "Delete" %} + {% endif %} +
+{% trans "This status is reachable from the following status:" %} + {% for source in source_statuses %} + {{ source.name }}{% if not forloop.last %}, {% endif %} + {% endfor %} +
+{% trans "Back to workflow main page" %}
+ ++{% blocktrans %} +This is the default workflow, you cannot edit it but you can +duplicate it to base your own workflow on it. +{% endblocktrans %} +
+{% elif workflow.is_readonly %} +{% trans "This workflow is readonly." %}