{% import 'messagesysteme.twig' as msgSyst %}
{% import 'champs.twig' as form %}
<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="Robots" content="noindex" />
		<title>GRR - {{ settings.company }}</title>
		<link rel="shortcut icon" href="favicon.ico" />
		<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.min.css?v={{d.versionCache}}" />
		<link rel="stylesheet" type="text/css" href="./bootstrap/css/jquery-ui.css?v={{d.versionCache}}" />
		<link rel="stylesheet" type="text/css" href="./bootstrap/css/jquery-ui-timepicker-addon.css?v={{d.versionCache}}" >
		<link rel="stylesheet" type="text/css" href="./themes/default/css/style.css?v={{d.versionCache}}" />
		<link rel="stylesheet" type="text/css" href="./{{ d.sheetcss }}?v={{d.versionCache}}" />
		{{ d.sheetcssperso|raw }}
        <link rel="stylesheet" type="text/css" href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" />
        <style>
            html,body {
                height: 100% !important;
            }

            .container {
                display:table;
                height: 100%;
                width: 100%;
                padding: 0;
                box-sizing: border-box;
            }

            .row {
                height: 100%;
                display: table-row;
            }

            .row .no-float {
                display: table-cell;
                float: none;
            }

            .col-md-4 {   
                height: 100%;
               /* background: pink;*/
            }
            .col-md-8 {
                height: 100%;
                /*background: yellow;*/
            }
            .btn-outlined-black {
                background-color: #fff;
                border: 1px solid #1f1e1f;
                color: #1f1e1f;
                padding: 8px 16px;
                line-height: 20px;
            }
            footer{
                position: absolute; bottom: 0;
            }
        </style>
    </head>

    <body>
        <div class="container">
            <div class="row">
                <div class="col-xs-0 col-sm-0 col-md-8" style="background: url('{{d.image_connexion}}') no-repeat; background-size: 100%;">
                    <!-- Image à mettre choisi par l'admin -->
                </div>

                <div class="col-xs-0 col-sm-0 col-md-4">

                    {% if settings.login_logo == "1" and settings.logo != ""  %}
                        <center><img src="{{d.logo}}" alt="logo" style="max-height:150px;"/></center>
                    {% endif %}
                    <h3>{{settings.title_home_page}}</h3>
                    {% if settings.login_nom == 1 %}
                        <h4>{{settings.company}}</h4>
                    {% endif %}
                    <p>{{settings.message_home_page}}</p>

                    {% if settings.disable_login == "yes" %}
                        <br><br><p><span class="avertissement">{{trad.msg_login3}}</span></p>
                    {% endif %}

                    {% if d.messageLogin %}
                        <br><br><p><span class="avertissement">{{d.messageLogin|raw}}</span></p>
                    {% endif %}

                    {{d.hookLienConnexion1|raw}}

                    <!-- Connextion Externe -->
                    {% if settings.sso_statut == "cas_visiteur" or settings.sso_statut == "cas_utilisateur" %}
                        <a class="btn btn-primary" type="submit" name="submit" href="index.php?force_authentification" style="font-variant: small-caps; width: 100%;" /><i class="fa-solid fa-address-card"></i> {{trad.authentification_CAS}}</a>
                    {% elseif settings.sso_statut == "lemon_visiteur" or settings.sso_statut == "lemon_utilisateur" %}
                        <a class="btn btn-primary" type="submit" name="submit" href="index.php" style="font-variant: small-caps; width: 100%;" /><i class="fa-solid fa-address-card"></i> {{trad.authentification_lemon}}</a>
                    {% elseif settings.sso_statut == "lasso_visiteur" or settings.sso_statut == "lasso_utilisateur" %}
                        <a class="btn btn-primary" type="submit" name="submit" href="index.php" style="font-variant: small-caps; width: 100%;" /><i class="fa-solid fa-address-card"></i> {{trad.authentification_lasso}}</a>
                    {% elseif settings.sso_statut == "http_visiteur" or settings.sso_statut == "http_utilisateur" %}
                        <a class="btn btn-primary" type="submit" name="submit" href="index.php" style="font-variant: small-caps; width: 100%;" /><i class="fa-solid fa-address-card"></i> {{trad.authentification_http}}</a>
                    {% endif %}

                    <hr>
                    <!-- Connextion Interne -->
                    <form action="app.php" method="post" style="margin-top: 24px">
                        {% if d.url %}
                            <input type="hidden" name="url" value="{{d.url}}" />
                        {% endif %}

                        <p>{{trad.connect_local}}{{trad.deux_points}}</p>
                        
                        <div class="form-group row row col-sm-12">
                            <div class="col-sm-12 control-label">
                                <input class="form-control" type="text" id="login" name="login" placeholder="{{trad.login}}">
                            </div>
                        </div>
                        <div class="form-group row row col-sm-12">
                            <div class="col-sm-12 control-label">
                                <input class="form-control" type="password" id="password" name="password" placeholder="{{trad.pwd}}">
                            </div>
                        </div>

                        <input class="btn btn-primary" type="submit" name="submit" value="{{trad.connect}}" />

                        {% if settings.fct_crea_cpt == "y" %}
                            <a href="app.php?p=creationcompte" class="btn btn-primary" >{{trad.crea_compte_inscrivez}}</a>
                        {% endif %}
                    </form>
                    <hr>
                    <br>
                    {{ d.liensPerso2|raw }}
                    <p>{{d.contactAdmin|raw}} [<a href="app.php?p=page&page=cgu" target="_blank">{{trad.cgu}}</a>]</p>
                    <footer>
                        <a href="javascript:history.back()">{{trad.previous}}</b></a>
                        <br><br>
                        <p class="small">{{trad.msg_login1|raw}}<a href="{{d.lienGRR}}">{{d.lienGRR}}</a></p>
                    </footer>
                </div>
            </div>
        </div>
    </body>

    <script type="text/javascript" src="js/functions.min.js" ></script>
    <script type="text/javascript">
        document.getElementById('login').focus();
    </script>
</html>