| {% extends "base.html" %} |
|
|
| {% block title %}{% if has_password %}Change{% else %}Set{% endif %} 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"> |
| {% if has_password %}Change Password{% else %}Set Password{% endif %} |
| </h1> |
| <p class="text-code-muted"> |
| {% if has_password %} |
| Update your account password |
| {% else %} |
| Create a password for your account |
| {% endif %} |
| </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_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> |
|
|
| <div class="flex space-x-4 pt-2"> |
| <a href="{% url 'cpanel:settings' %}" class="flex-1 py-3 px-4 bg-code-bg hover:bg-code-bg/80 text-code-text border border-code-border font-medium rounded-lg transition-colors text-center"> |
| Cancel |
| </a> |
| <button type="submit" class="flex-1 py-3 px-4 bg-code-accent hover:bg-code-accent/90 text-white font-semibold rounded-lg transition-colors"> |
| {% if has_password %}Change Password{% else %}Set Password{% endif %} |
| </button> |
| </div> |
| </form> |
| </div> |
| </div> |
| </div> |
| {% endblock %} |
|
|