Merge the seniority range filter: From, To and Track in the rail (wp-sen-b-range)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 13:14:45 +02:00
commit d529f6c0ce
6 files changed
+207 -71

No files matched your search

+8 -3
View File
@@ -41,7 +41,7 @@ from fastapi import APIRouter, HTTPException, Request
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
from app.models import REMOTE, STATUSES
from app.models import LADDER, REMOTE, RUNGS, STATUSES
from app.web.deps import StoreDep
_ROOT = Path(__file__).resolve().parents[2]
@@ -104,6 +104,10 @@ COUNTRY_OPTIONS = [(c, c.upper()) for c in sorted(ADZUNA_COUNTRIES)]
REGION_OPTIONS = sorted(PLATSBANKEN_REGIONS.items(), key=lambda kv: kv[1])
#: The ATS hosts `plugins.ats` reads, for the Follow and Set board selects.
HOST_OPTIONS = list(HOSTS.items())
#: The seniority ladder as `roles.js` reads it: the rungs in order, and each
#: level's rung (an index into them) and track, so the words are `app.models`'
#: alone. The page carries it as JSON.
LADDER_JSON = {"rungs": list(RUNGS), "levels": {k: list(v) for k, v in LADDER.items()}}
def asset(path: str) -> str:
@@ -134,7 +138,8 @@ def page(request: Request, name: str, **context: object) -> HTMLResponse:
@router.get("/", response_class=HTMLResponse)
def roles(request: Request) -> HTMLResponse:
return page(request, "roles.html", functions=FUNCTION_OPTIONS,
remote_options=REMOTE_OPTIONS, pay_options=PAY_OPTIONS, role=None)
remote_options=REMOTE_OPTIONS, pay_options=PAY_OPTIONS,
ladder=LADDER_JSON, role=None)
@router.get("/roles/{uid}", response_class=HTMLResponse)
@@ -149,7 +154,7 @@ def role(request: Request, uid: str, store: StoreDep) -> HTMLResponse:
raise HTTPException(404, f"no such role: {uid}")
return page(request, "roles.html", functions=FUNCTION_OPTIONS,
remote_options=REMOTE_OPTIONS, pay_options=PAY_OPTIONS,
role=found, active_path="/")
ladder=LADDER_JSON, role=found, active_path="/")
@router.get("/applications", response_class=HTMLResponse)