Add better mail printing layout

This commit is contained in:
Ilia Rostovtsev
2021-05-18 23:44:52 +03:00
parent 2a0bf6e4d8
commit 962039e7be
3 changed files with 44 additions and 12 deletions

View File

@@ -251,4 +251,46 @@ br[data-x-br] {
visibility: visible;
opacity: 1;
transition-duration: .5s
}
}
@media print {
body > .header,
body > .header ~ center,
.ui_form ~ a,
.ui_table a[href*=".cgi"],
.ui_form .ui_link,
.ui_form > center,
.ui_form > [name],
.ui_form > .wrapper,
.ui_form > .wrapper ~ .shrinkwrapper,
.ui_table > thead > tr > td:not(:first-child):last-child {
display: none;
}
.ui_table > thead > tr > td > b {
font-size: 1.33em;
}
.ui_table > thead >tr > td {
border-bottom: 2px solid #D9D9D9;
text-align: center;
position: relative;
padding: 10px;
}
body > .header ~ .ui_form[action*=".cgi"]:first-of-type {
margin-top: -50px;
}
pre {
white-space: pre-wrap;
}
a {
word-break: break-word;
}
a[href]:after {
content: none;
}
}

View File

@@ -102,16 +102,6 @@ else {
"&dom=$in{'dom'}");
exit;
}
elsif ($in{'print'}) {
# Show email for printing
&decode_and_sub();
&ui_print_header(undef, &decode_mimewords(
$mail->{'header'}->{'subject'}));
&show_mail_printable($mail, $body, $textbody, $htmlbody);
print "<script>window.print();</script>\n";
&ui_print_footer();
exit;
}
elsif ($in{'mark1'} || $in{'mark2'}) {
# Just mark the message
$mode = $in{'mark1'} ? $in{'mode1'} : $in{'mode2'};

View File

@@ -271,7 +271,7 @@ if (&is_user($in{'user'})) {
print $spacer;
}
print "<input type=submit value=\"$text{'view_print'}\" name=print>";
print "<input type=submit value=\"$text{'view_print'}\" name=print onclick='window.print();return false;'>";
print $spacer;
if (&is_user($in{'user'})) {