Skip to content

Commit c60e606

Browse files
committed
Reporting: avoid page break inside sections, reset style of selected section
1 parent a609a42 commit c60e606

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

Orange/canvas/report/index.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
3-
<title>Orange viewer</title>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+
<meta charset="utf-8" />
5+
<title>Orange Report</title>
56

67
<style>
78
html, body, table {
@@ -51,6 +52,14 @@
5152
div.selected {
5253
background: #ddd;
5354
}
55+
@media print{
56+
div.selected {
57+
background: inherit;
58+
}
59+
::-webkit-input-placeholder {
60+
color: transparent;
61+
}
62+
}
5463

5564
div.content {
5665
margin-left: 15px;
@@ -68,8 +77,8 @@
6877

6978
img {
7079
display: block;
71-
margin-left: auto;
72-
margin-right: auto
80+
margin: auto;
81+
max-height: 20cm;
7382
}
7483

7584
span.legend-square {
@@ -101,6 +110,12 @@
101110
div.selected textarea {
102111
display: block;
103112
}
113+
114+
@media print{
115+
section.section, img {
116+
page-break-inside: avoid;
117+
}
118+
}
104119
</style>
105120

106121

Orange/canvas/report/report.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def get_widget_name_extension(self):
4242
def create_report_html(self):
4343
""" Start a new section in report and call :obj:`send_report` method
4444
to add content."""
45-
self.report_html = get_html_section(self.name)
45+
self.report_html = '<section class="section">'
46+
self.report_html += get_html_section(self.name)
4647
self.report_html += '<div class="content">\n'
4748
self.send_report()
48-
self.report_html += '</div>\n\n'
49+
self.report_html += '</div></section>\n\n'
4950

5051
@staticmethod
5152
def _fix_args(name, items):

0 commit comments

Comments
 (0)