0001-backoffice-add-fullscreen-workflow-schema-page-66624.patch
tests/admin_pages/test_workflow.py | ||
---|---|---|
93 | 93 |
resp = resp.follow() |
94 | 94 |
assert '<svg ' in resp.text |
95 | 95 |
assert '@import ' not in resp.text |
96 |
assert resp.click('Download').content_type == 'image/svg+xml' |
|
97 |
resp_fullscreen = resp.click('Full Screen') |
|
98 |
assert 'data-gadjo="true"' not in resp_fullscreen.text |
|
96 | 99 | |
97 | 100 |
# create a new action |
98 | 101 |
resp = resp.click('new status') |
... | ... | |
101 | 104 |
assert resp.location == 'http://example.net/backoffice/workflows/1/status/1/' |
102 | 105 |
resp = resp.follow() |
103 | 106 |
assert 'Use drag and drop' in resp.text |
107 |
assert resp.click('Download').content_type == 'image/svg+xml' |
|
108 |
resp_fullscreen = resp.click('Full Screen') |
|
109 |
assert 'data-gadjo="true"' not in resp_fullscreen.text |
|
104 | 110 | |
105 | 111 |
# fill action |
106 | 112 |
resp = resp.click('Alert') |
wcs/admin/workflows.py | ||
---|---|---|
614 | 614 |
'endpoint', |
615 | 615 |
'display', |
616 | 616 |
('backoffice-info-text', 'backoffice_info_text'), |
617 |
'fullscreen', |
|
617 | 618 |
('schema.svg', 'svg'), |
618 | 619 |
'svg', |
619 | 620 |
] |
... | ... | |
663 | 664 |
def graphviz(self): |
664 | 665 |
return graphviz(self.workflow, url_prefix='../../', include=True, select='%s' % self.status.id) |
665 | 666 | |
667 |
def fullscreen(self): |
|
668 |
get_response().add_javascript(['jquery.js', 'svg-pan-zoom.js', 'qommon.admin.js']) |
|
669 |
context = { |
|
670 |
'view': self, |
|
671 |
'workflow': self.workflow, |
|
672 |
} |
|
673 |
return template.QommonTemplateResponse( |
|
674 |
templates=['wcs/backoffice/workflow-fullscreen-schema.html'], |
|
675 |
context=context, |
|
676 |
is_django_native=True, |
|
677 |
) |
|
678 | ||
666 | 679 |
def svg(self): |
667 | 680 |
response = get_response() |
668 | 681 |
response.set_content_type('image/svg+xml') |
... | ... | |
1564 | 1577 |
('criticality-levels', 'criticality_levels_dir'), |
1565 | 1578 |
('logged-errors', 'logged_errors_dir'), |
1566 | 1579 |
('history', 'snapshots_dir'), |
1580 |
('fullscreen'), |
|
1567 | 1581 |
] |
1568 | 1582 |
do_not_call_in_templates = True |
1569 | 1583 | |
... | ... | |
1633 | 1647 |
def graphviz(self): |
1634 | 1648 |
return graphviz(self.workflow, include=True) |
1635 | 1649 | |
1650 |
def fullscreen(self): |
|
1651 |
get_response().add_javascript(['jquery.js', 'svg-pan-zoom.js', 'qommon.admin.js']) |
|
1652 |
context = { |
|
1653 |
'view': self, |
|
1654 |
'workflow': self.workflow, |
|
1655 |
} |
|
1656 |
return template.QommonTemplateResponse( |
|
1657 |
templates=['wcs/backoffice/workflow-fullscreen-schema.html'], |
|
1658 |
context=context, |
|
1659 |
is_django_native=True, |
|
1660 |
) |
|
1661 | ||
1636 | 1662 |
def _q_index(self): |
1637 | 1663 |
self.html_top(title=_('Workflow - %s') % self.workflow.name) |
1638 | 1664 |
get_response().filter['sidebar'] = self.get_sidebar() |
wcs/qommon/static/css/dc2/admin.scss | ||
---|---|---|
2455 | 2455 |
padding-left: 10px; |
2456 | 2456 |
padding-right: 10px; |
2457 | 2457 |
} |
2458 | ||
2459 |
#workflow-fullscreen-schema { |
|
2460 |
height: 95vh; |
|
2461 |
width: 100%; |
|
2462 |
} |
wcs/templates/wcs/backoffice/workflow-fullscreen-schema.html | ||
---|---|---|
1 |
{% load i18n gadjo static %}<!DOCTYPE html> |
|
2 |
<html> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8"/> |
|
5 |
<title>{{ workflow.name }}</title> |
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
7 |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
|
8 |
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> |
|
9 |
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/qommon.css?{% version_hash %}"/> |
|
10 |
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/dc2/admin.css?{% version_hash %}"/> |
|
11 |
{{script|safe}} |
|
12 |
</html> |
|
13 |
<body> |
|
14 |
<div id="workflow-fullscreen-schema"> |
|
15 |
{{ view.graphviz|safe }} |
|
16 |
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a></div> |
|
17 |
</div> |
|
18 |
</body> |
|
19 |
</html> |
wcs/templates/wcs/backoffice/workflow-status.html | ||
---|---|---|
65 | 65 | |
66 | 66 |
<div class="bo-block"> |
67 | 67 |
{{ view.graphviz|safe }} |
68 |
<div class="full-screen-link"><a href="schema.svg">{% trans "Full Screen" %}</a></div> |
|
68 |
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> - |
|
69 |
<a href="fullscreen">{% trans "Full Screen" %}</a></div> |
|
69 | 70 |
</div> |
70 | 71 | |
71 | 72 |
{% endblock %} |
wcs/templates/wcs/backoffice/workflow.html | ||
---|---|---|
145 | 145 |
{% if workflow.possible_status %} |
146 | 146 |
<div class="bo-block"> |
147 | 147 |
{{ view.graphviz|safe }} |
148 |
<div class="full-screen-link"><a href="schema.svg">{% trans "Full Screen" %}</a></div> |
|
148 |
<div class="full-screen-link"><a download href="schema.svg">{% trans "Download" %}</a> - |
|
149 |
<a href="fullscreen">{% trans "Full Screen" %}</a></div> |
|
149 | 150 |
</div> |
150 | 151 |
{% endif %} |
151 | 152 | |
152 |
- |