- models.py: add UniqueConstraint(user_id, date) to flock_history so duplicate flock entries for the same day are rejected at the DB level - main.py: v2.3 migration applies the new unique constraint to existing installs at startup - login.html: update register form minlength and placeholder from 6 to 10 characters to match backend; add specific 429 error message so rate- limited users see "Too many attempts — please wait a minute" instead of a generic failure - auth.js: update settings modal password input minlength from 6 to 10 - summary.js: fix CSV export truncation — pass limit=10000 so users with more than 500 days of data get a complete export; read chart border color from --green CSS variable instead of hardcoded hex - All HTML files: bump JS version params to ?v=4 so browsers discard cached copies of files changed across recent sessions (api.js, auth.js, dashboard.js, history.js, log.js, flock.js, budget.js, summary.js, admin.js) - .env.example: add password strength guidance for MySQL and admin vars Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
87 lines
3.1 KiB
HTML
87 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Flock — Yolkbook</title>
|
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<nav class="nav">
|
|
<a class="nav-brand" href="/">🥚 <span>Yolkbook</span></a>
|
|
<ul class="nav-links">
|
|
<li><a href="/">Dashboard</a></li>
|
|
<li><a href="/log">Log Eggs</a></li>
|
|
<li><a href="/flock">Flock</a></li>
|
|
<li><a href="/budget">Budget</a></li>
|
|
<li><a href="/summary">Summary</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<main class="container">
|
|
<h1>Flock Management</h1>
|
|
|
|
<!-- Current flock callout -->
|
|
<div class="stats-grid" style="grid-template-columns: repeat(auto-fit, minmax(180px, 240px));">
|
|
<div class="stat-card">
|
|
<div class="label">Current Flock Size</div>
|
|
<div class="value" id="current-count">—</div>
|
|
<div class="unit">chickens</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="label">As of</div>
|
|
<div class="value" style="font-size:1.1rem;" id="current-date">—</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Log a change -->
|
|
<div class="card">
|
|
<h2>Log a Flock Change</h2>
|
|
<div id="msg" class="message"></div>
|
|
<form id="flock-form">
|
|
<div class="form-grid">
|
|
<div class="form-group">
|
|
<label for="date">Date of Change</label>
|
|
<input type="date" id="date" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="count">New Total Count</label>
|
|
<input type="number" id="count" min="0" required placeholder="0">
|
|
</div>
|
|
<div class="form-group span-full">
|
|
<label for="notes">Notes (optional)</label>
|
|
<textarea id="notes" placeholder="e.g. Added 3 new hens, lost 1 to predator…"></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Save Change</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Flock history table -->
|
|
<h2>Flock History</h2>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Count</th>
|
|
<th>Notes</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="flock-body">
|
|
<tr class="empty-row"><td colspan="4">Loading…</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</main>
|
|
|
|
<script src="/js/api.js?v=4"></script>
|
|
<script src="/js/auth.js?v=4"></script>
|
|
<script src="/js/flock.js?v=4"></script>
|
|
</body>
|
|
</html>
|