File size: 4,183 Bytes
58fed12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{% extends "base.html" %}

{% block title %}Create Admin Account - PyRunner{% endblock %}

{% block content %}
<div class="min-h-[calc(100vh-12rem)] flex items-center justify-center px-4 py-12">
    <div class="w-full max-w-md">
        <div class="text-center mb-10">
            <div class="w-16 h-16 bg-code-accent/20 rounded-2xl flex items-center justify-center mx-auto mb-6 glow-accent">
                <svg class="w-8 h-8 text-code-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
                </svg>
            </div>
            <h1 class="text-2xl font-bold text-code-text mb-2">Create Admin Account</h1>
            <p class="text-code-muted">Set up your administrator account to get started</p>
        </div>

        <div class="bg-code-surface border border-code-border rounded-xl p-8">
            {% if form.errors %}
                <div class="mb-6 p-4 bg-code-red/10 border border-code-red/30 rounded-lg">
                    {% for error in form.non_field_errors %}
                        <p class="text-sm text-code-red">{{ error }}</p>
                    {% endfor %}
                </div>
            {% endif %}

            <form method="post" class="space-y-5">
                {% csrf_token %}

                <div>
                    <label for="id_email" class="block text-sm font-medium text-code-muted mb-2">
                        Admin Email
                    </label>
                    {{ form.email }}
                    {% if form.email.errors %}
                        <p class="mt-1 text-xs text-code-red">{{ form.email.errors.0 }}</p>
                    {% endif %}
                </div>

                <div>
                    <label for="id_password" class="block text-sm font-medium text-code-muted mb-2">
                        Password
                    </label>
                    {{ form.password }}
                    {% if form.password.help_text %}
                        <p class="mt-1 text-xs text-code-muted">{{ form.password.help_text }}</p>
                    {% endif %}
                    {% if form.password.errors %}
                        <p class="mt-1 text-xs text-code-red">{{ form.password.errors.0 }}</p>
                    {% endif %}
                </div>

                <div>
                    <label for="id_password_confirm" class="block text-sm font-medium text-code-muted mb-2">
                        Confirm Password
                    </label>
                    {{ form.password_confirm }}
                    {% if form.password_confirm.errors %}
                        <p class="mt-1 text-xs text-code-red">{{ form.password_confirm.errors.0 }}</p>
                    {% endif %}
                </div>

                <button
                    type="submit"
                    class="w-full py-3 px-4 bg-code-accent hover:bg-code-accent/90 text-white font-semibold rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-code-accent/50 focus:ring-offset-2 focus:ring-offset-code-surface"
                >
                    Create Admin Account
                </button>
            </form>
        </div>

        <div class="mt-8 p-4 bg-code-surface border border-code-border rounded-lg">
            <div class="flex items-start space-x-3">
                <div class="flex-shrink-0 mt-0.5">
                    <svg class="w-5 h-5 text-code-yellow" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                    </svg>
                </div>
                <div class="text-sm text-code-muted">
                    <p class="font-medium text-code-text mb-1">About the Admin Account</p>
                    <p>This will be the first user with full administrator privileges. You can invite additional users later from the settings panel.</p>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}