{% extends 'base.html.twig' %}
{% block title %}Pedidio{% endblock %}
{% block bodyclass %}pedido{% endblock %}
{% block body %}
{% if cabecera.estado == 'EDICION' %}
<div class="alert alert-warning mb-0" role="alert">
<strong>MODO EDICIÓN!</strong> Es importante terminar el proceso completo.
</div>
{% endif %}
<main class="container-fluid bg-dark" {{ stimulus_controller('content-loader') }}>
<div class="row">
<div class="col-6 rounded-end-1 bg-white">
<div class="container p-3">
<div class="row justify-content-center">
<div class="col-5">
<button type="button"
class="btn btn-outline-secondary shadow-sm w-100"
data-action="click->content-loader#loadModal"
data-sucursal="{{ cabecera.sucursal }}"
data-url="{{ path('load_modal', { modalType: 'search' }) }}"
data-modal=".searchModal">
<i class="bi bi-search"></i> Buscar Producto
</button>
</div>
<div class="col-1">
{% if top %}
<button
type="button"
class="btn btn-outline-secondary shadow-sm w-100"
data-bs-toggle="modal"
data-bs-target="#topModal"
>
<i class="bi bi-stars"></i>
</button>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-6 border p-0">
<div class="px-3 py-2 border-bottom border-5 bg-light">
<span class="fs-6 fw-semibold"><strong>Favoritos</strong></span>
</div>
<div class="list-group list-group-flush border-bottom scrollarea" style="height: calc(100vh - 171px);">
{{ include('callcenter/_fav.html.twig', { items: favoritos, sucursal: cabecera.sucursal }) }}
</div>
</div>
<div class="col-6 border border-start-0 p-0">
<div class="px-3 py-2 border-bottom border-5 bg-light">
<span class="fs-6 fw-semibold"><strong>Articulos</strong></span>
</div>
<div data-content-loader-target="articulos"></div>
</div>
</div>
</div>
<div class="col-6 bg-dark position-sticky" id="cabecera" data-cabecera="{{ cabecera.id }}">
{{ include('callcenter/_cabecera.html.twig', { cabecera: cabecera}) }}
<div data-content-loader-target="pedido">{{ include('callcenter/_lineas.html.twig', { cabecera: cabecera}) }}</div>
<div class="d-grid gap-2">
<a href="{{ path('cc_confirmarpedido', { id: cabecera.id }) }}" class="btn btn-success btn-lg">Hacer Pedido</a>
</div>
</div>
</div>
{{ include('callcenter/_modal.html.twig', {
modalTitle: 'Agregar nuevo producto',
}) }}
</main>
{{ include('callcenter/top_modal.html.twig') }}
{% endblock %}