Pass Platsbanken's regions to the Sources page
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc7b8747b0
commit
063463defd
1 file changed
+7
-4
+7
-4
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user