0001-workflows-move-get_sorted_functions-from-view-to-mod.patch
wcs/admin/workflows.py | ||
---|---|---|
1557 | 1557 |
def graphviz(self): |
1558 | 1558 |
return graphviz(self.workflow, include=True) |
1559 | 1559 | |
1560 |
def get_workflow_roles(self): |
|
1561 |
workflow_roles = list((self.workflow.roles or {}).items()) |
|
1562 |
workflow_roles.sort(key=lambda x: '' if x[0] == '_receiver' else misc.simplify(x[1])) |
|
1563 |
return workflow_roles |
|
1564 | ||
1565 | 1560 |
def _q_index(self): |
1566 | 1561 |
self.html_top(title=_('Workflow - %s') % self.workflow.name) |
1567 | 1562 |
get_response().filter['sidebar'] = self.get_sidebar() |
wcs/templates/wcs/backoffice/workflow.html | ||
---|---|---|
46 | 46 |
{% endif %} |
47 | 47 |
</h3> |
48 | 48 |
<ul id="roles-list" class="biglist"> |
49 |
{% for workflow_role in view.get_workflow_roles %}
|
|
49 |
{% for workflow_role in view.workflow.get_sorted_functions %}
|
|
50 | 50 |
<li class="biglistitem"> |
51 | 51 |
{% if not workflow.is_readonly %} |
52 | 52 |
<a rel="popup" href="functions/{{ workflow_role.0|slice:"1:" }}">{{ workflow_role.1 }}</a> |
wcs/workflows.py | ||
---|---|---|
547 | 547 |
elif self.category_id: |
548 | 548 |
self.category_id = None |
549 | 549 | |
550 |
def get_sorted_functions(self): |
|
551 |
workflow_roles = list((self.roles or {}).items()) |
|
552 |
workflow_roles.sort(key=lambda x: '' if x[0] == '_receiver' else misc.simplify(x[1])) |
|
553 |
return workflow_roles |
|
554 | ||
550 | 555 |
def store(self, comment=None, *args, migration_update=False, **kwargs): |
551 | 556 |
assert not self.is_readonly() |
552 | 557 |
must_update = False |
553 |
- |