File size: 4,004 Bytes
b4d357b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{% extends "base.html" %}

{% block title %}Reset Password - 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">
                <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="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
                </svg>
            </div>
            <h1 class="text-2xl font-bold text-code-text mb-2">Reset Password</h1>
            <p class="text-code-muted">Enter your new password</p>
        </div>

        <div class="bg-code-surface border border-code-border rounded-xl p-8">
            {% if error %}
                <!-- Error State -->
                <div class="text-center">
                    <div class="w-16 h-16 bg-code-red/20 rounded-full flex items-center justify-center mx-auto mb-6">
                        <svg class="w-8 h-8 text-code-red" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                        </svg>
                    </div>
                    <h2 class="text-xl font-semibold text-code-text mb-2">{{ error }}</h2>
                    <p class="text-code-muted mb-6">{{ message }}</p>
                    <a href="{% url 'auth:forgot_password' %}" class="inline-block py-3 px-6 bg-code-accent hover:bg-code-accent/90 text-white font-semibold rounded-lg transition-colors">
                        Request New Link
                    </a>
                </div>
            {% else %}
                <!-- Reset Form -->
                {% 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_password" class="block text-sm font-medium text-code-muted mb-2">
                            New 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"
                    >
                        Reset Password
                    </button>
                </form>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}