181 lines
5.6 KiB
HTML
181 lines
5.6 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Login - Hospital Management System{% endblock %}
|
|
|
|
{% block css %}
|
|
<style>
|
|
.login-container {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
{#background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);#}
|
|
}
|
|
|
|
.login-card {
|
|
background: white;
|
|
border-radius: 15px;
|
|
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
|
|
overflow: hidden;
|
|
width: 100%;
|
|
max-width: 400px;
|
|
}
|
|
|
|
.login-header {
|
|
background: linear-gradient(135deg, #348ac7 0%, #7474bf 100%);
|
|
color: white;
|
|
padding: 2rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.login-body {
|
|
padding: 2rem;
|
|
}
|
|
|
|
.form-floating {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.btn-login {
|
|
background: linear-gradient(135deg, #348ac7 0%, #7474bf 100%);
|
|
border: none;
|
|
padding: 12px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
}
|
|
|
|
.btn-login:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px rgba(52, 138, 199, 0.4);
|
|
}
|
|
|
|
.forgot-password {
|
|
color: #348ac7;
|
|
text-decoration: none;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.forgot-password:hover {
|
|
color: #7474bf;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="login-container">
|
|
<div class="login-card">
|
|
<div class="login-header">
|
|
<h3 class="mb-0">
|
|
<i class="fas fa-hospital-alt me-2"></i>
|
|
Hospital Management
|
|
</h3>
|
|
<p class="mb-0 mt-2 opacity-75">Sign in to your account</p>
|
|
</div>
|
|
|
|
<div class="login-body">
|
|
{% if messages %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if form.non_field_errors %}
|
|
<div class="alert alert-danger">
|
|
{{ form.non_field_errors }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="post" novalidate>
|
|
{% csrf_token %}
|
|
|
|
<div class="form-floating">
|
|
<input type="text"
|
|
class="form-control {% if form.username.errors %}is-invalid{% endif %}"
|
|
id="id_username"
|
|
name="username"
|
|
placeholder="Username"
|
|
value="{{ form.username.value|default:'' }}"
|
|
required>
|
|
<label for="id_username">
|
|
<i class="fas fa-user me-2"></i>Username
|
|
</label>
|
|
{% if form.username.errors %}
|
|
<div class="invalid-feedback">
|
|
{{ form.username.errors.0 }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="form-floating">
|
|
<input type="password"
|
|
class="form-control {% if form.password.errors %}is-invalid{% endif %}"
|
|
id="id_password"
|
|
name="password"
|
|
placeholder="Password"
|
|
required>
|
|
<label for="id_password">
|
|
<i class="fas fa-lock me-2"></i>Password
|
|
</label>
|
|
{% if form.password.errors %}
|
|
<div class="invalid-feedback">
|
|
{{ form.password.errors.0 }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
|
<label class="form-check-label" for="remember_me">
|
|
Remember me
|
|
</label>
|
|
</div>
|
|
|
|
<div class="d-grid">
|
|
<button type="submit" class="btn btn-primary btn-login">
|
|
<i class="fas fa-sign-in-alt me-2"></i>Sign In
|
|
</button>
|
|
</div>
|
|
|
|
{# <div class="text-center mt-3">#}
|
|
{# <a href="{% url 'accounts:password_reset' %}" class="forgot-password">#}
|
|
{# <i class="fas fa-key me-1"></i>Forgot your password?#}
|
|
{# </a>#}
|
|
{# </div>#}
|
|
|
|
{% if allow_registration %}
|
|
<hr class="my-4">
|
|
<div class="text-center">
|
|
<p class="text-muted mb-2">Don't have an account?</p>
|
|
<a href="{% url 'accounts:register' %}" class="btn btn-outline-primary">
|
|
<i class="fas fa-user-plus me-2"></i>Create Account
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Focus on username field
|
|
document.getElementById('id_username').focus();
|
|
|
|
// Add loading state to form submission
|
|
const form = document.querySelector('form');
|
|
const submitBtn = document.querySelector('button[type="submit"]');
|
|
|
|
form.addEventListener('submit', function() {
|
|
submitBtn.disabled = true;
|
|
submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin me-2"></i>Signing In...';
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|