ldc-lionor/resources/views/fo/documents/recipe.blade.php

187 lines
5.4 KiB
PHP

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
{{ $title }}
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
html,
body {
position: relative;
width: 210mm;
height: 297mm;
margin: 0;
padding: 0;
}
@page {
header: page-header;
footer: page-footer;
}
body {
font-family: $roboto, sans-serif;
font-size: 16px;
}
.edge-wrapper {
font-size: 0.7rem;
font-weight: bold;
}
table {
border-collapse: collapse;
}
h1 {
font-weight: bold;
line-height: 1.2;
font-size: 1.75rem;
text-transform: uppercase;
}
img {
width: 40%;
}
.text-bold {
font-weight: bold;
}
.text-upper {
text-transform: uppercase;
margin-bottom: 1rem;
}
.pb-3 {
padding-bottom: 10mm;
}
.pe-3 {
padding-right: 10mm;
}
.ps-1 {
padding-left: 3mm;
}
.pt-1 {
padding-top: 3mm;
}
.py-1 {
padding-top: 3mm;
padding-bottom: 3mm;
}
</style>
</head>
<body>
<htmlpageheader name="page-header">
<table class="edge-wrapper" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pt-1" width="35%">
<p>{{ config('app.name') }}</p>
</td>
<td class="pt-1" align="center" width="30%">
<img src="{{ resource_path('assets/images/logo.png') }}" style="width: 70px;">
</td>
<td class="ps-1 pt-1" align="right" width="35%">
<p>www.lionor.fr</p>
</td>
</tr>
</table>
<hr>
</htmlpageheader>
<div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top">
<h1>{{ $recipe->name }}</h1><br><br>
<p>{!! clean($recipe->description) !!}</p>
</td>
<td class="py-1" align="center">
<img src="{{ $recipe->picture }}">
</td>
</tr>
<tr>
<td class="pb-3" colspan="2"></td>
</tr>
<tr>
@php
$nbHours = \intval($recipe->preparation_time / 60);
$nbMinutes = $recipe->preparation_time % 60;
@endphp
<td class="pb-3" width="50%" valign="top">
<span class="text-bold text-upper">Portions : </span>
<span>{{ $recipe->portions }} personnes</span><br><br>
<span class="text-bold text-upper">Préparation : </span>
<span>
@if ($nbHours > 0)
{{ $nbHours }}h
@endif
@if ($nbMinutes > 0)
{{ $nbMinutes }}m
@endif
</span>
</td>
@php
$nbHours = \intval($recipe->cooking_time / 60);
$nbMinutes = $recipe->cooking_time % 60;
@endphp
<td class="pb-3" valign="top">
<span class="text-bold text-upper">Difficulté : </span>
<span>{{ \App\Enums\DifficultyEnum::make($recipe->difficulty)->label() }}</span><br><br>
<span class="text-bold text-upper">Cuisson : </span>
<span>
@if ($nbHours > 0)
{{ $nbHours }}h
@endif
@if ($nbMinutes > 0)
{{ $nbMinutes }}m
@endif
</span>
</td>
</tr>
<tr>
<td class="pb-3" colspan="2">
<p class="text-bold text-upper">Ingrédients :</p><br>
<ul>
@foreach (collect($recipe->ingredients) as $ing)
<li>{{ $ing->value }} : {{ $ing->label }}</li>
@endforeach
</ul>
</td>
</tr>
<tr>
<td colspan="2">
<p class="text-bold text-upper">Préparation :</p><br>
<p>{!! clean($recipe->preparation) !!}</p>
</td>
</tr>
</table>
</div>
<htmlpagefooter name="page-footer">
<hr>
<table class="edge-wrapper" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pb-3" valign="top" width="80%">
<p>&Eacute;dité le : {DATE j/m/Y à G:i:s}</p>
</td>
<td class="pb-3" align="right" valign="top" height="100%">
<p>{PAGENO}/{nbpg}</p>
</td>
</tr>
</table>
</htmlpagefooter>
</body>
</html>