Wire freehire, Jobnet and Akademikernes Jobbank into the CLI, the Sources form, dupes and the docs
Provider names, the CLI's choices and the dupes rule's search hosts now come from readers.PROVIDERS, and the regions, work modes and remote words from the modules' REGIONS, MODES and REMOTE, read with getattr so main works before and after the readers merge. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
018a1ad895
commit
6e6e655203
16 files changed
+422
-39
No files matched your search
+20
-7
@@ -1,7 +1,8 @@
|
||||
/* The Job boards section of Sources: one query on one board per row, on
|
||||
* Jobindex, Adzuna or Platsbanken. The UI says "job board" for what the API and the CLI
|
||||
* call a search (`/api/searches`, `app searches`); company boards are
|
||||
* companies.js's section, since a board is a company's own, not a query's.
|
||||
* Jobindex, Adzuna, Platsbanken, freehire, Jobnet or Akademikernes Jobbank.
|
||||
* The UI says "job board" for what the API and the CLI call a search
|
||||
* (`/api/searches`, `app searches`); company boards are companies.js's
|
||||
* section, since a board is a company's own, not a query's.
|
||||
*
|
||||
* Edit turns a row into the form from the page's `<template>`, in place, and
|
||||
* New job board puts a blank form on top of the list, as agents.js does for
|
||||
@@ -172,7 +173,13 @@
|
||||
$("#s-area", f).value = String(p.area || (source ? 0 : 1));
|
||||
$("#s-country", f).value = p.country || "de";
|
||||
$("#s-where", f).value = p.where || "";
|
||||
$("#s-region", f).value = p.region || "";
|
||||
const of = (provider) => source && source.provider === provider;
|
||||
$("#s-region", f).value = of("platsbanken") ? p.region || "" : "";
|
||||
$("#s-countries", f).value = of("freehire") ? p.country || "" : "";
|
||||
$("#s-mode", f).value = of("freehire") ? p.remote || "" : "";
|
||||
$("#s-region-jobnet", f).value = of("jobnet") ? String(p.region || "") : "";
|
||||
$("#s-region-jobbank", f).value = of("jobbank") ? String(p.region || "") : "";
|
||||
$("#s-remote-jobbank", f).value = of("jobbank") ? p.remote || "" : "";
|
||||
$("#s-pages", f).value = String(p.pages || 10);
|
||||
showProvider(f);
|
||||
f.addEventListener("input", () => { f.dataset.dirty = "true"; });
|
||||
@@ -209,15 +216,21 @@
|
||||
$("#s-q", editor).focus({ preventScroll: true });
|
||||
}
|
||||
|
||||
// Region, country and remote word each have one control per provider that
|
||||
// reads them; the body takes the shown provider's, and "" where it has none.
|
||||
function searchBody(f) {
|
||||
const provider = $("#s-provider", f).value;
|
||||
const own = (controls) => (controls[provider] ? $(controls[provider], f).value.trim() : "");
|
||||
return {
|
||||
provider: $("#s-provider", f).value,
|
||||
provider,
|
||||
name: $("#s-name", f).value.trim(),
|
||||
q: $("#s-q", f).value.trim(),
|
||||
area: Number($("#s-area", f).value) || 0,
|
||||
country: $("#s-country", f).value,
|
||||
country: own({ adzuna: "#s-country", freehire: "#s-countries" }),
|
||||
where: $("#s-where", f).value.trim(),
|
||||
region: $("#s-region", f).value,
|
||||
region: own({ platsbanken: "#s-region", jobnet: "#s-region-jobnet",
|
||||
jobbank: "#s-region-jobbank" }),
|
||||
remote: own({ freehire: "#s-mode", jobbank: "#s-remote-jobbank" }),
|
||||
pages: Number($("#s-pages", f).value) || 0,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user