Fix print styles

This commit is contained in:
Eric Lippmann 2015-12-10 12:05:48 +01:00
parent f83d4488ab
commit b193ea5d32
15 changed files with 59 additions and 30 deletions

View File

@ -41,13 +41,12 @@ $innerLayoutScript = $this->layout()->innerLayout . '.phtml';
}());
</script>
<?php endif ?>
<link rel="stylesheet" href="<?= $this->href($cssfile) ?>" media="screen" type="text/css" />
<link rel="stylesheet" href="<?= $this->href($cssfile) ?>" media="all" type="text/css" />
<!-- Respond.js IE8 support of media queries -->
<!--[if lt IE 9]>
<script src="<?= $this->baseUrl('js/vendor/respond.min.js');?>"></script>
<![endif]-->
<link type="image/png" rel="shortcut icon" href="<?= $this->baseUrl('img/favicon.png') ?>" />
</head>
<body id="body">
<pre id="responsive-debug"></pre>

View File

@ -4,7 +4,7 @@ use Icinga\Data\Extensible;
use Icinga\Data\Reducible;
if (! $this->compact): ?>
<div class="controls separated dont-print">
<div class="controls separated">
<?= $tabs; ?>
<div class="grid">
<?= $this->sortBox ?>

View File

@ -23,7 +23,7 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
}
?>
<div class="controls separated dont-print">
<div class="controls separated">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>

View File

@ -4,7 +4,7 @@ use Icinga\Data\Extensible;
use Icinga\Data\Reducible;
if (! $this->compact): ?>
<div class="controls separated dont-print">
<div class="controls separated">
<?= $tabs ?>
<div class="grid">
<?= $this->sortBox ?>

View File

@ -22,7 +22,7 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
}
?>
<div class="controls separated dont-print">
<div class="controls separated">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>

View File

@ -53,7 +53,8 @@ class StyleSheet
'css/icinga/dev.less',
// 'css/icinga/logo.less',
'css/icinga/spinner.less',
'css/icinga/compat.less'
'css/icinga/compat.less',
'css/icinga/print.less'
);
/**

View File

@ -703,7 +703,7 @@ class FilterEditor extends AbstractWidget
public function renderSearch()
{
$html = ' <form method="post" class="search inline dontprint" action="'
$html = ' <form method="post" class="search inline" action="'
. $this->preservedUrl()
. '"><input type="text" name="q" style="width: 8em" class="search" value="" placeholder="'
. t('Search...')

View File

@ -1,7 +1,7 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<div style="float: right;" class="dontprint">
<div style="float: right;" class="dont-print">
<?= $intervalBox; ?>
</div>
<?= $this->limiter; ?>

View File

@ -1,5 +1,5 @@
<?php if (! $this->compact): ?>
<div class="controls separated dont-print">
<div class="controls separated">
<?= $tabs ?>
<?= $this->render('list/components/selectioninfo.phtml') ?>
<div class="grid">

View File

@ -7,7 +7,7 @@ if (! $stats instanceof stdClass) {
$stats = $stats->fetchRow();
}
?>
<div class="hosts-summary">
<div class="hosts-summary dont-print">
<span class="hosts-link"><?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that

View File

@ -7,7 +7,7 @@ if (! $stats instanceof stdClass) {
$stats = $stats->fetchRow();
}
?>
<div class="services-summary">
<div class="services-summary dont-print">
<span class="services-link"><?= $this->qlink(
sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total),

View File

@ -3,7 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
if (! $this->compact): ?>
<div class="controls separated dont-print">
<div class="controls separated">
<?= $tabs ?>
<?= $this->render('list/components/selectioninfo.phtml') ?>
<div class="grid">

View File

@ -148,9 +148,3 @@ td, th {
font-size: @font-size;
line-height: @line-height;
}
@media print {
.dont-print {
display: none;
}
}

View File

@ -0,0 +1,31 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
// Print styles
@media print {
#fileupload-frame-target,
#header,
#responsive-debug,
#sidebar,
.controls > .tabs,
.controls .filter,
.controls .limiter-control,
.controls .pagination-control,
.controls .selection-info,
.controls .sort-control,
.dontprint, // Compat only, use dont-print instead
.dont-print {
display: none;
}
#layout,
#main,
.controls {
position: static;
}
.container {
float: none !important;
width: 100% !important;
}
}

View File

@ -1,6 +1,11 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
.controls form, .controls .pagination, .controls .widgetLimiter, .controls > .tabs, .dontprint {
.controls form,
.controls .pagination,
.controls .widgetLimiter,
.controls > .tabs,
.dontprint, // Compat only, use dont-print instead
.dont-print {
display: none !important;
}
@ -10,7 +15,7 @@ table.action img.inlinepie {
}
@page {
margin: 2cm;
margin: 2cm;
}
.container * {
@ -26,15 +31,15 @@ body > h1 {
font-weight: bold;
position: fixed;
left: 1em;
right: 1em;
color: #aaa;
font-size: 0.9em;
right: 1em;
color: #aaa;
font-size: 0.9em;
}
#page-header table, #page-footer table {
width: 100%;
border-collapse: collapse;
border: none;
width: 100%;
border-collapse: collapse;
border: none;
}
#page-header table {
@ -45,12 +50,12 @@ body > h1 {
font-family: fixed;
padding: 0;
color: #aaa;
width: 50%;
width: 50%;
}
#page-header {
top: 0.5em;
border-bottom: 0.2pt solid #aaa;
border-bottom: 0.2pt solid #aaa;
}
#page-footer {
@ -93,4 +98,3 @@ h1 form {
body {
margin: 1cm 1cm 1.5cm 1cm;
}