Skip to content

Commit

Permalink
Watermark placed in center of every page (#11)
Browse files Browse the repository at this point in the history
* Watermark placed in center of every page

* Made size auto and adjusted positioning of watermark

* Using actual pixel values for height and length and tilt change

* Renamed coa
  • Loading branch information
luthando5 authored Apr 26, 2023
1 parent faf1390 commit 3851808
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bika/coa/ajax.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def ajax_save_reports(self):
elif template == "bika.coa:MultiBatch.pt":
csv_report= self.create_batch_csv_reports(samples,coa_num)
csv_reports = [csv_report for i in range(len(pdf_reports))]
if template == "bika.coa:MultiZim.pt":
if template == "bika.coa:MultiSampleTransposed.pt":
csv_report = self.create_zlabs_csv_report(samples,coa_num)
csv_reports = [csv_report for i in range(len(pdf_reports))]
elif is_multi_template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,32 @@
font-size: 9pt;
}

.footerContainer {
position:relative;
width:100%;
height:100px;
}

.bgbehind {
background-image:url(<tal:t replace="python:view.get_toolbar_logo()"/>);
z-index:100;
background-position: center;
background-size: 400px 300px;
background-position: top right;
background-size: 833px 290px;
opacity:0.1 !important;
background-repeat: no-repeat;
position: absolute;
transform: rotate(315deg);
top: -850%;
left: 40%;
transform: rotate(305deg);
width:<tal:t replace="python:'{:.2f}mm'.format(page_width)"/> ;
height:<tal:t replace="python:'{:.2f}mm'.format(page_height)"/>;
margin: -20mm;
padding: -20mm;
}

.report .section-footer #footer-line {
width: 100%;
height: 2mm;
border-top: 1px solid black;
}


<tal:block condition="python:content_width and content_height">
<tal:block condition="python:all([content_width, content_height])"
Expand All @@ -131,8 +136,7 @@
</style>
</tal:css>

<div class="bgbehind">
</div>

<!-- Batch error message start -->
<tal:render condition="python:not view.is_batch_unique(collection)">
<div>
Expand Down Expand Up @@ -422,8 +426,6 @@
<tal:render define="verifier python:view.get_verifier(collection);
publish python:view.get_publisher()">
<h1 i18n:translate="">Signatories</h1>
<div class="bgbehind">
</div>
<div class="row section-signatures no-gutters">
<table class="table table-sm table-condensed ml-1">
<thead>
Expand Down Expand Up @@ -686,9 +688,13 @@
</tal:render>

<!-- DEFAULT FOOTER -->
<!-- If no custom footer then watermark will appear -->
<tal:render condition="python:not footer"
define="laboratory python:view.laboratory;">
<div class="row section-footer no-gutters">
<div class="footerContainer">
<div class="bgbehind"> <!-- An absolute div within a relative div -->
</div>
<!-- Footer Line -->
<div id="footer-line"></div>
<table class="w-100">
Expand All @@ -714,6 +720,7 @@
</td>
</tr>
</table>
</div>
</div>
</tal:render>
</tal:is_batch>
Expand Down

0 comments on commit 3851808

Please sign in to comment.