minor change

This commit is contained in:
2025-08-18 20:23:47 +05:30
parent 916117f3a7
commit 113e1f4417
20 changed files with 219 additions and 5 deletions
@@ -0,0 +1,88 @@
{% extends "core/base.html" %}
{% block title %}Register as Citizen{% endblock %}
{% block content %}
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card shadow">
<div class="card-body p-5">
<h2 class="card-title text-center mb-4">Create Citizen Account</h2>
<form method="post">
{% csrf_token %}
{% if form.errors %}
<div class="alert alert-danger">
<strong>Error!</strong> Please correct the following:
<ul>
{% for field, errors in form.errors.items %}
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
{% endfor %}
</ul>
</div>
{% endif %}
<div class="mb-3">
<label for="id_username" class="form-label">Username</label>
{{ form.username }}
<small class="text-muted">Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.</small>
</div>
<div class="mb-3">
<label for="id_email" class="form-label">Email</label>
{{ form.email }}
</div>
<div class="mb-3">
<label for="id_phone" class="form-label">Phone (Optional)</label>
{{ form.phone }}
</div>
<div class="mb-3">
<label for="id_password1" class="form-label">Password</label>
{{ form.password1 }}
<small class="text-muted">
<ul>
<li>Your password can't be too similar to your other personal information.</li>
<li>Your password must contain at least 8 characters.</li>
<li>Your password can't be a commonly used password.</li>
<li>Your password can't be entirely numeric.</li>
</ul>
</small>
</div>
<div class="mb-4">
<label for="id_password2" class="form-label">Password Confirmation</label>
{{ form.password2 }}
<small class="text-muted">Enter the same password as before, for verification.</small>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary btn-lg">Register</button>
</div>
</form>
<hr class="my-4">
<p class="text-center text-muted">
Already have an account? <a href="{% url 'login' %}" class="text-decoration-none">Login here</a>
</p>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
// Add Bootstrap classes to form fields
$(document).ready(function() {
$('input').addClass('form-control');
$('input[type="checkbox"]').removeClass('form-control').addClass('form-check-input');
});
</script>
{% endblock %}