Files
jobboard/app/templates/base.html
T
WolfandClaude Fable 5.1 a9290a6926 Roles is newsdesk's feed: rail, feed and reader, with read state and tags
The Roles tab takes newsdesk's shell, ported from its index.html and
app.css rather than rewritten: a filter rail (Show read, Best first or
Newest first, first seen, tag chips with counts, the old filters behind a
disclosure), the feed in newsdesk's row layout (score gutter, title,
company, place, badges, age, tags, the summary as excerpt, judge buttons)
and the reader as a third column that replaces the list on a phone. The
router pushes /roles/{uid}, which the server also renders with the reader
open, so the separate read page and role.js go. j/k, u/n/d, S, Enter,
Escape, o, /, f and c work as in newsdesk. The phone rules come with their
comments.

Two things the row lacked: roles.read_at, stamped when the reader opens a
role or a vote is cast, behind include_read on /api/roles; and role_tags,
written by summarise alongside the summary and served with counts by
/api/filters, filtered in SQL before LIMIT. Migration 5.

PyCharm run configurations in .run/ for serve, pull, seed and pytest.
core.autocrlf=input is set locally so a Windows-side checkout commits LF.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 12:37:45 +02:00

74 lines
4.3 KiB
HTML

{# The frame every page is in. The top bar is `TABS` from app/web/pages.py
plus the cog, and the cog's sub-tabs are `SETTINGS` there: adding a page is
one entry in one of those lists, never a link here.
Three blocks let a page go past the default frame, which only the Roles
page does: `body_attrs` for attributes on `<body>`, `header_tools` for
controls between the brand and the tabs (its burger and search box), and
`page` to replace the centred `<main>` with a layout of its own (its rail,
feed and reader). A page setting `active_path` lights the tab for that path
rather than its own, which is how `/roles/{uid}` keeps Roles lit. #}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>{% block title %}roledesk{% endblock %}</title>
{# Kept on the home screen rather than in a tab, as newsdesk is: `display:
standalone` in the manifest drops the browser's chrome, which is worth a
row of roles on a phone. `manifest.json` and not `.webmanifest`, because
StaticFiles guesses the content type from the extension and not every
machine knows the second one. Two `theme-color`s so the status bar is the
colour of the header right under it. No service worker: the app is no use
without the server. #}
<link rel="manifest" href="/static/manifest.json">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="icon" href="/static/icon-192.png" type="image/png" sizes="192x192">
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#1b2126" media="(prefers-color-scheme: dark)">
<meta name="mobile-web-app-capable" content="yes">
{# iOS reads neither the manifest nor the line above: standalone mode, the
home screen label and the status bar are still set from its own
`apple-` metas. #}
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="roledesk">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="stylesheet" href="{{ asset('app.css') }}">
</head>
<body{% block body_attrs %}{% endblock %}>
{% set here = active_path | default(request.url.path, true) %}
<header class="top">
<a class="brand" href="/">role<span>desk</span></a>
{% block header_tools %}{% endblock %}
<nav>
{% for tab in TABS %}
<a href="{{ tab.path }}"
{% if here == tab.path %}class="active" aria-current="page"{% endif %}>{{ tab.label }}</a>
{% endfor %}
{# health's cog: an icon because it is not a place you go to often, and a
word would take a third of the bar on a phone. #}
<a href="/settings" class="icon{% if request.url.path.startswith('/settings') %} active{% endif %}"
title="Settings" aria-label="Settings"><svg viewBox="0 0 24 24" width="17" height="17"
aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></a>
</nav>
</header>
{% block page %}
<main>
{% block content %}{% endblock %}
</main>
{% endblock %}
{# toasts first, and the order is load-bearing: it owns `window.toast`, which
app.js calls on a failed fetch and live.js feeds server notices into, and
`window.esc`, which every page script below builds its HTML with. app.js
next, since every page script takes `api` and the shared helpers from it. #}
<script src="{{ asset('toasts.js') }}"></script>
<script src="{{ asset('app.js') }}"></script>
<script src="{{ asset('live.js') }}"></script>
{% block scripts %}{% endblock %}
</body>
</html>