snipe-it/resources/views/hardware/labels.blade.php

180 lines
5.5 KiB
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<!doctype html>
<html lang="en">
<head>
2020-05-26 17:10:45 -07:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Labels</title>
2016-03-25 01:18:05 -07:00
</head>
<body>
2020-05-26 17:10:45 -07:00
<?php
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
// 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 - 0.1;
2020-05-26 17:10:45 -07:00
?>
<style>
body {
font-family: arial, helvetica, sans-serif;
width: {{ $settings->labels_pagewidth }}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;
font-size: {{ $settings->labels_fontsize }}pt;
2016-03-25 01:18:05 -07:00
}
2020-05-26 17:10:45 -07:00
.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-flex;
padding-right: .15in;
}
img.qr_img {
width: 120.79%;
height: 120.79%;
2020-05-26 17:10:45 -07:00
margin-top: -6.9%;
margin-left: -6.9%;
padding-bottom: .04in;
}
img.barcode {
display:block;
padding-top: .11in;
width: 100%;
}
div.label-logo {
float: right;
display: inline-block;
}
img.label-logo {
height: 0.5in;
}
2020-05-26 17:10:45 -07:00
.qr_text {
width: {{ $settings->labels_width }}in;
height: {{ $settings->labels_height }}in;
2020-05-26 17:10:45 -07:00
padding-top: {{$settings->labels_display_bgutter}}in;
font-family: arial, helvetica, sans-serif;
font-size: {{$settings->labels_fontsize}}pt;
padding-right: .0001in;
2020-05-26 17:10:45 -07:00
overflow: hidden !important;
display: inline;
word-wrap: break-word;
word-break: break-all;
}
div.barcode_container {
width: 100%;
display: inline;
overflow: hidden;
}
2016-03-25 01:18:05 -07:00
.next-padding {
2020-05-26 17:10:45 -07:00
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
2016-03-25 01:18:05 -07:00
}
2020-05-26 17:10:45 -07:00
@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;
}
2016-03-25 01:18:05 -07:00
}
2020-05-26 17:10:45 -07:00
@media screen {
.label {
outline: .02in black solid; /* outline doesn't occupy space like border does */
}
.noprint {
font-size: 13px;
padding-bottom: 15px;
}
2016-03-25 01:18:05 -07:00
}
2020-05-26 17:10:45 -07:00
@if ($snipeSettings->custom_css)
{{ $snipeSettings->show_custom_css() }}
@endif
</style>
2016-03-25 01:18:05 -07:00
@foreach ($assets as $asset)
2020-05-26 17:10:45 -07:00
<?php $count++; ?>
<div class="label">
2016-03-25 01:18:05 -07:00
2020-05-26 17:10:45 -07:00
@if ($settings->qr_code=='1')
<div class="qr_img">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="qr_img">
2020-05-26 17:10:45 -07:00
</div>
@endif
2020-05-26 17:10:45 -07:00
<div class="qr_text">
@if ($settings->label_logo)
<div class="label-logo">
<img class="label-logo" src="{{ Storage::disk('public')->url('').e($snipeSettings->label_logo) }}">
</div>
@endif
2020-05-26 17:10:45 -07:00
@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
2016-03-25 01:18:05 -07:00
2016-05-19 19:12:42 -07:00
</div>
2020-05-26 17:10:45 -07:00
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))
<div class="barcode_container">
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/barcode" class="barcode">
2020-05-26 17:10:45 -07:00
</div>
@endif
2016-05-19 19:12:42 -07:00
2016-03-25 01:18:05 -07:00
2020-05-26 17:10:45 -07:00
</div>
2016-03-25 01:18:05 -07:00
2020-05-26 17:10:45 -07:00
@if ($count % $settings->labels_per_page == 0)
<div class="page-break"></div>
<div class="next-padding">&nbsp;</div>
@endif
2016-03-25 01:18:05 -07:00
@endforeach
</body>
</html>