templates/security/login.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% macro checkLocale(locale) %}
  3.     {% set localeName = locale | locale_name(locale) %}
  4.     {% if app.request.locale is same as (locale) %}
  5.         <span class="btn btn-secondary btn-sm mb-3">{{ localeName | u.title }}</span>
  6.     {% else %}
  7.         {% set params = app.request.get('_route_params') %}
  8.         {% set params = params | merge(app.request.query.all) %}
  9.         {% set params = params | merge({'_locale': locale}) %}
  10.         <a class="btn btn-outline-secondary btn-sm mb-3"
  11.            href="{{ path(app.request.get('_route'), params) }}"
  12.            title="{{ localeName | u.title }}"
  13.            data-lang="{{ locale }}"
  14.         >
  15.             <strong>{{ localeName | u.title }}</strong>
  16.         </a>
  17.     {% endif %}
  18. {% endmacro %}
  19. {% block body_class %}login{% endblock %}
  20. {% block header %}
  21.     {#    {{ include('header.html.twig') }}#}
  22. {% endblock %}
  23. {% block body %}
  24.     {% if currentHotel and currentHotel.backgroundMedia %}
  25.         <img src="{{ vich_uploader_asset(currentHotel.backgroundMedia, 'mediaFile')|imagine_filter('main') }}"
  26.              class="img-cover"
  27.              alt="{{ currentHotel.name|e('html_attr') }}" />
  28.     {% endif %}
  29.     <div class="container-fluid h-100">
  30.         <div class="row h-100">
  31.             <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">
  32.                 <div class="card border-0 bg-white-semitrans align-middle">
  33.                     <div class="card-body">
  34.                         {% if currentHotel and currentHotel.logoMedia %}
  35.                             <img src="{{ vich_uploader_asset(currentHotel.logoMedia, 'mediaFile')|imagine_filter('thumbnail') }}"
  36.                                  class="img-fluid"
  37.                                  alt="{{ currentHotel.name|e('html_attr') }}" />
  38.                         {% endif %}
  39.                         <form method="post" autocomplete="off">
  40.                             {% if error %}
  41.                                 <div class="alert alert-danger">{{ error.messageKey | trans(error.messageData, 'security') }}</div>
  42.                             {% endif %}
  43.                             <h1 class="h3 mb-3 font-weight-normal sr-only">{{ 'login.title' | trans }}</h1>
  44.                             <div class="form-group floating-label">
  45.                                 <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>
  46.                                 <label for="inputRoomName">{{ 'room_number' | trans }}</label>
  47.                             </div>
  48.                             <div class="form-group floating-label">
  49.                                 <input type="text" name="name" id="inputName" class="form-control text-center" placeholder="{{ 'login.name_or_surname' | trans }}" required>
  50.                                 <label for="inputName">{{ 'login.name_or_surname' | trans }}</label>
  51.                             </div>
  52.                             <div class="form-group floating-label">
  53.                                 <input type="email" name="email" id="inputEmail" class="form-control text-center" placeholder="{{ 'login.email' | trans }}">
  54.                                 <label for="inputEmail">{{ 'login.email' | trans }}</label>
  55.                             </div>
  56.                             <div class="checkbox mb-3">
  57.                                 <label>
  58.                                     {# set url1 = path('app_...') #}
  59.                                     {% set url1 = 'https://www.guestmax.com/terms-and-conditions/' %}
  60.                                     {% set url2 = 'https://www.guestmax.com/privacy-policy/' %}
  61.                                     {% set url3 = 'https://www.guestmax.com/cookie-policy/' %}
  62.                                     <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>
  63.                                 </label>
  64.                             </div>
  65.                             <div class="checkbox mb-3">
  66.                                 <label>
  67.                                     {% if currentHotel is not null and currentHotel.complex is not null %}
  68.                                         <input style="scale: 1.3" type="checkbox" name="promotions" id="promotions"> <span>{{ 'login.promotions_with_complex' | trans({'%complex%': currentHotel.complex.name}) }}</span>
  69.                                     {% else %}
  70.                                         <input style="scale: 1.3" type="checkbox" name="promotions" id="promotions"> <span>{{ 'login.promotions' | trans }}</span>
  71.                                     {% endif %}
  72.                                 </label>
  73.                             </div>
  74.                             <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
  75.                             <input type="hidden" name="_remember_me" value="on">
  76.                             {#
  77.                             Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
  78.                             See https://symfony.com/doc/current/security/remember_me.html
  79.                             <div class="checkbox mb-3">
  80.                                 <label>
  81.                                     <input type="checkbox" name="_remember_me"> Remember me
  82.                                 </label>
  83.                             </div>
  84.                             #}
  85.                             <button class="btn btn-lg btn-primary btn-block mt-3 mb-5" type="submit">
  86.                                 {{ 'sign_in' | trans }}
  87.                             </button>
  88.                             <div class="locales-wrapper">
  89.                                 {% for locale in locales %}
  90.                                     {{ _self.checkLocale(locale) }}
  91.                                 {% endfor %}
  92.                             </div>
  93.                         </form>
  94.                     </div>
  95.                 </div>
  96.             </div>
  97.         </div>
  98.     </div>
  99. {% endblock %}
  100. {% block footer %}
  101.     {#    {{ include('footer.html.twig') }}#}
  102. {% endblock %}