{% extends 'layout.html.twig' %}
{% macro checkLocale(locale) %}
{% set localeName = locale | locale_name(locale) %}
{% if app.request.locale is same as (locale) %}
<span class="btn btn-secondary btn-sm mb-3">{{ localeName | u.title }}</span>
{% else %}
{% set params = app.request.get('_route_params') %}
{% set params = params | merge(app.request.query.all) %}
{% set params = params | merge({'_locale': locale}) %}
<a class="btn btn-outline-secondary btn-sm mb-3"
href="{{ path(app.request.get('_route'), params) }}"
title="{{ localeName | u.title }}"
data-lang="{{ locale }}"
>
<strong>{{ localeName | u.title }}</strong>
</a>
{% endif %}
{% endmacro %}
{% block body_class %}login{% endblock %}
{% block header %}
{# {{ include('header.html.twig') }}#}
{% endblock %}
{% block body %}
{% if currentHotel and currentHotel.backgroundMedia %}
<img src="{{ vich_uploader_asset(currentHotel.backgroundMedia, 'mediaFile')|imagine_filter('main') }}"
class="img-cover"
alt="{{ currentHotel.name|e('html_attr') }}" />
{% endif %}
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-sm-8 col-md-6 col-lg-4 col-xl-3 mx-auto text-center d-flex justify-content-center align-items-center login-wrapper">
<div class="card border-0 bg-white-semitrans align-middle">
<div class="card-body">
{% if currentHotel and currentHotel.logoMedia %}
<img src="{{ vich_uploader_asset(currentHotel.logoMedia, 'mediaFile')|imagine_filter('thumbnail') }}"
class="img-fluid"
alt="{{ currentHotel.name|e('html_attr') }}" />
{% endif %}
<form method="post" autocomplete="off">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey | trans(error.messageData, 'security') }}</div>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal sr-only">{{ 'login.title' | trans }}</h1>
<div class="form-group floating-label">
<input type="text" value="{{ last_username }}" name="roomName" id="inputRoomName" class="form-control text-center" pattern="[0-9]*" inputmode="numeric" placeholder="{{ 'room_number' | trans }}" required autofocus>
<label for="inputRoomName">{{ 'room_number' | trans }}</label>
</div>
<div class="form-group floating-label">
<input type="text" name="name" id="inputName" class="form-control text-center" placeholder="{{ 'login.name_or_surname' | trans }}" required>
<label for="inputName">{{ 'login.name_or_surname' | trans }}</label>
</div>
<div class="form-group floating-label">
<input type="email" name="email" id="inputEmail" class="form-control text-center" placeholder="{{ 'login.email' | trans }}">
<label for="inputEmail">{{ 'login.email' | trans }}</label>
</div>
<div class="checkbox mb-3">
<label>
{# set url1 = path('app_...') #}
{% set url1 = 'https://www.guestmax.com/terms-and-conditions/' %}
{% set url2 = 'https://www.guestmax.com/privacy-policy/' %}
{% set url3 = 'https://www.guestmax.com/cookie-policy/' %}
<input style="scale: 1.3" type="checkbox" name="accept" id="accept" required> <span>{{ 'login.accept' | trans({'%url1_start%': '<a href="'~url1~'" target="_blank">', '%url1_end%': '</a>', '%url2_start%': '<a href="'~url2~'" target="_blank">', '%url2_end%': '</a>', '%url3_start%': '<a href="'~url3~'" target="_blank">', '%url3_end%': '</a>'}) | raw }}</span>
</label>
</div>
<div class="checkbox mb-3">
<label>
{% if currentHotel is not null and currentHotel.complex is not null %}
<input style="scale: 1.3" type="checkbox" name="promotions" id="promotions"> <span>{{ 'login.promotions_with_complex' | trans({'%complex%': currentHotel.complex.name}) }}</span>
{% else %}
<input style="scale: 1.3" type="checkbox" name="promotions" id="promotions"> <span>{{ 'login.promotions' | trans }}</span>
{% endif %}
</label>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<input type="hidden" name="_remember_me" value="on">
{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
See https://symfony.com/doc/current/security/remember_me.html
<div class="checkbox mb-3">
<label>
<input type="checkbox" name="_remember_me"> Remember me
</label>
</div>
#}
<button class="btn btn-lg btn-primary btn-block mt-3 mb-5" type="submit">
{{ 'sign_in' | trans }}
</button>
<div class="locales-wrapper">
{% for locale in locales %}
{{ _self.checkLocale(locale) }}
{% endfor %}
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block footer %}
{# {{ include('footer.html.twig') }}#}
{% endblock %}