From 063463defd7cdd1ec7df1b37c08fdb282a10a8fa Mon Sep 17 00:00:00 2001 From: Wolf Date: Tue, 29 Sep 2026 16:13:07 +0200 Subject: [PATCH] Pass Platsbanken's regions to the Sources page Co-Authored-By: Claude Fable 5.1 --- app/web/pages.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/web/pages.py b/app/web/pages.py index be2c72f..f586ebf 100644 --- a/app/web/pages.py +++ b/app/web/pages.py @@ -27,8 +27,8 @@ keeps working. functions are the classifier's vocabulary and the hosts are what it parses, and this reaches `plugins/` the same way `app.cli` does, since a plugin is app-agnostic and never reaches back into `app`. The -Jobindex areas and Adzuna countries on the Sources page come from -`plugins.search` for the same reason. +Jobindex areas, Adzuna countries and Platsbanken regions on the Sources page +come from `plugins.search` for the same reason. """ from __future__ import annotations @@ -49,7 +49,9 @@ if str(_ROOT) not in sys.path: sys.path.insert(0, str(_ROOT)) from plugins.ats import FUNCTIONS, HOSTS # noqa: E402 -from plugins.search import ADZUNA_COUNTRIES, JOBINDEX_AREAS # noqa: E402 +from plugins.search import ( # noqa: E402 + ADZUNA_COUNTRIES, JOBINDEX_AREAS, PLATSBANKEN_REGIONS, +) TEMPLATE_DIR = Path(__file__).resolve().parent.parent / "templates" STATIC_DIR = Path(__file__).resolve().parent.parent / "static" @@ -97,6 +99,7 @@ PAY_OPTIONS = [("stated", "Stated or normalised"), ("normalised", "Normalised on STATUS_OPTIONS = [(s, s.capitalize()) for s in STATUSES] AREA_OPTIONS = list(JOBINDEX_AREAS.items()) 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()) @@ -165,7 +168,7 @@ def agents(request: Request) -> HTMLResponse: @router.get("/settings/sources", response_class=HTMLResponse) def sources(request: Request) -> HTMLResponse: return page(request, "settings/sources.html", areas=AREA_OPTIONS, - countries=COUNTRY_OPTIONS, hosts=HOST_OPTIONS) + countries=COUNTRY_OPTIONS, regions=REGION_OPTIONS, hosts=HOST_OPTIONS) @router.get("/settings/account", response_class=HTMLResponse)