add-links/templates/base.html
Edward Betts 2c197f5c43 Add live search progress, session counter, and fix URLs
- Search candidates client-side with JS, showing "Checking X..." spinner
  instead of leaving user waiting on a blank page
- Fix broken api_valid_hit endpoint (get_diff returns dict, not tuple)
- Remove server-side get_best_hit; article_page now returns candidate list
  immediately and JS iterates via /api/1/valid_hit
- URL now reflects current article via history.replaceState (?title=X),
  Skip navigates to ?after=X to advance past it
- Track saves in session; show count as green badge in navbar
- Add session counter incremented on each successful save

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:24:15 +01:00

39 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="{{ url_for("static", filename="bootstrap5/css/bootstrap.min.css") }}" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='favicon.svg') }}">
<title>{% block title %}{% endblock %} Find Link</title>
{% block style %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4">
<div class="container">
<a class="navbar-brand fw-semibold" href="{{ url_for('index') }}">Find Link</a>
<div class="d-flex align-items-center gap-2">
<form class="d-flex" action="{{ url_for('index') }}">
<input class="form-control form-control-sm me-2" name="q" placeholder="Article title…" style="width:240px">
<button class="btn btn-outline-light btn-sm" type="submit">Go</button>
</form>
{% if g.user %}
<span class="text-light small opacity-75">{{ g.user }}</span>
{% if session.get("saves") %}
<span class="badge bg-success">{{ session["saves"] }} saved</span>
{% endif %}
<a class="btn btn-outline-light btn-sm" href="{{ url_for('oauth_disconnect') }}">Log out</a>
{% else %}
<a class="btn btn-outline-light btn-sm" href="{{ url_for('start_oauth') }}">Log in with Wikipedia</a>
{% endif %}
</div>
</div>
</nav>
{% block content %}{% endblock %}
<script src="{{ url_for("static", filename="bootstrap5/js/bootstrap.bundle.min.js") }}"></script>
{% block script %}{% endblock %}
</body>
</html>