@using CarCareTracker.Helper
@inject IConfigHelper config
@inject ITranslationHelper translator
@{
    var userLanguage = config.GetServerLanguage();
    var openRegistrationEnabled = config.GetServerOpenRegistration();
}
@{
    ViewData["Title"] = "Register";
}
@section Scripts {
    <script src="~/js/login.js?v=@StaticHelper.VersionNumber"></script>
}
<div class="container d-flex align-items-center justify-content-center" style="height:100vh">
    <div>
        <div style="max-width:204px;">
            <img src="@config.GetLogoUrl()" class="lubelogger-logo" />
            <div class="form-group">
                <label for="inputToken">@translator.Translate(userLanguage, "Token")</label>
                @if (openRegistrationEnabled) {
                    <div class="input-group">
                        <input type="text" id="inputToken" class="form-control">
                        <div class="input-group-text">
                            <button type="button" class="btn btn-sm text-secondary password-visible-button" onclick="sendRegistrationToken()"><i class="bi bi-send"></i></button>
                        </div>
                    </div>
                } else {
                    <input type="text" id="inputToken" class="form-control">
                }
            </div>
            <div class="form-group">
                <label for="inputEmail">@translator.Translate(userLanguage, "Email Address")</label>
                <input type="text" id="inputEmail" class="form-control">
            </div>
            <div class="form-group">
                <label for="inputUserName">@translator.Translate(userLanguage, "Username")</label>
                <input type="text" id="inputUserName" class="form-control">
            </div>
            <div class="form-group">
                <label for="inputUserPassword">@translator.Translate(userLanguage, "Password")</label>
                <div class="input-group">
                    <input type="password" id="inputUserPassword" class="form-control" onkeyup="callBackOnEnter(event, performRegistration)">
                    <div class="input-group-text">
                        <button type="button" class="btn btn-sm text-secondary password-visible-button" onclick="togglePasswordVisibility(this)"><i class="bi bi-eye"></i></button>
                    </div>
                </div>
            </div>
            <div class="d-grid">
                <button type="button" class="btn btn-warning mt-2" onclick="performRegistration()"><i class="bi bi-box-arrow-in-right me-2"></i>@translator.Translate(userLanguage, "Register")</button>
            </div>
            <div class="d-grid">
                <a href="/Login/Index" class="btn btn-link mt-2">@translator.Translate(userLanguage, "Back to Login")</a>
            </div>
        </div>
    </div>
</div>