3.2 KiB · text History d9ed3b6
{% extends "root.html" %}

{% block inner %}
<div class="hero min-h-screen bg-base-200">
    <div class="hero-content flex-col lg:flex-row-reverse">
        <div class="text-center lg:text-left">
            <h1 class="text-5xl font-bold">Register</h1>
            <p class="py-6">Create your account to access the dank macro stash.</p>
            {% if invite_token %}
            <div class="alert alert-success">
                <i class="fas fa-envelope-open-text"></i>
                <span>You're using an invite link. The token has been pre-filled below.</span>
            </div>
            {% elif registration_open %}
            <div class="alert alert-info">
                <i class="fas fa-info-circle"></i>
                <span>Open registration is enabled. You still need a valid invite token to register.</span>
            </div>
            {% endif %}
        </div>
        <div class="card shrink-0 w-full max-w-sm shadow-2xl bg-base-100">
            <form class="card-body" action="/auth/register" method="post">
                <div class="flex flex-col">
                    <label class="label">Username</label>
                    <input type="text" name="username" placeholder="Choose a username" class="input" required autofocus/>
                </div>
                <div class="flex flex-col">
                    <label class="label">Email</label>
                    <input type="email" name="email" placeholder="your@email.com" class="input" required/>
                </div>
                <div class="flex flex-col">
                    <label class="label">Password</label>
                    <input type="password" name="password" placeholder="Password" class="input" required/>
                </div>
                <div class="flex flex-col">
                    <label class="label">Confirm Password</label>
                    <input type="password" name="confirm_password" placeholder="Confirm Password" class="input" required/>
                </div>
                <div class="flex flex-col">
                    <label class="label">Registration Token</label>
                    <input
                        type="text"
                        name="registration_token"
                        placeholder="Enter your invite token"
                        class="input{% if invite_token %} cursor-not-allowed bg-base-200 border-base-200 text-base-content/40{% endif %}"
                        value="{{ invite_token or '' }}"
                        {% if invite_token %}readonly{% endif %}
                        required
                    />
                </div>
                <div class="flex flex-col mt-6">
                    <button class="btn btn-primary" type="submit">
                        <i class="fas fa-user-plus mr-2"></i>
                        Register
                    </button>
                </div>
                <div class="text-center mt-4">
                    <p class="text-sm">
                        Already have an account?
                        <a href="/login" class="link link-primary">Login here</a>
                    </p>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}