# ATO role-view preview (12 Nov 2026)

A separate preview layer for how ATO pages look as Guest, Member, Owner and Super Admin, plus directory cards with star ratings.

The original generator in `../ato-generator/` is **not modified**. This folder imports it read-only, then overrides school-state flags and adds the role board (reviews, form, votes, official reply, Premium extras, admin hide/remove).

Expected original hashes (must still match):

- `ato-generator/template/ato.html.j2` — `f835e3da680cc4ece94bfe006ec69701bf240433b3504acd87b139cb2b4046b3`
- `ato-generator/generator.py` — `aed644fd01d065d330a5d2da8f00bb9c86bd1a1560dda7153f3d7c548c2f830c`

This branch is a picture-and-rules preview only. It is not merged and not deployed.

## School states

These follow DECISIONS-MASTER and `getSchoolView`. They **do not** use `tools/reviews/export_for_generator.mjs`, which marks lapsed schools as verified and claimed-but-unpaid schools as unclaimed.

| State | Gold tick | `.official` | Claim invite | Premium extras | Official replies |
|---|---|---|---|---|---|
| unclaimed | no | no | yes | locked | no |
| claimed_unpaid (claim approved, never paid) | no | no | no | locked | no |
| paying (claim approved, paying now, including gifted) | yes | yes | no | unlock after 30 days paid | yes |
| lapsed (paid before, not now) | no — not verified | kept | no | private again | no (old ones stay) |

Gold tick = claim approved **and** currently paying. Sign-in links are `/signup/?next=/ato/{slug}/`.

## What's real vs SAMPLE

- Real (from the master record): school names, bases, certificates, courses, contact, ICAO.
- SAMPLE (mock, labelled): reviews, ratings, handles, votes, official replies, Premium extras, signed-in chrome.

CFA's 4.4 from 23 reviews is the honest average of the SAMPLE ratings, not a made-up 4.6. The member page shows 8 of the 23 reviews as written cards (the rest are count-only) so the preview stays readable.

## Render

Needs Python 3, jinja2, and the master at one of:

- `/workspace/database-MOVED-12nov/ato-data/ato-master-10nov.json`
- `mock/master-slice.json` (a slice written on the last render)

```sh
cd ato-generator-roles-test
python3 render.py
python3 -m http.server 8876 --bind 127.0.0.1 --directory out
```

Open `out/index.html` for the page list. Role HTML files are split only so each view can be opened without D1. In production there is one URL per school.

## Screenshots

Amethyst (`data-theme="night"` `data-pal="purple"`), Playwright + `/usr/bin/google-chrome`.

```sh
# serve out/ first, then:
node scripts/shots.mjs
```

`scripts/shots.mjs` looks for the `playwright` package in the usual places (`node_modules`, then a cached npx install). Install Playwright if it is missing: `npm install playwright`.

Shots are written to `./shots/` and, when present, `/workspace/ato-roles-test-12nov/shots/`.

## Rule coverage

See [RULES-COVERAGE.md](RULES-COVERAGE.md). DECISIONS-MASTER wins where it clashes with older RULES-MASTER text.
