Merge pull request #4073 from beganovich/v2-1609-fix-modern-design

Design fixes
This commit is contained in:
David Bomba 2020-09-18 07:19:09 +10:00 committed by GitHub
commit db29ad958c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 84 additions and 62 deletions

View File

@ -161,10 +161,11 @@ trait DesignHelpers
public function sharedFooterElements() public function sharedFooterElements()
{ {
return ['element' => 'div', 'properties' => ['style' => 'display: flex; justify-content: space-between; margin-top: 1.5rem; page-break-inside: avoid;'], 'elements' => [ // return ['element' => 'div', 'properties' => ['style' => 'display: flex; justify-content: space-between; margin-top: 1.5rem; page-break-inside: avoid;'], 'elements' => [
['element' => 'img', 'properties' => ['src' => '$contact.signature', 'style' => 'height: 5rem;']], // ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'height: 5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false']],
['element' => 'img', 'properties' => ['src' => '$app_url/images/created-by-invoiceninja-new.png', 'style' => 'height: 5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false']], // ]];
]];
return ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'height: 3rem; position: fixed; bottom: 0; left: 0; padding: 5px; margin: 5px;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']];
} }
public function entityVariableCheck(string $variable): bool public function entityVariableCheck(string $variable): bool

View File

@ -317,6 +317,8 @@ class HtmlEngine
$data['$font-size'] = ['value' => $this->settings->font_size . 'px', 'label' => '']; $data['$font-size'] = ['value' => $this->settings->font_size . 'px', 'label' => ''];
$data['$invoiceninja.whitelabel'] = ['value' => asset('images/created-by-invoiceninja-new.png'), 'label' => ''];
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')]; // $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')]; // $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
// $data['custom_label3'] = ['value' => '', 'label' => ctrans('texts.')]; // $data['custom_label3'] = ['value' => '', 'label' => ctrans('texts.')];

View File

@ -134,7 +134,7 @@
margin-right: 0; margin-right: 0;
} }
} }
#product-table-footer { #product-table-footer {
page-break-inside: avoid; page-break-inside: avoid;
} }

View File

@ -11,9 +11,6 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: '$font-size'; font-size: '$font-size';
}
@page {
margin: 1cm; margin: 1cm;
} }

View File

@ -9,11 +9,6 @@
font-size: '$font-size'; font-size: '$font-size';
} }
@page {
margin-top: 1cm;
margin-bottom: 1cm;
}
p { p {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -24,6 +19,8 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
margin-top: 1cm;
margin-bottom: 1cm;
} }
@media print { @media print {

View File

@ -9,10 +9,6 @@
font-size: '$font-size'; font-size: '$font-size';
} }
@page {
margin: 1cm;
}
p { p {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -22,6 +18,7 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
margin: 1cm;
} }
.company-logo-wrapper { .company-logo-wrapper {
@ -111,7 +108,7 @@
padding-bottom: 1rem; padding-bottom: 1rem;
border-bottom: 4px solid; border-bottom: 4px solid;
} }
#product-table-footer { #product-table-footer {
page-break-inside: avoid; page-break-inside: avoid;
} }
@ -119,7 +116,7 @@
#product-table-footer > * { #product-table-footer > * {
display: grid; display: grid;
grid-template-columns: 3fr 1fr 1fr; grid-template-columns: 3fr 1fr 1fr;
padding-top: .5rem; padding-top: 0.5rem;
padding-left: 1rem; padding-left: 1rem;
gap: 20px; gap: 20px;
} }

View File

@ -9,11 +9,6 @@
font-size: '$font-size'; font-size: '$font-size';
} }
@page {
margin: 1cm;
}
p { p {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -25,11 +20,14 @@
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
@page { margin: 1cm; }
.header-wrapper { .header-wrapper {
display: grid; display: grid;
grid-template-columns: 1.2fr 1.8fr; grid-template-columns: 1.2fr 1.8fr;
gap: 20px; gap: 20px;
} }
.header-wrapper .header-text-label { .header-wrapper .header-text-label {
font-size: 1.1rem; font-size: 1.1rem;
color: #bba238; color: #bba238;
@ -124,7 +122,7 @@
#product-table-footer > * { #product-table-footer > * {
display: grid; display: grid;
grid-template-columns: 3fr 1fr 1fr; grid-template-columns: 3fr 1fr 1fr;
padding-top: .5rem; padding-top: 0.5rem;
padding-left: 1rem; padding-left: 1rem;
gap: 20px; gap: 20px;
} }

View File

@ -29,7 +29,10 @@
display: grid; display: grid;
grid-template-columns: 1.5fr 1fr; grid-template-columns: 1.5fr 1fr;
padding: 1.5rem; padding: 1.5rem;
width: 100%;
height: 160px;
} }
.header-container .company-name { .header-container .company-name {
font-size: 2rem; font-size: 2rem;
} }
@ -97,6 +100,10 @@
margin-top: 1rem; margin-top: 1rem;
background-color: #f46521; background-color: #f46521;
padding: 1rem; padding: 1rem;
height: 160px;
width: 100%;
position: fixed;
bottom: 0;
} }
.footer-content { .footer-content {
@ -152,39 +159,68 @@
padding-top: 0.7rem; padding-top: 0.7rem;
padding-bottom: 0.7rem; padding-bottom: 0.7rem;
} }
table.page-container {
page-break-after: always;
}
thead.page-header {
display: table-header-group;
}
tfoot.page-footer {
display: table-footer-group;
}
</style> </style>
</head> </head>
<div class="header-container" id="header"> <table class="page-container">
<h1 class="company-name">$company.name</h1> <thead class="page-header">
<tr>
<th class="page-header-cell">
<div class="header-container" id="header">
<h1 class="company-name">$company.name</h1>
<table id="entity-details" cellspacing="0"></table>
</div>
</th>
</tr>
</thead>
<tfoot class="page-footer">
<tr>
<td class="page-footer-cell">
<div class="footer-info">
<div style="margin-top: 195px">
<!-- An offset div to space out table from footer -->
</div>
<div class="footer-wrapper" id="footer">
<div class="footer-content">
<div><!-- Placeholder for offset --></div>
<div id="company-details"></div>
<div id="company-address"></div>
</div>
</div>
</div>
</td>
</tr>
</tfoot>
<tbody class="page-content">
<tr>
<td class="page-content-cell" id="body">
<div class="logo-client-wrapper">
<img
class="company-logo"
src="$company.logo"
alt="$company.name logo"
/>
<table id="entity-details" cellspacing="0"></table> <div id="client-details"></div>
</div> </div>
<body id="body"> <div class="table-wrapper">
<div class="logo-client-wrapper"> <table id="product-table" cellspacing="0"></table>
<img </div>
class="company-logo"
src="$company.logo"
alt="$company.name logo"
/>
<div id="client-details"></div> <div id="product-table-footer" cellspacing="0"></div>
</div> </td>
</tr>
<div class="table-wrapper"> </tbody>
<table id="product-table" cellspacing="0"></table> </table>
</div>
<div id="product-table-footer" cellspacing="0"></div>
</body>
<div class="footer-wrapper" id="footer">
<div class="footer-content">
<div><!-- Placeholder for offset --></div>
<div id="company-details"></div>
<div id="company-address"></div>
</div>
</div>
</html> </html>

View File

@ -9,10 +9,6 @@
font-size: '$font-size'; font-size: '$font-size';
} }
@page {
margin: 1cm;
}
p { p {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -23,6 +19,7 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
margin: 1cm;
} }
.header-wrapper { .header-wrapper {

View File

@ -9,10 +9,6 @@
font-size: '$font-size'; font-size: '$font-size';
} }
@page {
margin: 1cm;
}
p { p {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -22,6 +18,7 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
margin: 1cm;
} }
.header-wrapper { .header-wrapper {