initial
This commit is contained in:
47
templates/add_record.html
Normal file
47
templates/add_record.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!-- templates/add_record.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Add Health Record - Health History Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-8 mx-auto">
|
||||
<div class="main-content">
|
||||
<h2 class="content-header"><i class="fas fa-file-medical"></i> Add New Health Record</h2>
|
||||
|
||||
<form method="POST" action="{{ url_for('add_record') }}">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="illness-name">Illness Name</label>
|
||||
<input type="text" class="form-control" id="illness-name" name="illness_name" placeholder="e.g., Influenza, Migraine..." required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="diagnosis-date">Diagnosis Date</label>
|
||||
<input type="date" class="form-control" id="diagnosis-date" name="diagnosis_date" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="severity">Severity</label>
|
||||
<select class="form-control" id="severity" name="severity" required>
|
||||
<option value="mild">Mild</option>
|
||||
<option value="moderate">Moderate</option>
|
||||
<option value="severe">Severe</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="treatment">Treatment</label>
|
||||
<input type="text" class="form-control" id="treatment" name="treatment" placeholder="Medication, therapy, etc.">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="4" placeholder="Describe symptoms, treatment, and recovery process..."></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Save Record
|
||||
</button>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
428
templates/base.html
Normal file
428
templates/base.html
Normal file
@@ -0,0 +1,428 @@
|
||||
<!-- templates/base.html -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Health History Tracker{% endblock %}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
:root {
|
||||
--primary: #4361ee;
|
||||
--secondary: #3a0ca3;
|
||||
--accent: #f72585;
|
||||
--light: #f8f9fa;
|
||||
--dark: #212529;
|
||||
--success: #4cc9f0;
|
||||
--warning: #f72585;
|
||||
--gray: #6c757d;
|
||||
--light-gray: #e9ecef;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.header {
|
||||
background: linear-gradient(to right, var(--primary), var(--secondary));
|
||||
color: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.logo i {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.logo h1 {
|
||||
font-size: 2.2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.user-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.user-info h3 {
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.user-info p {
|
||||
font-size: 0.9rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--secondary);
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
|
||||
height: fit-content;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.sidebar h2 {
|
||||
margin-bottom: 20px;
|
||||
color: var(--secondary);
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid var(--light-gray);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-links li {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
text-decoration: none;
|
||||
color: var(--dark);
|
||||
padding: 12px 15px;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover, .nav-links a.active {
|
||||
background: var(--light-gray);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.main-content {
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 25px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 2px solid var(--light-gray);
|
||||
}
|
||||
|
||||
.content-header h2 {
|
||||
color: var(--secondary);
|
||||
}
|
||||
|
||||
.stats-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: var(--light);
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.stat-card i {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 15px;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.stat-card h3 {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 5px;
|
||||
color: var(--secondary);
|
||||
}
|
||||
|
||||
.stat-card p {
|
||||
color: var(--gray);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.record-form {
|
||||
background: var(--light);
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
margin-bottom: 20px;
|
||||
color: var(--secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 600;
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea,
|
||||
.form-group select {
|
||||
width: 100%;
|
||||
padding: 12px 15px;
|
||||
border: 1px solid var(--light-gray);
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group textarea:focus,
|
||||
.form-group select:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
|
||||
}
|
||||
|
||||
.records-container {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.records-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.records-list {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.record-item {
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
margin-bottom: 15px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
||||
border-left: 5px solid var(--primary);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.record-item:hover {
|
||||
transform: translateX(5px);
|
||||
}
|
||||
|
||||
.record-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.record-title {
|
||||
font-size: 1.3rem;
|
||||
color: var(--secondary);
|
||||
}
|
||||
|
||||
.record-date {
|
||||
background: var(--light-gray);
|
||||
padding: 5px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.record-details {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.detail-item i {
|
||||
color: var(--primary);
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
.record-description {
|
||||
line-height: 1.6;
|
||||
color: var(--gray);
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.actions button {
|
||||
padding: 8px 15px;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: var(--light-gray);
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffebee;
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
color: var(--gray);
|
||||
}
|
||||
|
||||
.empty-state i {
|
||||
font-size: 4rem;
|
||||
margin-bottom: 20px;
|
||||
color: var(--light-gray);
|
||||
}
|
||||
|
||||
.empty-state h3 {
|
||||
margin-bottom: 15px;
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
.alert {
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
color: var(--gray);
|
||||
font-size: 0.9rem;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.user-section {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<div class="logo">
|
||||
<i class="fas fa-heartbeat"></i>
|
||||
<h1>Health History Tracker</h1>
|
||||
</div>
|
||||
{% if session.user_id %}
|
||||
<div class="user-section">
|
||||
<div class="user-info">
|
||||
<h3>{{ session.username }}</h3>
|
||||
<p>Member since {{ user.created_at.strftime('%b %Y') if user else '' }}</p>
|
||||
</div>
|
||||
<a href="{{ url_for('logout') }}" class="btn btn-outline-light">Logout</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<footer>
|
||||
<p>Health History Tracker © 2023 | All your health records in one place</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Set today's date as default for diagnosis date
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
document.getElementById('diagnosis-date').value = today;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
108
templates/dashboard.html
Normal file
108
templates/dashboard.html
Normal file
@@ -0,0 +1,108 @@
|
||||
<!-- templates/dashboard.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="sidebar">
|
||||
<h2>Navigation</h2>
|
||||
<ul class="nav-links">
|
||||
<li><a href="{{ url_for('dashboard') }}" class="active"><i class="fas fa-home"></i> Dashboard</a></li>
|
||||
<li><a href="{{ url_for('add_record') }}"><i class="fas fa-plus-circle"></i> Add Record</a></li>
|
||||
<li><a href="#"><i class="fas fa-history"></i> History</a></li>
|
||||
<li><a href="#"><i class="fas fa-chart-line"></i> Statistics</a></li>
|
||||
<li><a href="#"><i class="fas fa-cog"></i> Settings</a></li>
|
||||
<li><a href="{{ url_for('logout') }}"><i class="fas fa-sign-out-alt"></i> Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="main-content">
|
||||
<div class="content-header">
|
||||
<h2>Your Health Records</h2>
|
||||
<a href="{{ url_for('add_record') }}" class="btn btn-primary">
|
||||
<i class="fas fa-plus"></i> Add New Record
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="stats-container">
|
||||
<div class="stat-card">
|
||||
<i class="fas fa-heartbeat"></i>
|
||||
<h3>{{ total_records }}</h3>
|
||||
<p>Total Illnesses</p>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<i class="fas fa-calendar-check"></i>
|
||||
<h3>{{ recovered }}</h3>
|
||||
<p>Recovered</p>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<i class="fas fa-clipboard-list"></i>
|
||||
<h3>{{ active }}</h3>
|
||||
<p>Active Conditions</p>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<i class="fas fa-calendar-alt"></i>
|
||||
<h3>2.5y</h3>
|
||||
<p>Average Duration</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if records %}
|
||||
<div class="records-container">
|
||||
<div class="records-header">
|
||||
<h3>Recent Health Records</h3>
|
||||
<div>
|
||||
<button class="btn btn-outline"><i class="fas fa-filter"></i> Filter</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="records-list">
|
||||
{% for record in records %}
|
||||
<li class="record-item">
|
||||
<div class="record-header">
|
||||
<h4 class="record-title">{{ record.illness_name }}</h4>
|
||||
<span class="record-date">{{ record.diagnosis_date.strftime('%b %d, %Y') }}</span>
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<div class="detail-item">
|
||||
<i class="fas fa-heart"></i>
|
||||
<span>Severity: {{ record.severity.title() }}</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<i class="fas fa-pills"></i>
|
||||
<span>Treatment: {{ record.treatment or 'None' }}</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<i class="fas fa-clock"></i>
|
||||
<span>Duration: {{ 'Unknown' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="record-description">{{ record.description[:150] }}{% if record.description|length > 150 %}...{% endif %}</p>
|
||||
<div class="actions">
|
||||
<a href="{{ url_for('edit_record', record_id=record.id) }}" class="btn edit-btn"><i class="fas fa-edit"></i> Edit</a>
|
||||
<form method="POST" action="{{ url_for('delete_record', record_id=record.id) }}" style="display: inline;">
|
||||
<button type="submit" class="btn delete-btn" onclick="return confirm('Are you sure you want to delete this record?')">
|
||||
<i class="fas fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-file-medical"></i>
|
||||
<h3>No Health Records Found</h3>
|
||||
<p>You haven't added any health records yet. Start by adding your first record.</p>
|
||||
<a href="{{ url_for('add_record') }}" class="btn btn-primary mt-3">
|
||||
<i class="fas fa-plus"></i> Add Your First Record
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
47
templates/edit_record.html
Normal file
47
templates/edit_record.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!-- templates/edit_record.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Edit Health Record - Health History Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-8 mx-auto">
|
||||
<div class="main-content">
|
||||
<h2 class="content-header"><i class="fas fa-edit"></i> Edit Health Record</h2>
|
||||
|
||||
<form method="POST" action="{{ url_for('edit_record', record_id=record.id) }}">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="illness-name">Illness Name</label>
|
||||
<input type="text" class="form-control" id="illness-name" name="illness_name" value="{{ record.illness_name }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="diagnosis-date">Diagnosis Date</label>
|
||||
<input type="date" class="form-control" id="diagnosis-date" name="diagnosis_date" value="{{ record.diagnosis_date.strftime('%Y-%m-%d') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="severity">Severity</label>
|
||||
<select class="form-control" id="severity" name="severity" required>
|
||||
<option value="mild" {% if record.severity == 'mild' %}selected{% endif %}>Mild</option>
|
||||
<option value="moderate" {% if record.severity == 'moderate' %}selected{% endif %}>Moderate</option>
|
||||
<option value="severe" {% if record.severity == 'severe' %}selected{% endif %}>Severe</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="treatment">Treatment</label>
|
||||
<input type="text" class="form-control" id="treatment" name="treatment" value="{{ record.treatment or '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="4">{{ record.description }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Update Record
|
||||
</button>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
20
templates/index.html
Normal file
20
templates/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!-- templates/index.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-6 mx-auto text-center">
|
||||
<h2>Welcome to Health History Tracker</h2>
|
||||
<p class="lead">Track and manage your health records with our secure platform.</p>
|
||||
<div class="mt-4">
|
||||
{% if session.user_id %}
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-primary btn-lg me-2">Go to Dashboard</a>
|
||||
<a href="{{ url_for('logout') }}" class="btn btn-outline-secondary btn-lg">Logout</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('login') }}" class="btn btn-primary btn-lg me-2">Login</a>
|
||||
<a href="{{ url_for('register') }}" class="btn btn-outline-primary btn-lg">Register</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
32
templates/login.html
Normal file
32
templates/login.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!-- templates/login.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Login - Health History Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="text-center">Login to Your Account</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ url_for('login') }}">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Login</button>
|
||||
</form>
|
||||
<div class="text-center mt-3">
|
||||
<p>Don't have an account? <a href="{{ url_for('register') }}">Register here</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
36
templates/register.html
Normal file
36
templates/register.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!-- templates/register.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Register - Health History Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="text-center">Create Account</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ url_for('register') }}">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Register</button>
|
||||
</form>
|
||||
<div class="text-center mt-3">
|
||||
<p>Already have an account? <a href="{{ url_for('login') }}">Login here</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user