<div class="col-12 col-md-6 mt-4">
    <div class="card user-detail-box h-100 mw-100">
        <div class="card-header">
            <h4 class="mb-0">Registrierung</h4>
        </div>
        <div class="card-body">
            <div class="form-group mb-3 ml-3">
                <label class="ml-0" for="after_registration_text">
                    Text nach der Registrierung:
                </label>
                <textarea class="form-control" type="text" id="after_registration_text" rows="3"
                    placeholder="Registrierung abgeschlossen. Bitte überprüfe deine E-Mail und rufe dann die Anmelde-Seite auf.">{{ settings.after_registration_text }}</textarea>
            </div>
            <small class="ml-3 mb-1 d-block w-100"> Upload des Dokumentes (z.B. PDF) im Medienbereich. Der
                Link dorthin wird hier eingetragen und ist auf der Registrierungsseite verfügbar.</small>
            <div class="input-group mb-3">
                <label for="privacy_terms_URL" class="col-sm-6 col-form-label pt-0">URL der Datenschutz-
                    oder Teilnahmebedingungen:</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" id="privacy_terms_URL" data-oldsetting="{{ settings.privacy_terms_URL }}"
                        value="{{ settings.privacy_terms_URL }}" style="width: 100%;" {% if currentDemoAccounts > 0 %} disabled {% endif %}
                        placeholder="https://www.meine-plattform.de/wp-content/uploads/.../Erklärung.pdf">
                    {% if currentDemoAccounts > 0 %}<span class="text-danger">Eine Änderung der Datenschutz- oder Teilnahmebedingungen ist nicht möglich, wenn es aktive Demo-User im System gibt.</span> {% endif %}
                </div>
            </div>
            <div class="input-group mb-3">
                <small class="ml-3 mb-1 d-block w-100">Das mögliche Problem und die Lösung werden in einem
                    Accordion auf der Registrierungsseite angezeigt.</small>
                <label for="register_problem" class="col-sm-6 col-form-label pt-0">Mögliches Problem bei der
                    Registrierung:</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" id="register_problem"
                        value="{{ settings.register_problem }}" style="width: 100%;"
                        placeholder="Mögliches Problem" />
                </div>
            </div>
            <div class="input-group mb-3">
                <label for="register_solution" class="col-sm-6 col-form-label pt-0">Mögliche Lösung des
                    Problems:</label>
                <div class="col-sm-6">
                    <textarea class="form-control" type="text" id="register_solution" value=""
                        style="width: 100%;"
                        placeholder="Lösungsvorschlag. &#10;Keyword adminmail fügt Admin-Mail-Adresse ein.">{{ settings.register_solution }}</textarea>
                </div>
            </div>
            <div class="form-check mb-3 ml-3 d-flex align-items-center">
                <input class="form-check-input" type="checkbox" value="" id="reject_privacy_terms"
                    name="{{settings.reject_privacy_terms}}" {% if
                    1==settings.reject_privacy_terms %}checked{% endif %}>
                <label class="form-check-label ml-2" for="reject_privacy_terms">
                    Widersprechen der Teilnahmebedingungen im Profil ermöglichen
                </label>
            </div>
            <div class="form-check mb-3 ml-3 d-flex align-items-center">
                <input class="form-check-input" type="checkbox" value="" id="disable_language_dropdown"
                    name="{{settings.disable_language_dropdown}}" {% if
                    1==settings.disable_language_dropdown %}checked{% endif %}>
                <label class="form-check-label ml-2" for="disable_language_dropdown">
                    Sprachauswahl auf Anmelde- und Registrierungsseiten ausblenden
                </label>
            </div>
            <div class="form-check mb-5 ml-3 d-flex align-items-center">
                <input class="form-check-input" type="checkbox" value="" id="disable_register_link"
                    name="{{settings.disable_register_link}}" {% if
                    1==settings.disable_register_link %}checked{% endif %}>
                <label class="form-check-label ml-2" for="disable_register_link">
                    Allgemeinen Registrieren-Link auf der Login-Seite ausblenden <br>
                    <small class="text-muted">Die Registrierung mit Direkt-Link eines Freischaltcodes ist immer funktionsfähig.</small>
                </label>
            </div>
            <div class="input-group d-flex align-items-center">
                <label for="open_register_code" class="col-sm-6 col-form-label py-0">Offene Registrierung mit
                    Code:</label>
                <select size="1" id="open_register_code" class="form-control register_code_dropdown">
                    <option data-key="open_register_code" registercodecount="" registercodemax="" value=""
                        {% if settings.open_register_code==registerCode.code %}selected{% endif %}>
                        deaktiviert</option>
                    {% for registerCode in registerCodes %}
                    <option data-key="open_register_code" registercodecount="{{registerCode.countCode}}"
                        registercodemax="{% if registerCode.maxCount == constant('PHP_INT_MAX') %}unbegrenzt{% else %}{{registerCode.maxCount}}{% endif %}" value="{{registerCode.code}}" {% if
                        settings.open_register_code==registerCode.code %}selected{% endif %}>
                        {{registerCode.code}}</option>
                    {% endfor %}
                </select>
                <span
                    class="ml-3 mb-1 d-block w-100 text-right mt-2{% if settings.open_register_code == ''%} d-none{% endif %}">
                    {% for registerCode in registerCodes %}
                    {% if registerCode.code == settings.open_register_code %}
                    ({{registerCode.countCode}}/{% if registerCode.maxCount == constant('PHP_INT_MAX') %}unbegrenzt{% else %}{{registerCode.maxCount}}{% endif %}) Einlösungen <i
                        class="fas fa-exclamation-triangle{% if registerCode.countCode < registerCode.maxCount %} d-none{% endif %}"></i>
                    {% endif %}
                    {% endfor %}
                </span>
            </div>
            <div class="form-check ml-3 mb-3 d-flex align-items-center">
                <input class="form-check-input set_register_link" type="checkbox" value=""
                    id="open_register_main_menu" name="{{settings.open_register_main_menu}}" {% if
                    1==settings.open_register_main_menu %}checked{% endif %} {% if
                    settings.open_register_code is empty and settings.register_redeem_code_manually == 0 %}disabled{% endif %}>
                <label class="form-check-label ml-2" for="open_register_main_menu">
                    Registrierungs-Link im Hauptmenü einblenden
                </label>
            </div>
            <div class="form-check ml-3 d-flex align-items-center">
                <input class="form-check-input set_redeem_code_manually" type="checkbox" value=""
                    id="register_redeem_code_manually" name="{{settings.register_redeem_code_manually}}" {%
                    if 1==settings.register_redeem_code_manually %}checked{% endif %}>
                <label class="form-check-label ml-2" for="register_redeem_code_manually">
                    Manuelle Eingabe von Freischaltcodes bei Registrierung aktivieren
                </label>
            </div>
            <div class="mt-4">
                <h5>Demo-Login</h5>
                <div class="input-group d-flex align-items-center">
                    <label for="demologin_registerkey" class="col-sm-6 col-form-label py-0">Demo-Login mit
                        Code:</label>
                    <select size="1" id="demologin_registerkey" class="form-control register_code_dropdown">
                        <option data-key="demologin_registerkey" registercodecount="" registercodemax="" value=""
                            {% if settings.demologin_registerkey==registerCode.code %}selected{% endif %}>
                            deaktiviert</option>
                        {% for registerCode in registerCodes %}
                        <option data-key="demologin_registerkey" registercodecount="{{registerCode.countCode}}"
                            registercodemax="{% if registerCode.maxCount == constant('PHP_INT_MAX') %}unbegrenzt{% else %}{{registerCode.maxCount}}{% endif %}" value="{{registerCode.code}}" {% if
                            settings.demologin_registerkey==registerCode.code %}selected{% endif %}>
                            {{registerCode.code}}</option>
                        {% endfor %}
                    </select>
                    <span
                        class="ml-3 mb-1 d-block w-100 text-right mt-2{% if settings.demologin_registerkey == ''%} d-none{% endif %}">
                        {% for registerCode in registerCodes %}
                        {% if registerCode.code == settings.demologin_registerkey %}
                        ({{registerCode.countCode}}/{% if registerCode.maxCount == constant('PHP_INT_MAX') %}unbegrenzt{% else %}{{registerCode.maxCount}}{% endif %}) Einlösungen <i
                            class="fas fa-exclamation-triangle{% if registerCode.countCode < registerCode.maxCount %} d-none{% endif %}"></i>
                        {% endif %}
                        {% endfor %}
                    </span>
                </div>
                <div class="input-group mt-3">
                    <label for="demologin_autodelete" class="col-sm-6 col-form-label py-0">Account löschen nach:</label>
                    <div class="col-sm-6 input-group px-0">
                        <input id="demologin_autodelete" type="number" min="1" max="48" step="1" class="form-control" value="{% if settings.demologin_autodelete is empty %}12{% else %}{{ settings.demologin_autodelete}}{% endif %}" {% if settings.demologin_registerkey is empty or settings.demologin_registerkey == 0 %}disabled{% endif %}>
                        <div class="input-group-append"><div class="input-group-text">Stunden</div></div>
                    </div>
                </div>
                <div class="input-group mt-3">
                    <label for="demologin_maxaccounts" class="col-sm-6 col-form-label py-0">Maximale Anzahl an gleichzeitigen Accounts: {% if settings.demologin_registerkey is not empty and currentDemoAccounts >= settings.demologin_maxaccounts %}<i class="fas fa-exclamation-triangle text-danger"></i>{% endif %}</label>
                    <input id="demologin_maxaccounts" type="number" min="1" max="500" step="1" class="form-control" value="{% if settings.demologin_maxaccounts is empty %}1{% else %}{{ settings.demologin_maxaccounts}}{% endif %}" {% if settings.demologin_registerkey is empty or settings.demologin_registerkey == 0 %}disabled{% endif %}>
                    {% if settings.demologin_registerkey is not empty and currentDemoAccounts >= settings.demologin_maxaccounts %}<small class="text-danger col-12">Die Testkapazität ist erschöpft.</small>{% endif %}
                </div>
                <div class="d-flex flex-row mt-3 justify-content-end align-items-center">
                    <p class="py-0 text-muted pr-3 mb-0" style="cursor: default;">Aktuelle Demo-User im System: <span id="backendSettingsDemoUserCount">{{ currentDemoAccounts }}</span></p>
                    <button type="button" class="btn btn-sm btn-danger" id="backendSettingsDeleteDemoUser" {% if settings.demologin_registerkey is empty or settings.demologin_registerkey == 0 %}disabled{% endif %}><i class="fas fa-trash-alt"></i>&nbsp;Alle Demo-User löschen</button>
                    <button type="button" class="ml-0 ml-3 btn btn-sm btn-secondary" id="backendSettingsDemoUserModalToggle" data-toggle="modal" data-target="#backendSettingsDemoUserModal" {% if settings.demologin_registerkey is empty or settings.demologin_registerkey == 0 %}disabled{% endif %}><i class="fas fa-search"></i>&nbsp;Alle Demo-User anzeigen</button>
                    {% include 'login-logout/admin-backend-settings-demouser-modal.html' %}
                </div>
            </div>
        </div>
    </div>
</div>