{% from 'utils.html.twig' import ico, imgUpload, switch %}
{% if user and user.id != 1 and session.userOrigin is empty %}
<div class="profile-authentication">
{% if user.authenticationAllow == enum('UserEnum::NO') %}
<section class="authentication-enable">
<div class="info">
<div class="title">
<span>{{ getLanguage('title_authentication', 'profile') }}</span>
<p>{{ getLanguage('subtitle_authentication', 'profile') }}</p>
</div>
<div class="icon">
{{ ico('authentication') }}
</div>
</div>
<p class="tx-centro">
<button class="btn-continuar-peq" data-config-authenticator>
{% include 'svg/check-circle.svg' %} {{ getLanguage('enable_authentication', 'profile') }}
</button>
</p>
</section>
{# MODAL -- CONFIG AUTHENTICATOR #}
{% embed "website/includes/modal.html.twig" with { 'id': 'modal-config-authenticator', 'title': getLanguage('config_authentication', 'profile')} %}
{% block content %}
{% from 'utils.html.twig' import ico %}
<div class="modal-config-authenticator-content">
<div class="digitaliztion">
<p>{{ getLanguage('title_qrcode_authentication', 'profile') }}</p>
<img src="{{ qrCode }}">
<div class="contem-copy wrap js--pass-toggle" data-status="hide">
<span class="ico ico-txt" title="Ocultar senha">{{ ico('eye') }}</span>
<span class="ico ico-pass" title="Revelar senha">{{ ico('eye-off') }}</span>
<span class="ico">{{ ico('authenticator-key') }}</span>
<span id="authentication-secret-key-copy">{{ secretKey }}</span>
<input type="password" id="authentication-secret-key" value="{{ secretKey }}" disabled="disabled">
<span class="ico js--copy-authentication-secret-key" data-copy="#authentication-secret-key-copy">{{ ico('copy') }}</span>
</div>
</div>
<div class="info">
<p>{{ getLanguage('subtitle_qrcode_authentication_one', 'profile') }}</p>
<p>{{ getLanguage('subtitle_qrcode_authentication_two', 'profile') }}</p>
<form id="configAuthentication" action="{{ path('userEnableAuthentication') }}" method="PUT" class="form-geral">
<label for="codeAuthentication">{{ getLanguage('verify_qrcode_authentication', 'profile') }}</label>
<div class="wrap">
<span class="ico">{{ ico('authenticator-code') }}</span>
<span class="cmp">
<input type="hidden" id="secretKey" name="secretKey" value="{{ secretKey }}" >
<input type="code" id="codeAuthentication" name="code" required="required" autofocus="autofocus" maxlength="6" placeholder="X X X X X X">
</span>
<button type="submit" class="btn-continuar-peq">
<span class="ico ico-send">{{ ico('send') }}<i class="loader">{{ ico('loader-wish') }}</i></span>
</button>
</div>
</form>
</div>
</div>
{% endblock %}
{% endembed %}
{% endif %}
{% if user.authenticationAllow == enum('UserEnum::YES') %}
<section class="authentication-disable" action="{{ path('userDisableAuthentication') }}">
<div class="info">
<div class="title">
<span>{{ getLanguage('title_active_authentication', 'profile') }}</span>
</div>
<div class="icon">
{{ ico('cellphone') }}
</div>
</div>
<div class="authenticator-switch">
{% include 'website/controls/switch.html.twig' with {
name: 'authenticationAllow',
customClass: 'check-input-authentication',
checked: (user.authenticationAllow == enum('UserEnum::YES')),
}%}
<label for="authenticationAllow">{{ getLanguage('config_active_authentication', 'profile') }}</label>
</div>
</section>
{% endif %}
</div>
{% endif %}