Label_Woes

This commit is contained in:
Godfrey M 2020-05-26 17:10:45 -07:00
parent 001e721530
commit ed23505054

View file

@ -1,175 +1,181 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Labels</title> <title>Labels</title>
</head> </head>
<body> <body>
<?php <?php
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter; $settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter; $settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
// Leave space on bottom for 1D barcode if necessary // Leave space on bottom for 1D barcode if necessary
$qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - .3; $qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - .3;
// Leave space on left for QR code if necessary // Leave space on left for QR code if necessary
$qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width); $qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width);
?> ?>
<style> <style>
body { body {
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
width: {{ $settings->labels_pagewidth }}in; width: {{ $settings->labels_pagewidth }}in;
height: {{ $settings->labels_pageheight }}in; height: {{ $settings->labels_pageheight }}in;
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in; margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
font-size: {{ $settings->labels_fontsize }}pt; font-size: {{ $settings->labels_fontsize }}pt;
}
.label {
width: {{ $settings->labels_width }}in;
height: {{ $settings->labels_height }}in;
padding: 0in;
margin-right: {{ $settings->labels_display_sgutter }}in; /* the gutter */
margin-bottom: {{ $settings->labels_display_bgutter }}in;
display: inline-block;
overflow: hidden;
}
.page-break {
page-break-after:always;
}
div.qr_img {
width: {{ $qr_size }}in;
height: {{ $qr_size }}in;
float: left;
display: inline-block;
padding-right: .04in;
}
img.qr_img {
width: 100%;
height: 100%;
}
img.barcode {
display: block;
margin-left: auto;
margin-right: auto;
}
.qr_text {
width: {{ $qr_txt_size }}in;
height: {{ $qr_size }}in;
padding-top: .10in;
font-family: arial, helvetica, sans-serif;
padding-right: .01in;
overflow: hidden !important;
display: inline-block;
word-wrap: break-word;
word-break: break-all;
}
div.barcode_container {
float: left;
width: 100%;
display: inline;
height: 50px;
}
.next-padding {
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
}
@media print {
.noprint {
display: none !important;
} }
.next-padding {
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
font-size: 0;
}
}
@media screen {
.label { .label {
outline: .02in black solid; /* outline doesn't occupy space like border does */ width: {{ $settings->labels_width }}in;
height: {{ $settings->labels_height }}in;
padding: 0in;
margin-right: {{ $settings->labels_display_sgutter }}in; /* the gutter */
margin-bottom: {{ $settings->labels_display_bgutter }}in;
display: inline-block;
overflow: hidden;
} }
.noprint {
font-size: 13px; .page-break {
padding-bottom: 15px; page-break-after:always;
} }
}
@if ($snipeSettings->custom_css) div.qr_img {
{{ $snipeSettings->show_custom_css() }} width: {{ $qr_size }}in;
@endif height: {{ $qr_size }}in;
</style> float: left;
display: inline-flex;
padding-right: .15in;
}
img.qr_img {
@foreach ($assets as $asset) width: 130.79%;
<?php $count++; ?> height: 130.79%;
<div class="label"> margin-top: -6.9%;
margin-left: -6.9%;
padding-bottom: .04in;
}
img.barcode {
display:block;
@if ($settings->qr_code=='1') padding-top: .11in;
<div class="qr_img"> width: 100%;
<img src="./{{ $asset->id }}/qr_code" class="qr_img"> }
</div>
@endif
<div class="qr_text"> .qr_text {
@if ($settings->qr_text!='') width: 100%;
<div class="pull-left"> height: auto;
<strong>{{ $settings->qr_text }}</strong> padding-top: {{$settings->labels_display_bgutter}}in;
<br> font-family: arial, helvetica, sans-serif;
</div> padding-right: .01in;
@endif overflow: hidden !important;
@if (($settings->labels_display_company_name=='1') && ($asset->company)) display: inline;
<div class="pull-left"> word-wrap: break-word;
C: {{ $asset->company->name }} word-break: break-all;
</div> }
@endif
@if (($settings->labels_display_name=='1') && ($asset->name!=''))
<div class="pull-left">
N: {{ $asset->name }}
</div>
@endif
@if (($settings->labels_display_tag=='1') && ($asset->asset_tag!=''))
<div class="pull-left">
T: {{ $asset->asset_tag }}
</div>
@endif
@if (($settings->labels_display_serial=='1') && ($asset->serial!=''))
<div class="pull-left">
S: {{ $asset->serial }}
</div>
@endif
@if (($settings->labels_display_model=='1') && ($asset->model->name!=''))
<div class="pull-left">
M: {{ $asset->model->name }} {{ $asset->model->model_number }}
</div>
@endif
</div> div.barcode_container {
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!='')) width: 100%;
<div class="barcode_container"> display: inline;
<img src="./{{ $asset->id }}/barcode" class="barcode"> overflow: hidden;
</div> }
.next-padding {
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
}
@media print {
.noprint {
display: none !important;
}
.next-padding {
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
font-size: 0;
}
}
@media screen {
.label {
outline: .02in black solid; /* outline doesn't occupy space like border does */
}
.noprint {
font-size: 13px;
padding-bottom: 15px;
}
}
@if ($snipeSettings->custom_css)
{{ $snipeSettings->show_custom_css() }}
@endif @endif
</style>
@foreach ($assets as $asset)
<?php $count++; ?>
<div class="label">
@if ($settings->qr_code=='1')
<div class="qr_img">
<img src="./{{ $asset->id }}/qr_code" class="qr_img">
</div>
@endif
<div class="qr_text">
@if ($settings->qr_text!='')
<div class="pull-left">
<strong>{{ $settings->qr_text }}</strong>
<br>
</div>
@endif
@if (($settings->labels_display_company_name=='1') && ($asset->company))
<div class="pull-left">
C: {{ $asset->company->name }}
</div>
@endif
@if (($settings->labels_display_name=='1') && ($asset->name!=''))
<div class="pull-left">
N: {{ $asset->name }}
</div>
@endif
@if (($settings->labels_display_tag=='1') && ($asset->asset_tag!=''))
<div class="pull-left">
T: {{ $asset->asset_tag }}
</div>
@endif
@if (($settings->labels_display_serial=='1') && ($asset->serial!=''))
<div class="pull-left">
S: {{ $asset->serial }}
</div>
@endif
@if (($settings->labels_display_model=='1') && ($asset->model->name!=''))
<div class="pull-left">
M: {{ $asset->model->name }} {{ $asset->model->model_number }}
</div>
@endif
</div>
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))
<div class="barcode_container">
<img src="./{{ $asset->id }}/barcode" class="barcode">
</div>
@endif
</div>
@if ($count % $settings->labels_per_page == 0) </div>
<div class="page-break"></div>
<div class="next-padding">&nbsp;</div> @if ($count % $settings->labels_per_page == 0)
@endif <div class="page-break"></div>
<div class="next-padding">&nbsp;</div>
@endif
@endforeach @endforeach
</body> </body>
</html> </html>