<!doctype html>
<html>
    <head>
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="shortcut icon" href="{{ base() }}favicon.ico" type="image/x-icon">
        {{ titleHtml() }}
        <script type="text/javascript">
            var separateur = 'debut-----fin';
            var messageAttention = '{{ 'Non bloquant' | trad }}';
        </script>
        {{ skinCode() }}
        
        {% include '@GlobalApplication/Template/_script.twig' %}
        
        <meta charset="utf-8">
    </head>
    
    <body>
        {# utilisé pour les tooltip boostrap vue qu'on a pas les versions récente, on ne peut pas appliquer de class directement dessus #}
        {# DO NOT MOVE #}
        <div id="div_tooltip"></div>        
        <div id='loader' style='display:none;'>
            <div id='picto_loader'>
            </div>
        </div>
        {{ bandeauOxaproc('bandeauConnexion') }}

		<!-- Modal content -->
       	<div id="myModal" class="modal" tabindex="-1" role="dialog">

  			<div class="modal-dialog" style="width:auto;height:auto;{% if application != 'Mobility' %}min-width:500px{% endif %}" role="document">
				<div id="modal-content" class="modal-content" style="z-index:99999;{% if application != 'Mobility' %}min-width: 600px;{% endif %}">
					<div class="modal-header">
						<span class="modal-close">&times;</span>
						<h3 id="modal-title"></h3>
					</div>
					<div id="modal-body" style="padding: 15px;z-index:99999">
					</div>
				</div>
			</div>
		</div>
    
    	<form id="connectForm" class="clearfix" method="post">
    		
			{{ connexionImage() }}
    	
            <div class="colonneLogIn">
            	<img class="imageUser" src="{{ baseUrl('IconeV2/Misc/User.png') }}"/>	
                <div style="color:var(--error);text-align: center;color : green">{{ 'Veuillez renseigner le code qui vous a été envoyé par email.' | trad }}</div>
                <div id="divErrorMessage" class="zoneError" style="text-align: center">{{messageErreur | raw}}</div>
                <div class="row>">
                    <div class="single" style="margin: 0px 0px 0px 0px !important;">

                            {{ inputAdvance('TEXT',{
                                'titre' : 'Code d\'authentification' | trad,
                                'name' : 'codeAuth',
                                'value' : '',
                                'obligatoire' : true,
                                'option' : "onKeyPress=\"return runScript(event, 'dbleAuthIn');\""
                            }
                            ) }}
                            <input type="hidden" name="token" value="{{token}}"/>


                    </div>

                    <div class="single" style="margin: 0px 0px 0px 0px !important;">
                        <button type="button" id="dbleAuthIn" onclick="ajaxPopupV2('{{path('Connexion.DoubleAuthentification.doubleAuth')}}', 'connectForm');" class="button principal btn-block">{{ 'Valider' | trad }}</button>
                    </div>
                    <div class="div-link">
                        <a class="btn-link" data-toggle="tooltip" data-placement="bottom" href="{{ path('Connexion.Connexion.connexion') }}">{{ 'Revenir à l\'écran de connexion' | trad }}</a>
                    </div>
                </div>
           	</div>
        </form>
    
        <script>$('[name^="ID"]').focus(); var baseUrl ='{{ baseUrl() }}';</script>
        <script type="text/javascript" src="{{ baseUrl('js/menu.js') }}"></script>
        <script type="text/javascript" src="{{ baseUrl('js/parametre.js') }}" id="parametreJS"></script>
        <script type="text/javascript" src="{{ baseUrl('ext/bootstrap-notify-3.1.3/js/bootstrap-notify.min.js') }}"></script>
        <script defer>
            {# $(document).keypress(function(event){
                var keycode = (event.keyCode ? event.keyCode : event.which);    
                if(keycode == '13'){    
                    event.stopPropagation();
                    $('#dbleAuthIn').trigger('click');
                }
            }); 

            $(document).on('keypress',function(e) {
                if(e.which === 13) {
                    $('#dbleAuthIn').get(0).click();
                }
            });
             #}
            function runScript(e, id) {
                if (e.keyCode == 13 || e.which == 13) {
                    $('#'+id).click();
                    return false;
                }
            }

        </script>
        
        <div id="footer" class="container-fluid footer clearfix">
        	<div>
        		{{ piedDePage() }}
            	<a href='https://www.oxalys.com' target='_blank'><img src="{{ baseUrl('IconeV2/Misc/logo-oxalys_50.png') }}" style="width:75px;margin-top:10px" /></a>
           </div>
        </div>
        {% if application == 'Mobility' %}
	<style>
	</style>
{% endif %}


    {% if application == 'Mobility' %}
        <style>
            .container-fluid {
                width: auto !important;
            }
            .modal-dialog{
                width: auto !important;
                /*min-width: none !important;*/
            }
            .modal-content .modal_small{
                width: auto !important;
                /*min-width: none !important;*/
                margin: auto !important;
            }
            .modal_small{
                width: auto !important;
                /*min-width: none !important;*/
            }
        </style>
    {% endif %}

    </body>
</html>