Redesign the tracker's UI
An app shell with a sidebar (a top bar on phones) replaces the per-page headers and back links. A token-based design system in styles.css, with a dark set under prefers-color-scheme, replaces the paper palette and the cv-btn/ja-input classes ported from the main site. - Applications: header with counts and the follow-up total, the add form behind a "New application" button, coloured pipeline tiles, a "Needs follow-up" filter, sort indicators, icon row actions, compact phone cards. Quick reference sits beside the table on wide screens. - Leads: profile and sources side by side, underline tabs, score rings, source health dots. - Settings: status cards for capture and email. No API or store changes. jobs-shared.css and the unused Creato font are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CiMoE29eGkJtia4hCzSKzT
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ef38679a45
commit
f5b722d100
Binary file not shown.
+201
-3
@@ -1,10 +1,208 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* Root component. Each page draws its own header, so this is only the outlet.
|
* Root component: the app shell. A sidebar on wide screens, a top bar on
|
||||||
|
* narrow ones, with the three routes and the two links that leave the app;
|
||||||
|
* each page draws its own header and content inside <main>.
|
||||||
*/
|
*/
|
||||||
import { RouterView } from "vue-router";
|
import { RouterLink, RouterView } from "vue-router";
|
||||||
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
|
// Served from web/public/ under the app's base path (/jobs/).
|
||||||
|
const userscriptUrl = `${import.meta.env.BASE_URL}job-capture.user.js`;
|
||||||
|
|
||||||
|
const NAV = [
|
||||||
|
{ to: "/", label: "Applications", icon: "briefcase" },
|
||||||
|
{ to: "/leads", label: "Leads", icon: "inbox" },
|
||||||
|
{ to: "/settings", label: "Settings", icon: "sliders" },
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RouterView />
|
<div class="shell">
|
||||||
|
<aside class="sidebar">
|
||||||
|
<RouterLink to="/" class="brand">
|
||||||
|
<span class="brand-mark">JT</span>
|
||||||
|
<span class="brand-name">Job tracker</span>
|
||||||
|
</RouterLink>
|
||||||
|
|
||||||
|
<nav class="nav" aria-label="Main">
|
||||||
|
<RouterLink
|
||||||
|
v-for="item in NAV"
|
||||||
|
:key="item.to"
|
||||||
|
:to="item.to"
|
||||||
|
class="nav-link"
|
||||||
|
exact-active-class="nav-link-active"
|
||||||
|
>
|
||||||
|
<Icon :name="item.icon" :size="17" />
|
||||||
|
<span>{{ item.label }}</span>
|
||||||
|
</RouterLink>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="sidebar-foot">
|
||||||
|
<!-- A plain link to a static file: Violentmonkey intercepts any
|
||||||
|
navigation to a URL ending in .user.js and offers to install it.
|
||||||
|
The token it then asks for is generated on the Settings page. -->
|
||||||
|
<a
|
||||||
|
class="nav-link nav-link-quiet"
|
||||||
|
:href="userscriptUrl"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
title="Violentmonkey userscript that adds the job you are viewing. After installing, generate a capture token on the Settings page and paste it into the script's menu: Configure job capture."
|
||||||
|
>
|
||||||
|
<Icon name="code" :size="17" />
|
||||||
|
<span>Capture script</span>
|
||||||
|
</a>
|
||||||
|
<!-- The CV is the main site's page, outside this app: a full load. -->
|
||||||
|
<a href="/cv" class="nav-link nav-link-quiet">
|
||||||
|
<Icon name="arrow-left" :size="17" />
|
||||||
|
<span>Back to CV</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main class="main">
|
||||||
|
<RouterView />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.shell {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 232px minmax(0, 1fr);
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
height: 100vh;
|
||||||
|
padding: 1.25rem 0.85rem;
|
||||||
|
border-right: 1px solid var(--border);
|
||||||
|
background: var(--surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.65rem;
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.brand:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-mark {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--accent);
|
||||||
|
color: var(--accent-fg);
|
||||||
|
font-family: var(--font-heading);
|
||||||
|
font-size: 1.15rem;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
padding-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-name {
|
||||||
|
font-family: var(--font-heading);
|
||||||
|
font-size: 1.5rem;
|
||||||
|
letter-spacing: 0.03em;
|
||||||
|
line-height: 1;
|
||||||
|
padding-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav,
|
||||||
|
.sidebar-foot {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.15rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-foot {
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.65rem;
|
||||||
|
height: 2.25rem;
|
||||||
|
padding: 0 0.65rem;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
color: var(--text-2);
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 500;
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.nav-link:hover {
|
||||||
|
background: var(--surface-hover);
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.nav-link-active,
|
||||||
|
.nav-link-active:hover {
|
||||||
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
.nav-link-quiet {
|
||||||
|
color: var(--text-3);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Narrow screens: the sidebar folds into a top bar that scrolls sideways. */
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.shell {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
/* Otherwise a short page stretches the bar to share the spare height. */
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: sticky;
|
||||||
|
z-index: 10;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
height: auto;
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-name {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav,
|
||||||
|
.sidebar-foot {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-foot {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
padding: 0 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link-quiet span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
+528
-98
@@ -1,14 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Global stylesheet: the tracker's whole look outside the components.
|
* Global stylesheet: the design tokens and the small set of shared primitives
|
||||||
|
* (buttons, inputs, cards, pills, alerts, the page header) that every view
|
||||||
|
* composes. Views keep only their own layout in scoped <style> blocks.
|
||||||
*
|
*
|
||||||
* Ported from the main site, where these pages ran inside CVLayout.vue, which
|
* Tailwind is here for its preflight reset, which the components are written
|
||||||
* re-pointed the site's dark design tokens to ink-on-paper values. This app is
|
|
||||||
* only ever light, so the paper palette is declared directly and the base
|
|
||||||
* element styles below are what that layout produced.
|
|
||||||
*
|
|
||||||
* Tailwind is here for its preflight reset, which the components were written
|
|
||||||
* against (box-sizing, zeroed margins, unstyled buttons). They use no utility
|
* against (box-sizing, zeroed margins, unstyled buttons). They use no utility
|
||||||
* classes; their own scoped <style> blocks do the layout.
|
* classes.
|
||||||
|
*
|
||||||
|
* Colours are semantic tokens with a dark set under prefers-color-scheme.
|
||||||
|
* Status and score tints are derived with color-mix() from one hue each, so a
|
||||||
|
* new status needs one token, not a light and a dark pair of backgrounds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
@@ -21,122 +22,551 @@
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
:root {
|
||||||
font-family: "CreatoDisplay";
|
color-scheme: light;
|
||||||
src: url("/jobs/fonts/CreatoDisplay-Bold.woff2") format("woff2");
|
|
||||||
font-weight: normal;
|
--bg: #f4f5f7;
|
||||||
font-style: normal;
|
--surface: #ffffff;
|
||||||
font-display: swap;
|
--surface-2: #f8f9fb;
|
||||||
|
--surface-hover: #f1f3f6;
|
||||||
|
--border: #e3e6eb;
|
||||||
|
--border-strong: #cdd2da;
|
||||||
|
|
||||||
|
--text: #14171c;
|
||||||
|
--text-2: #4a515c;
|
||||||
|
--text-3: #7b8390;
|
||||||
|
|
||||||
|
--accent: #4f46e5;
|
||||||
|
--accent-hover: #4338ca;
|
||||||
|
--accent-fg: #ffffff;
|
||||||
|
--accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
|
||||||
|
|
||||||
|
--danger: #dc2626;
|
||||||
|
--danger-soft: color-mix(in srgb, var(--danger) 9%, var(--surface));
|
||||||
|
--warn: #d97706;
|
||||||
|
--ok: #16a34a;
|
||||||
|
|
||||||
|
/* One hue per job status; pills and pipeline tiles tint from these. */
|
||||||
|
--st-saved: #8b93a1;
|
||||||
|
--st-applied: #4f46e5;
|
||||||
|
--st-screening: #0891b2;
|
||||||
|
--st-assessment: #d97706;
|
||||||
|
--st-interviewing: #9333ea;
|
||||||
|
--st-offer: #16a34a;
|
||||||
|
--st-rejected: #dc2626;
|
||||||
|
--st-withdrawn: #a3a9b3;
|
||||||
|
|
||||||
|
--radius: 10px;
|
||||||
|
--radius-sm: 7px;
|
||||||
|
--shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 1px 3px rgb(16 24 40 / 0.04);
|
||||||
|
--shadow-lg: 0 10px 30px -12px rgb(16 24 40 / 0.25);
|
||||||
|
--ring: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
|
||||||
|
|
||||||
|
--font-heading: "big_noodle_titling", "Arial Narrow", sans-serif;
|
||||||
|
--font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
|
||||||
|
"Helvetica Neue", Arial, sans-serif;
|
||||||
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* `static` = always emit these variables, because component <style> blocks
|
@media (prefers-color-scheme: dark) {
|
||||||
reference them with var(). */
|
:root {
|
||||||
@theme static {
|
color-scheme: dark;
|
||||||
/* Paper palette */
|
|
||||||
--color-ink: #111;
|
|
||||||
--color-ink-soft: #333;
|
|
||||||
--color-ink-muted: #555;
|
|
||||||
--color-ink-faint: #999;
|
|
||||||
--color-ink-link: #0066cc;
|
|
||||||
--color-ink-danger: #c00;
|
|
||||||
--color-paper: #fff;
|
|
||||||
--color-paper-tint: #f5f5f5;
|
|
||||||
--color-paper-shade: #eee;
|
|
||||||
--color-line: #ccc;
|
|
||||||
--color-line-soft: #e0e0e0;
|
|
||||||
|
|
||||||
--font-heading: "big_noodle_titling", sans-serif;
|
--bg: #0e1015;
|
||||||
--font-body: "CreatoDisplay", sans-serif;
|
--surface: #171a21;
|
||||||
--default-font-family: var(--font-body);
|
--surface-2: #1c2029;
|
||||||
|
--surface-hover: #222733;
|
||||||
|
--border: #2a2f3a;
|
||||||
|
--border-strong: #3a414f;
|
||||||
|
|
||||||
|
--text: #e9ecf1;
|
||||||
|
--text-2: #b3bac6;
|
||||||
|
--text-3: #828b99;
|
||||||
|
|
||||||
|
--accent: #818cf8;
|
||||||
|
--accent-hover: #a5b4fc;
|
||||||
|
--accent-fg: #0e1015;
|
||||||
|
--accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
|
||||||
|
|
||||||
|
--danger: #f87171;
|
||||||
|
--danger-soft: color-mix(in srgb, var(--danger) 14%, var(--surface));
|
||||||
|
--warn: #fbbf24;
|
||||||
|
--ok: #4ade80;
|
||||||
|
|
||||||
|
--st-saved: #9aa3b2;
|
||||||
|
--st-applied: #818cf8;
|
||||||
|
--st-screening: #22d3ee;
|
||||||
|
--st-assessment: #fbbf24;
|
||||||
|
--st-interviewing: #c084fc;
|
||||||
|
--st-offer: #4ade80;
|
||||||
|
--st-rejected: #f87171;
|
||||||
|
--st-withdrawn: #6b7280;
|
||||||
|
|
||||||
|
--shadow: 0 1px 2px rgb(0 0 0 / 0.4);
|
||||||
|
--shadow-lg: 0 10px 30px -12px rgb(0 0 0 / 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0 auto;
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
overflow-x: hidden;
|
background: var(--bg);
|
||||||
background: var(--color-paper-tint);
|
color: var(--text);
|
||||||
color: var(--color-ink);
|
font-family: var(--font-body);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.5;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
h2,
|
h2,
|
||||||
h3,
|
h3,
|
||||||
h4 {
|
h4 {
|
||||||
margin: 0;
|
color: var(--text);
|
||||||
font-family: var(--font-heading);
|
font-weight: 600;
|
||||||
color: var(--color-ink);
|
line-height: 1.25;
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
h3,
|
|
||||||
h4 {
|
|
||||||
font-size: 1.125rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p,
|
|
||||||
small,
|
|
||||||
code,
|
|
||||||
ul,
|
|
||||||
li,
|
|
||||||
a {
|
a {
|
||||||
color: var(--color-ink);
|
color: var(--accent);
|
||||||
}
|
|
||||||
|
|
||||||
input,
|
|
||||||
textarea {
|
|
||||||
color: var(--color-ink);
|
|
||||||
background: var(--color-paper);
|
|
||||||
border: 1px solid var(--color-line);
|
|
||||||
}
|
|
||||||
input::placeholder,
|
|
||||||
textarea::placeholder {
|
|
||||||
color: var(--color-ink-faint);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Buttons shared by every page */
|
|
||||||
.cv-btn {
|
|
||||||
padding: 0.4rem 1rem;
|
|
||||||
border: 1px solid var(--color-ink-soft);
|
|
||||||
border-radius: 4px;
|
|
||||||
background: var(--color-paper);
|
|
||||||
color: var(--color-ink-soft);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.9em;
|
||||||
|
padding: 0.05em 0.35em;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--surface-2);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
:focus-visible {
|
||||||
|
outline: none;
|
||||||
|
box-shadow: var(--ring);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Page frame --------------------------------------------------------- */
|
||||||
|
|
||||||
|
.page {
|
||||||
|
max-width: 1440px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 1.75rem 2rem 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 1rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
font-family: var(--font-heading);
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 2.1rem;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-sub {
|
||||||
|
margin-top: 0.4rem;
|
||||||
|
color: var(--text-3);
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.page {
|
||||||
|
padding: 1.25rem 1rem 2.5rem;
|
||||||
|
}
|
||||||
|
.page-title {
|
||||||
|
font-size: 1.8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Buttons ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
height: 2.25rem;
|
||||||
|
padding: 0 0.9rem;
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--surface);
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 500;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
transition:
|
transition:
|
||||||
background 0.15s,
|
background 0.12s,
|
||||||
color 0.15s;
|
border-color 0.12s,
|
||||||
|
color 0.12s;
|
||||||
}
|
}
|
||||||
.cv-btn:hover {
|
.btn:hover {
|
||||||
background: var(--color-paper-shade);
|
background: var(--surface-hover);
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.cv-btn:disabled {
|
.btn:disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
.cv-btn-sm {
|
.btn-primary {
|
||||||
padding: 0.2rem 0.55rem;
|
border-color: var(--accent);
|
||||||
|
background: var(--accent);
|
||||||
|
color: var(--accent-fg);
|
||||||
|
}
|
||||||
|
.btn-primary:hover {
|
||||||
|
border-color: var(--accent-hover);
|
||||||
|
background: var(--accent-hover);
|
||||||
|
}
|
||||||
|
.btn-danger {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
.btn-danger:hover {
|
||||||
|
border-color: var(--danger);
|
||||||
|
background: var(--danger-soft);
|
||||||
|
}
|
||||||
|
.btn-ghost {
|
||||||
|
border-color: transparent;
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
color: var(--text-2);
|
||||||
|
}
|
||||||
|
.btn-ghost:hover {
|
||||||
|
background: var(--surface-hover);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.btn-ghost.btn-danger:hover {
|
||||||
|
border-color: transparent;
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
.btn-sm {
|
||||||
|
height: 1.875rem;
|
||||||
|
padding: 0 0.65rem;
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
/* Square, for a lone icon; always carries a title and aria-label. */
|
||||||
|
.btn-icon {
|
||||||
|
width: 2.25rem;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.btn-icon.btn-sm {
|
||||||
|
width: 1.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Form controls ------------------------------------------------------ */
|
||||||
|
|
||||||
|
.input {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
height: 2.25rem;
|
||||||
|
padding: 0 0.7rem;
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--surface);
|
||||||
|
color: var(--text);
|
||||||
|
font: inherit;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
transition:
|
||||||
|
border-color 0.12s,
|
||||||
|
box-shadow 0.12s;
|
||||||
|
}
|
||||||
|
.input::placeholder {
|
||||||
|
color: var(--text-3);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.input:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: var(--ring);
|
||||||
|
}
|
||||||
|
textarea.input {
|
||||||
|
height: auto;
|
||||||
|
padding: 0.5rem 0.7rem;
|
||||||
|
line-height: 1.45;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
select.input {
|
||||||
|
padding-right: 2rem;
|
||||||
|
appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8390' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: right 0.6rem center;
|
||||||
|
}
|
||||||
|
.input-sm {
|
||||||
|
height: 1.875rem;
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
textarea.input-sm {
|
||||||
|
padding: 0.35rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.3rem;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.field > span {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-2);
|
||||||
}
|
}
|
||||||
.cv-btn-primary,
|
|
||||||
.cv-btn.active {
|
.check {
|
||||||
background: var(--color-ink-soft);
|
display: inline-flex;
|
||||||
color: var(--color-paper);
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
color: var(--text-2);
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.cv-btn-primary:hover {
|
.check input {
|
||||||
background: var(--color-ink-muted);
|
accent-color: var(--accent);
|
||||||
}
|
}
|
||||||
.cv-btn-danger {
|
|
||||||
border-color: var(--color-ink-danger);
|
/* Search box: an input with a magnifier inside its left edge. */
|
||||||
color: var(--color-ink-danger);
|
.search {
|
||||||
|
position: relative;
|
||||||
|
flex: 1 1 16rem;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.cv-btn-danger:hover {
|
.search > svg {
|
||||||
background: #fee;
|
position: absolute;
|
||||||
|
left: 0.7rem;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
color: var(--text-3);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.search > .input {
|
||||||
|
padding-left: 2.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Surfaces ----------------------------------------------------------- */
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
background: var(--surface);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 0.75rem;
|
||||||
|
padding: 0.9rem 1.1rem;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 1rem 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A card that folds: <details class="card disclosure"><summary>… */
|
||||||
|
.disclosure > summary {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.6rem;
|
||||||
|
padding: 0.9rem 1.1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
.disclosure > summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.disclosure > summary::after {
|
||||||
|
content: "";
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin-left: auto;
|
||||||
|
flex: none;
|
||||||
|
background: currentColor;
|
||||||
|
color: var(--text-3);
|
||||||
|
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
|
||||||
|
center / contain no-repeat;
|
||||||
|
transition: transform 0.15s;
|
||||||
|
}
|
||||||
|
.disclosure[open] > summary::after {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
.disclosure[open] > summary {
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Feedback ----------------------------------------------------------- */
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
padding: 0.65rem 0.75rem 0.65rem 1rem;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--danger-soft);
|
||||||
|
color: var(--danger);
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.muted {
|
||||||
|
color: var(--text-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
color: var(--text-3);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warn {
|
||||||
|
color: var(--danger);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
padding: 2.5rem 1rem;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline count beside a label, as in tabs and card titles. */
|
||||||
|
.count {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-width: 1.4rem;
|
||||||
|
height: 1.25rem;
|
||||||
|
padding: 0 0.4rem;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: var(--surface-hover);
|
||||||
|
color: var(--text-2);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 600;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Long captured posting text: scrolls inside its container. */
|
||||||
|
.posting {
|
||||||
|
max-height: 24rem;
|
||||||
|
overflow: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.9rem 1rem;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--surface-2);
|
||||||
|
color: var(--text-2);
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
line-height: 1.55;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- Status pills ------------------------------------------------------- */
|
||||||
|
|
||||||
|
.pill {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
height: 1.6rem;
|
||||||
|
padding: 0 0.65rem;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--st, var(--text-3)) 30%, transparent);
|
||||||
|
border-radius: 999px;
|
||||||
|
background: color-mix(in srgb, var(--st, var(--text-3)) 12%, var(--surface));
|
||||||
|
color: color-mix(in srgb, var(--st, var(--text-3)) 75%, var(--text));
|
||||||
|
font-size: 0.78rem;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.pill::before {
|
||||||
|
content: "";
|
||||||
|
width: 0.45rem;
|
||||||
|
height: 0.45rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--st, var(--text-3));
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 0.5rem;
|
||||||
|
height: 0.5rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--text-3);
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
.dot-ok {
|
||||||
|
background: var(--ok);
|
||||||
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
|
||||||
|
}
|
||||||
|
.dot-warn {
|
||||||
|
background: var(--warn);
|
||||||
|
box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-saved { --st: var(--st-saved); }
|
||||||
|
.status-applied { --st: var(--st-applied); }
|
||||||
|
.status-screening { --st: var(--st-screening); }
|
||||||
|
.status-assessment { --st: var(--st-assessment); }
|
||||||
|
.status-interviewing { --st: var(--st-interviewing); }
|
||||||
|
.status-offer { --st: var(--st-offer); }
|
||||||
|
.status-rejected { --st: var(--st-rejected); }
|
||||||
|
.status-withdrawn { --st: var(--st-withdrawn); }
|
||||||
|
|
||||||
|
/* ---- Spinner ------------------------------------------------------------ */
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border: 2px solid currentColor;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 0.7s linear infinite;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.spinner {
|
||||||
|
animation-duration: 2s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<script setup>
|
||||||
|
/**
|
||||||
|
* A small inline icon set (shapes after Lucide, ISC licence), drawn in
|
||||||
|
* currentColor so an icon takes the colour of the text beside it. Inline
|
||||||
|
* rather than a package because the app needs about twenty.
|
||||||
|
*
|
||||||
|
* Decorative by default (aria-hidden): a button that is only an icon carries
|
||||||
|
* its own aria-label and title.
|
||||||
|
*/
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
name: { type: String, required: true },
|
||||||
|
size: { type: [Number, String], default: 16 },
|
||||||
|
});
|
||||||
|
|
||||||
|
const PATHS = {
|
||||||
|
briefcase:
|
||||||
|
'<rect width="20" height="14" x="2" y="7" rx="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>',
|
||||||
|
inbox:
|
||||||
|
'<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>',
|
||||||
|
sliders:
|
||||||
|
'<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="10" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="8" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="12" y2="3"/><line x1="2" x2="6" y1="14" y2="14"/><line x1="10" x2="14" y1="8" y2="8"/><line x1="18" x2="22" y1="16" y2="16"/>',
|
||||||
|
download:
|
||||||
|
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
|
||||||
|
plus: '<path d="M5 12h14"/><path d="M12 5v14"/>',
|
||||||
|
search: '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
|
||||||
|
pencil: '<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>',
|
||||||
|
trash:
|
||||||
|
'<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>',
|
||||||
|
file: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/>',
|
||||||
|
copy: '<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
|
||||||
|
check: '<path d="M20 6 9 17l-5-5"/>',
|
||||||
|
external:
|
||||||
|
'<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
|
||||||
|
"arrow-left": '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',
|
||||||
|
refresh:
|
||||||
|
'<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
|
||||||
|
x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
|
||||||
|
"chevron-up": '<path d="m18 15-6-6-6 6"/>',
|
||||||
|
"chevron-down": '<path d="m6 9 6 6 6-6"/>',
|
||||||
|
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
|
||||||
|
clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
|
||||||
|
mail: '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
|
||||||
|
key: '<circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/>',
|
||||||
|
sparkles:
|
||||||
|
'<path d="M12 3 13.9 8.8 20 10l-6.1 1.2L12 17l-1.9-5.8L4 10l6.1-1.2Z"/><path d="M19 17v4"/><path d="M17 19h4"/>',
|
||||||
|
bookmark: '<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"/>',
|
||||||
|
undo: '<path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/>',
|
||||||
|
pause: '<rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/>',
|
||||||
|
play: '<polygon points="6 3 20 12 6 21 6 3"/>',
|
||||||
|
globe:
|
||||||
|
'<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>',
|
||||||
|
};
|
||||||
|
|
||||||
|
const svg = computed(() => PATHS[props.name] ?? "");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<svg
|
||||||
|
:width="size"
|
||||||
|
:height="size"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
aria-hidden="true"
|
||||||
|
focusable="false"
|
||||||
|
class="icon"
|
||||||
|
v-html="svg"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.icon {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -5,16 +5,16 @@
|
|||||||
* row appears in the parent's table without the two having to talk.
|
* row appears in the parent's table without the two having to talk.
|
||||||
*
|
*
|
||||||
* Like JobReferences.vue it reports through the parent's single error banner:
|
* Like JobReferences.vue it reports through the parent's single error banner:
|
||||||
* `fail` carries the error, `ok` says a create succeeded.
|
* `fail` carries the error, `ok` says a create succeeded. `close` asks the
|
||||||
*
|
* parent to fold the form away, which it offers only when `closable`.
|
||||||
* Its root sits inside the parent's `.ja-root`, which jobs-shared.css relies on.
|
|
||||||
*/
|
*/
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useJobApplicationsStore } from "@/stores/jobApplications";
|
import { useJobApplicationsStore } from "@/stores/jobApplications";
|
||||||
import { STATUS_OPTIONS } from "./jobStatus";
|
import { STATUS_OPTIONS } from "./jobStatus";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["fail", "ok"]);
|
defineProps({ closable: { type: Boolean, default: false } });
|
||||||
|
const emit = defineEmits(["fail", "ok", "close"]);
|
||||||
|
|
||||||
const store = useJobApplicationsStore();
|
const store = useJobApplicationsStore();
|
||||||
|
|
||||||
@@ -62,68 +62,93 @@ async function createApplication() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form class="ja-form" @submit.prevent="createApplication">
|
<form class="card" @submit.prevent="createApplication">
|
||||||
<div class="ja-form-row">
|
<div class="card-header">
|
||||||
<input
|
<h2 class="card-title"><Icon name="plus" /> New application</h2>
|
||||||
v-model="form.jobTitle"
|
<button
|
||||||
class="ja-input"
|
v-if="closable"
|
||||||
placeholder="Job title *"
|
type="button"
|
||||||
required
|
class="btn btn-ghost btn-sm btn-icon"
|
||||||
/>
|
title="Close"
|
||||||
<input
|
aria-label="Close"
|
||||||
v-model="form.company"
|
@click="emit('close')"
|
||||||
class="ja-input"
|
>
|
||||||
placeholder="Company *"
|
<Icon name="x" />
|
||||||
required
|
</button>
|
||||||
/>
|
|
||||||
<select v-model="form.status" class="ja-input ja-select">
|
|
||||||
<option v-for="s in STATUS_OPTIONS" :key="s.value" :value="s.value">
|
|
||||||
{{ s.label }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ja-form-row">
|
<div class="card-body af-grid">
|
||||||
<input
|
<label class="field af-span-2">
|
||||||
v-model="form.location"
|
<span>Job title *</span>
|
||||||
class="ja-input"
|
<input v-model="form.jobTitle" class="input" required />
|
||||||
placeholder="Location"
|
</label>
|
||||||
/>
|
<label class="field af-span-2">
|
||||||
<input v-model="form.url" class="ja-input" placeholder="URL" />
|
<span>Company *</span>
|
||||||
<input
|
<input v-model="form.company" class="input" required />
|
||||||
v-model="form.appliedAt"
|
</label>
|
||||||
class="ja-input"
|
<label class="field">
|
||||||
type="date"
|
<span>Status</span>
|
||||||
title="Applied date"
|
<select v-model="form.status" class="input">
|
||||||
/>
|
<option v-for="s in STATUS_OPTIONS" :key="s.value" :value="s.value">
|
||||||
</div>
|
{{ s.label }}
|
||||||
<div class="ja-form-row">
|
</option>
|
||||||
<textarea
|
</select>
|
||||||
v-model="form.notes"
|
</label>
|
||||||
class="ja-input ja-textarea"
|
<label class="field">
|
||||||
placeholder="Notes"
|
<span>Applied</span>
|
||||||
/>
|
<input v-model="form.appliedAt" class="input" type="date" />
|
||||||
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
|
</label>
|
||||||
|
<label class="field af-span-2">
|
||||||
|
<span>Location</span>
|
||||||
|
<input v-model="form.location" class="input" placeholder="e.g. London, hybrid" />
|
||||||
|
</label>
|
||||||
|
<label class="field af-span-4">
|
||||||
|
<span>Posting URL</span>
|
||||||
|
<input v-model="form.url" class="input" placeholder="https://" />
|
||||||
|
</label>
|
||||||
|
<label class="field af-span-6">
|
||||||
|
<span>Notes</span>
|
||||||
|
<textarea v-model="form.notes" class="input" rows="2" />
|
||||||
|
</label>
|
||||||
|
<div class="af-actions af-span-6">
|
||||||
|
<button v-if="closable" type="button" class="btn" @click="emit('close')">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-primary">Add application</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Inputs are styled by jobs-shared.css; buttons are .cv-btn from CVLayout.vue. */
|
.af-grid {
|
||||||
.ja-form {
|
display: grid;
|
||||||
display: flex;
|
grid-template-columns: repeat(6, minmax(0, 1fr));
|
||||||
flex-direction: column;
|
gap: 0.9rem 1rem;
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-form-row {
|
.af-span-2 {
|
||||||
display: flex;
|
grid-column: span 2;
|
||||||
gap: 0.5rem;
|
}
|
||||||
flex-wrap: wrap;
|
.af-span-4 {
|
||||||
|
grid-column: span 4;
|
||||||
|
}
|
||||||
|
.af-span-6 {
|
||||||
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-textarea {
|
.af-actions {
|
||||||
resize: vertical;
|
display: flex;
|
||||||
min-height: 2.4rem;
|
justify-content: flex-end;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.af-grid {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
.af-span-2,
|
||||||
|
.af-span-4 {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+628
-431
File diff suppressed because it is too large
Load Diff
+250
-266
@@ -9,8 +9,8 @@
|
|||||||
* the profile (JobSearchProfile.vue). Nothing reaches the tracker at /jobs/
|
* the profile (JobSearchProfile.vue). Nothing reaches the tracker at /jobs/
|
||||||
* until **Track** is pressed on a lead, which adds it there as Saved.
|
* until **Track** is pressed on a lead, which adds it there as Saved.
|
||||||
*
|
*
|
||||||
* This view owns the page frame, the single error banner, the run button and
|
* This view owns the page header, the single error banner, the run buttons
|
||||||
* the list. Data access is in stores/jobLeads.js; nothing here calls gql().
|
* and the list. Data access is in stores/jobLeads.js; nothing here calls gql().
|
||||||
*
|
*
|
||||||
* There are three server jobs. "Check now" polls the sources and scores up to
|
* There are three server jobs. "Check now" polls the sources and scores up to
|
||||||
* forty new leads; "Score unscored" polls nothing and scores the whole
|
* forty new leads; "Score unscored" polls nothing and scores the whole
|
||||||
@@ -26,7 +26,7 @@ import { useJobLeadsStore } from "@/stores/jobLeads";
|
|||||||
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
|
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
|
||||||
import JobSources from "./JobSources.vue";
|
import JobSources from "./JobSources.vue";
|
||||||
import JobSearchProfile from "./JobSearchProfile.vue";
|
import JobSearchProfile from "./JobSearchProfile.vue";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const TABS = [
|
const TABS = [
|
||||||
{ value: "new", label: "Inbox" },
|
{ value: "new", label: "Inbox" },
|
||||||
@@ -117,6 +117,9 @@ function scoreClass(lead) {
|
|||||||
return "jl-score-low";
|
return "jl-score-low";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Fraction of the score ring to fill; an unscored lead gets an empty ring. */
|
||||||
|
const scoreArc = (lead) => Math.max(0, Math.min(100, lead.score ?? 0));
|
||||||
|
|
||||||
/** The tooltip says when, which during a rescore is how to tell new from old. */
|
/** The tooltip says when, which during a rescore is how to tell new from old. */
|
||||||
function scoreTitle(lead) {
|
function scoreTitle(lead) {
|
||||||
if (lead.score == null) return "Not scored";
|
if (lead.score == null) return "Not scored";
|
||||||
@@ -247,326 +250,315 @@ onBeforeUnmount(stopPolling);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="ja-root jl-root">
|
<div class="page">
|
||||||
<div class="jl-header">
|
<header class="page-header">
|
||||||
<div class="jl-header-left">
|
<div>
|
||||||
<RouterLink to="/" class="jl-back">← Tracker</RouterLink>
|
<h1 class="page-title">Leads</h1>
|
||||||
<h2 class="jl-heading">Job Leads</h2>
|
<p class="page-sub jl-sub">
|
||||||
|
<span v-if="running" class="spinner" aria-hidden="true"></span>
|
||||||
|
{{ lastRun || "Postings found on the sources below, scored against your profile." }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="jl-header-right">
|
<div class="page-actions">
|
||||||
<span class="jl-hint">{{ lastRun }}</span>
|
|
||||||
<button
|
<button
|
||||||
v-if="scoredCount"
|
v-if="scoredCount"
|
||||||
class="cv-btn"
|
class="btn"
|
||||||
:disabled="running"
|
:disabled="running"
|
||||||
title="Score every inbox lead again, including ones already scored. Use after changing the profile or the model. Old scores stay until replaced."
|
title="Score every inbox lead again, including ones already scored. Use after changing the profile or the model. Old scores stay until replaced."
|
||||||
@click="rescore"
|
@click="rescore"
|
||||||
>
|
>
|
||||||
|
<Icon name="refresh" />
|
||||||
Rescore all
|
Rescore all
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="unscoredCount"
|
v-if="unscoredCount"
|
||||||
class="cv-btn"
|
class="btn"
|
||||||
:disabled="running"
|
:disabled="running"
|
||||||
title="Score every unscored lead in the inbox against the profile, without polling the sources. One Claude call per lead."
|
title="Score every unscored lead in the inbox against the profile, without polling the sources. One Claude call per lead."
|
||||||
@click="start('scoreAll')"
|
@click="start('scoreAll')"
|
||||||
>
|
>
|
||||||
Score unscored ({{ unscoredCount }})
|
<Icon name="sparkles" />
|
||||||
|
Score unscored
|
||||||
|
<span class="count">{{ unscoredCount }}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="cv-btn cv-btn-primary"
|
class="btn btn-primary"
|
||||||
:disabled="running"
|
:disabled="running"
|
||||||
title="Poll every source now, then score up to 40 new leads. Profile and keyword changes take effect on a run."
|
title="Poll every source now, then score up to 40 new leads. Profile and keyword changes take effect on a run."
|
||||||
@click="start('runSync')"
|
@click="start('runSync')"
|
||||||
>
|
>
|
||||||
|
<span v-if="running" class="spinner" aria-hidden="true"></span>
|
||||||
|
<Icon v-else name="search" />
|
||||||
{{ running ? "Working…" : "Check now" }}
|
{{ running ? "Working…" : "Check now" }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</header>
|
||||||
|
|
||||||
<div v-if="error" class="jl-error" role="alert">
|
<div v-if="error" class="alert" role="alert">
|
||||||
<span>{{ error }}</span>
|
<span>{{ error }}</span>
|
||||||
<button class="cv-btn cv-btn-sm" @click="error = ''">Dismiss</button>
|
<button
|
||||||
|
class="btn btn-ghost btn-sm btn-icon"
|
||||||
|
title="Dismiss"
|
||||||
|
aria-label="Dismiss"
|
||||||
|
@click="error = ''"
|
||||||
|
>
|
||||||
|
<Icon name="x" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<JobSearchProfile @fail="fail" @ok="clearError" />
|
<div class="jl-setup">
|
||||||
<JobSources ref="sourcesBox" @fail="fail" @ok="clearError" />
|
<JobSearchProfile @fail="fail" @ok="clearError" />
|
||||||
|
<JobSources ref="sourcesBox" @fail="fail" @ok="clearError" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="jl-tabs">
|
<div class="jl-tabs" role="tablist">
|
||||||
<button
|
<button
|
||||||
v-for="t in TABS"
|
v-for="t in TABS"
|
||||||
:key="t.value"
|
:key="t.value"
|
||||||
class="jl-tab"
|
class="jl-tab"
|
||||||
|
role="tab"
|
||||||
|
:aria-selected="tab === t.value"
|
||||||
:class="{ 'jl-tab-active': tab === t.value }"
|
:class="{ 'jl-tab-active': tab === t.value }"
|
||||||
@click="tab = t.value"
|
@click="tab = t.value"
|
||||||
>
|
>
|
||||||
<span class="jl-tab-count">{{ counts[t.value] }}</span>
|
{{ t.label }}
|
||||||
<span class="jl-tab-label">{{ t.label }}</span>
|
<span class="count">{{ counts[t.value] }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="jl-filterbar">
|
<div class="jl-toolbar">
|
||||||
<input v-model="search" class="ja-input" type="search" placeholder="Search title, company, location, reasons…" />
|
<label class="search">
|
||||||
<select v-model="sortBy" class="ja-input ja-select jl-sort" title="Order of the list">
|
<Icon name="search" />
|
||||||
|
<input
|
||||||
|
v-model="search"
|
||||||
|
class="input"
|
||||||
|
type="search"
|
||||||
|
placeholder="Search title, company, location, reasons…"
|
||||||
|
aria-label="Search leads"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<select v-model="sortBy" class="input jl-sort" title="Order of the list" aria-label="Sort">
|
||||||
<option value="score">Best score first</option>
|
<option value="score">Best score first</option>
|
||||||
<option value="posted">Newest posting first</option>
|
<option value="posted">Newest posting first</option>
|
||||||
</select>
|
</select>
|
||||||
<label v-if="tab === 'new'" class="jl-check">
|
<label v-if="tab === 'new'" class="check">
|
||||||
<input v-model="showLowScores" type="checkbox" />
|
<input v-model="showLowScores" type="checkbox" />
|
||||||
Below {{ minScore }}<template v-if="hiddenLow"> ({{ hiddenLow }} hidden)</template>
|
Below {{ minScore }}<template v-if="hiddenLow"> ({{ hiddenLow }} hidden)</template>
|
||||||
</label>
|
</label>
|
||||||
<label v-if="tab === 'new'" class="jl-check" title="Postings the keyword filter rejected. They are never scored.">
|
<label v-if="tab === 'new'" class="check" title="Postings the keyword filter rejected. They are never scored.">
|
||||||
<input :checked="showUnmatched" type="checkbox" @change="toggleUnmatched" />
|
<input :checked="showUnmatched" type="checkbox" @change="toggleUnmatched" />
|
||||||
Filtered out
|
Filtered out
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<article
|
<div class="jl-list">
|
||||||
v-for="lead in visibleLeads"
|
<article
|
||||||
:key="lead.id"
|
v-for="lead in visibleLeads"
|
||||||
class="jl-lead"
|
:key="lead.id"
|
||||||
:class="{ 'jl-lead-unmatched': !lead.matched && lead.state === 'new' }"
|
class="card jl-lead"
|
||||||
>
|
:class="{ 'jl-lead-unmatched': !lead.matched && lead.state === 'new' }"
|
||||||
<div class="jl-score" :class="scoreClass(lead)" :title="scoreTitle(lead)">
|
>
|
||||||
{{ lead.score ?? "–" }}
|
<div
|
||||||
</div>
|
class="jl-score"
|
||||||
<div class="jl-lead-body">
|
:class="scoreClass(lead)"
|
||||||
<div class="jl-lead-title">
|
:style="{ '--arc': scoreArc(lead) }"
|
||||||
<a v-if="lead.url" :href="lead.url" target="_blank" rel="noopener" class="jl-link">{{ lead.jobTitle }}</a>
|
:title="scoreTitle(lead)"
|
||||||
<span v-else>{{ lead.jobTitle }}</span>
|
>
|
||||||
<span class="jl-lead-company">{{ lead.company }}</span>
|
<span>{{ lead.score ?? "–" }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="jl-lead-meta">
|
<div class="jl-lead-body">
|
||||||
<span v-if="lead.location">{{ lead.location }}</span>
|
<h3 class="jl-lead-title">
|
||||||
<span>{{ SOURCE_LABELS[lead.sourceKind] ?? lead.sourceKind }}</span>
|
<a v-if="lead.url" :href="lead.url" target="_blank" rel="noopener">{{ lead.jobTitle }}</a>
|
||||||
<span>{{ ageLabel(lead) }}</span>
|
<span v-else>{{ lead.jobTitle }}</span>
|
||||||
<span v-if="!lead.matched && lead.state === 'new'">filtered out</span>
|
</h3>
|
||||||
|
<div class="jl-lead-meta">
|
||||||
|
<span class="jl-company">{{ lead.company }}</span>
|
||||||
|
<span v-if="lead.location">{{ lead.location }}</span>
|
||||||
|
<span>{{ SOURCE_LABELS[lead.sourceKind] ?? lead.sourceKind }}</span>
|
||||||
|
<span>{{ ageLabel(lead) }}</span>
|
||||||
|
<span v-if="!lead.matched && lead.state === 'new'" class="jl-tag">filtered out</span>
|
||||||
|
</div>
|
||||||
|
<p v-if="lead.scoreReasons" class="jl-lead-reasons">{{ lead.scoreReasons }}</p>
|
||||||
|
<pre v-if="descriptionId === lead.id" class="posting jl-desc">{{
|
||||||
|
descriptions[lead.id] === undefined ? "Loading…" : descriptions[lead.id] || "The source gave no description."
|
||||||
|
}}</pre>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="lead.scoreReasons" class="jl-lead-reasons">{{ lead.scoreReasons }}</p>
|
<div class="jl-lead-actions">
|
||||||
<pre v-if="descriptionId === lead.id" class="jl-desc">{{
|
|
||||||
descriptions[lead.id] === undefined ? "Loading…" : descriptions[lead.id] || "The source gave no description."
|
|
||||||
}}</pre>
|
|
||||||
</div>
|
|
||||||
<div class="jl-lead-actions">
|
|
||||||
<button class="cv-btn cv-btn-sm" @click="toggleDescription(lead)">
|
|
||||||
{{ descriptionId === lead.id ? "Hide" : "Posting" }}
|
|
||||||
</button>
|
|
||||||
<template v-if="lead.state === 'new'">
|
|
||||||
<button
|
<button
|
||||||
class="cv-btn cv-btn-sm cv-btn-primary"
|
class="btn btn-ghost btn-sm"
|
||||||
:disabled="busyId === lead.id"
|
:class="{ 'jl-action-on': descriptionId === lead.id }"
|
||||||
title="Add to the tracker as Saved"
|
:aria-expanded="descriptionId === lead.id"
|
||||||
@click="act(lead, 'promote')"
|
@click="toggleDescription(lead)"
|
||||||
>
|
>
|
||||||
Track
|
<Icon name="file" :size="14" />
|
||||||
|
{{ descriptionId === lead.id ? "Hide" : "Posting" }}
|
||||||
</button>
|
</button>
|
||||||
<button class="cv-btn cv-btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'dismiss')">Dismiss</button>
|
<template v-if="lead.state === 'new'">
|
||||||
</template>
|
<button class="btn btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'dismiss')">
|
||||||
<button v-else-if="lead.state === 'dismissed'" class="cv-btn cv-btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'restore')">
|
<Icon name="x" :size="14" />
|
||||||
Restore
|
Dismiss
|
||||||
</button>
|
</button>
|
||||||
<RouterLink v-else to="/" class="cv-btn cv-btn-sm jl-btn-link">In tracker</RouterLink>
|
<button
|
||||||
</div>
|
class="btn btn-primary btn-sm"
|
||||||
</article>
|
:disabled="busyId === lead.id"
|
||||||
|
title="Add to the tracker as Saved"
|
||||||
|
@click="act(lead, 'promote')"
|
||||||
|
>
|
||||||
|
<Icon name="plus" :size="14" />
|
||||||
|
Track
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<button
|
||||||
|
v-else-if="lead.state === 'dismissed'"
|
||||||
|
class="btn btn-sm"
|
||||||
|
:disabled="busyId === lead.id"
|
||||||
|
@click="act(lead, 'restore')"
|
||||||
|
>
|
||||||
|
<Icon name="undo" :size="14" />
|
||||||
|
Restore
|
||||||
|
</button>
|
||||||
|
<RouterLink v-else to="/" class="btn btn-sm">
|
||||||
|
<Icon name="briefcase" :size="14" />
|
||||||
|
In tracker
|
||||||
|
</RouterLink>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
<p v-if="!visibleLeads.length" class="jl-empty">
|
<div v-if="!visibleLeads.length" class="card empty">
|
||||||
<template v-if="loading">Loading…</template>
|
<template v-if="loading">Loading…</template>
|
||||||
<template v-else-if="tab !== 'new'">Nothing here.</template>
|
<template v-else-if="tab !== 'new'">Nothing here.</template>
|
||||||
<template v-else-if="hiddenLow">Nothing at or above {{ minScore }}. Tick "Below {{ minScore }}" to see the rest.</template>
|
<template v-else-if="hiddenLow">Nothing at or above {{ minScore }}. Tick "Below {{ minScore }}" to see the rest.</template>
|
||||||
<template v-else-if="!leads.length">No leads yet. Add a source above, then press "Check now".</template>
|
<template v-else-if="!leads.length">No leads yet. Add a source above, then press "Check now".</template>
|
||||||
<template v-else>The inbox is empty.</template>
|
<template v-else>The inbox is empty.</template>
|
||||||
</p>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Unscoped on purpose, for the same reason as jobs-shared.css: the two child
|
|
||||||
components render the boxes these classes style, and a scoped rule stops
|
|
||||||
at a child's root element. Every selector is under .jl-root. -->
|
|
||||||
<style>
|
|
||||||
.jl-root .jl-box {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
border: 1px solid var(--color-line-soft);
|
|
||||||
border-radius: 6px;
|
|
||||||
background: var(--color-paper);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-root .jl-box-heading {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-ink-soft);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-root .jl-box-heading > span {
|
|
||||||
margin-left: 0.6rem;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-root .jl-hint {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--color-ink-faint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-root p.jl-hint {
|
|
||||||
margin: 0.5rem 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-root .jl-warn {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--color-ink-danger);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Colours are the paper palette from CVLayout.vue; buttons are .cv-btn from
|
/* Shared primitives are in assets/styles.css; this block is the page's own
|
||||||
there too, and the inputs are styled by jobs-shared.css. The frame matches
|
layout. */
|
||||||
the tracker page's (.ja-root and friends in JobApplications.vue), whose
|
.jl-sub {
|
||||||
rules are scoped to that component and so are repeated here. */
|
|
||||||
.jl-root {
|
|
||||||
padding: 1.5rem;
|
|
||||||
border-top: 2px solid var(--color-ink-soft);
|
|
||||||
background: var(--color-paper-tint);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-header {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jl-setup {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 1rem;
|
align-items: start;
|
||||||
|
margin-bottom: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-header-left,
|
@media (max-width: 1100px) {
|
||||||
.jl-header-right {
|
.jl-setup {
|
||||||
display: flex;
|
grid-template-columns: minmax(0, 1fr);
|
||||||
align-items: center;
|
}
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-back {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-back:hover {
|
|
||||||
color: var(--color-ink);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-heading {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-ink-soft);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-error {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
padding: 0.5rem 0.75rem;
|
|
||||||
border: 1px solid #b91c1c;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: #fef2f2;
|
|
||||||
color: #7f1d1d;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-tabs {
|
.jl-tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.25rem;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-tab {
|
.jl-tab {
|
||||||
display: flex;
|
display: inline-flex;
|
||||||
align-items: baseline;
|
align-items: center;
|
||||||
gap: 0.4rem;
|
gap: 0.5rem;
|
||||||
padding: 0.4rem 0.9rem;
|
margin-bottom: -1px;
|
||||||
border: 1px solid var(--color-line-soft);
|
padding: 0.6rem 0.85rem;
|
||||||
border-radius: 6px;
|
border-bottom: 2px solid transparent;
|
||||||
background: var(--color-paper);
|
color: var(--text-3);
|
||||||
color: var(--color-ink-muted);
|
font-size: 0.875rem;
|
||||||
|
font-weight: 500;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.jl-tab:hover {
|
||||||
.jl-tab-active {
|
color: var(--text);
|
||||||
border-color: var(--color-ink-soft);
|
}
|
||||||
color: var(--color-ink);
|
.jl-tab-active,
|
||||||
|
.jl-tab-active:hover {
|
||||||
|
border-bottom-color: var(--accent);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.jl-tab-active .count {
|
||||||
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-tab-count {
|
.jl-toolbar {
|
||||||
font-size: 1.05rem;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-tab-label {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-filterbar {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 0.75rem;
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-sort {
|
.jl-sort {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-check {
|
.jl-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
gap: 0.35rem;
|
gap: 0.6rem;
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
white-space: nowrap;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead {
|
.jl-lead {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.9rem;
|
gap: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
padding: 1rem 1.1rem;
|
||||||
padding: 0.7rem 0.9rem;
|
transition: border-color 0.12s;
|
||||||
border: 1px solid var(--color-line-soft);
|
}
|
||||||
border-radius: 6px;
|
.jl-lead:hover {
|
||||||
background: var(--color-paper);
|
border-color: var(--border-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-unmatched {
|
.jl-lead-unmatched {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The score reads as a number first; the tint only groups it. Same tints as
|
/* The score reads as a number first; the ring shows it out of 100 and its
|
||||||
the tracker's status pills. */
|
colour only groups it. */
|
||||||
.jl-score {
|
.jl-score {
|
||||||
flex: 0 0 2.6rem;
|
--tone: var(--text-3);
|
||||||
padding: 0.35rem 0;
|
display: grid;
|
||||||
border-radius: 6px;
|
place-items: center;
|
||||||
font-size: 1rem;
|
flex: 0 0 3rem;
|
||||||
font-weight: 600;
|
width: 3rem;
|
||||||
text-align: center;
|
height: 3rem;
|
||||||
color: var(--color-ink-soft);
|
border-radius: 50%;
|
||||||
background: var(--color-paper-shade);
|
background: conic-gradient(
|
||||||
|
var(--tone) calc(var(--arc) * 1%),
|
||||||
|
color-mix(in srgb, var(--tone) 15%, var(--surface)) 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
.jl-score > span {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 2.45rem;
|
||||||
|
height: 2.45rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--surface);
|
||||||
|
color: color-mix(in srgb, var(--tone) 80%, var(--text));
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 700;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-score-high {
|
.jl-score-high {
|
||||||
background: #dcfce7;
|
--tone: var(--ok);
|
||||||
color: #14532d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-score-mid {
|
.jl-score-mid {
|
||||||
background: #fef9c3;
|
--tone: var(--warn);
|
||||||
color: #713f12;
|
|
||||||
}
|
}
|
||||||
|
.jl-score-low {
|
||||||
.jl-score-none {
|
--tone: var(--danger);
|
||||||
color: var(--color-ink-faint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-body {
|
.jl-lead-body {
|
||||||
@@ -575,86 +567,78 @@ onBeforeUnmount(stopPolling);
|
|||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-title {
|
.jl-lead-title {
|
||||||
font-size: 0.95rem;
|
font-size: 1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--color-ink);
|
|
||||||
}
|
}
|
||||||
|
.jl-lead-title a {
|
||||||
.jl-lead-company {
|
color: var(--text);
|
||||||
margin-left: 0.5rem;
|
|
||||||
font-weight: 400;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
}
|
}
|
||||||
|
.jl-lead-title a:hover {
|
||||||
.jl-link {
|
color: var(--accent);
|
||||||
color: var(--color-ink-link);
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-link:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-lead-meta {
|
.jl-lead-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.25rem 0.9rem;
|
align-items: center;
|
||||||
|
gap: 0.2rem 0;
|
||||||
margin-top: 0.15rem;
|
margin-top: 0.15rem;
|
||||||
font-size: 0.8rem;
|
color: var(--text-3);
|
||||||
color: var(--color-ink-faint);
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
.jl-lead-meta > span + span::before {
|
||||||
|
content: "·";
|
||||||
|
margin: 0 0.5rem;
|
||||||
|
color: var(--border-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
.jl-company {
|
||||||
|
color: var(--text-2);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jl-tag {
|
||||||
|
color: var(--warn);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-reasons {
|
.jl-lead-reasons {
|
||||||
margin: 0.4rem 0 0;
|
margin-top: 0.5rem;
|
||||||
font-size: 0.85rem;
|
color: var(--text-2);
|
||||||
color: var(--color-ink-soft);
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The posting text is long, so it scrolls inside the card. */
|
|
||||||
.jl-desc {
|
.jl-desc {
|
||||||
max-height: 22rem;
|
margin-top: 0.75rem;
|
||||||
overflow: auto;
|
|
||||||
margin: 0.6rem 0 0;
|
|
||||||
padding: 0.6rem;
|
|
||||||
border: 1px solid var(--color-line-soft);
|
|
||||||
border-radius: 4px;
|
|
||||||
background: var(--color-paper-tint);
|
|
||||||
font-family: inherit;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-actions {
|
.jl-lead-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
white-space: nowrap;
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-btn-link {
|
.jl-action-on {
|
||||||
text-decoration: none;
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-empty {
|
@media (max-width: 720px) {
|
||||||
color: var(--color-ink-faint);
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
|
||||||
.jl-header,
|
|
||||||
.jl-filterbar {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-lead {
|
.jl-lead {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-body {
|
.jl-lead-body {
|
||||||
flex-basis: calc(100% - 3.5rem);
|
flex-basis: calc(100% - 4rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-lead-actions {
|
.jl-lead-actions {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.jl-lead-actions > * {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+186
-108
@@ -1,6 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* The "Quick Reference" box on `/jobs/`: reusable profile/experience snippets
|
* The "Quick reference" panel on `/jobs/`: reusable profile/experience snippets
|
||||||
* to copy into application forms, with inline editing. Rendered only by
|
* to copy into application forms, with inline editing. Rendered only by
|
||||||
* JobApplications.vue; data comes from stores/jobAppReferences.js.
|
* JobApplications.vue; data comes from stores/jobAppReferences.js.
|
||||||
*
|
*
|
||||||
@@ -8,12 +8,13 @@
|
|||||||
* so failures are emitted as `fail` (with the error) and every successful
|
* so failures are emitted as `fail` (with the error) and every successful
|
||||||
* mutation emits `ok` so the parent can clear a stale message.
|
* mutation emits `ok` so the parent can clear a stale message.
|
||||||
*
|
*
|
||||||
* Its root sits inside the parent's `.ja-root`, which jobs-shared.css relies on.
|
* It sits in a narrow column beside the table on wide screens, so each
|
||||||
|
* snippet stacks its label over its value and the add form folds away.
|
||||||
*/
|
*/
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useJobAppReferencesStore } from "@/stores/jobAppReferences";
|
import { useJobAppReferencesStore } from "@/stores/jobAppReferences";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["fail", "ok"]);
|
const emit = defineEmits(["fail", "ok"]);
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ const refForm = ref({ category: "profile", label: "", value: "" });
|
|||||||
const editingRefId = ref(null);
|
const editingRefId = ref(null);
|
||||||
const editRefForm = ref({});
|
const editRefForm = ref({});
|
||||||
const REF_CATEGORIES = ["profile", "experience"];
|
const REF_CATEGORIES = ["profile", "experience"];
|
||||||
|
const adding = ref(false);
|
||||||
|
// The snippet whose Copy button last succeeded, for a moment's tick.
|
||||||
|
const copiedId = ref(null);
|
||||||
|
let copiedTimer = null;
|
||||||
|
|
||||||
async function fetchReferences() {
|
async function fetchReferences() {
|
||||||
// The store's fetch() records its failure instead of throwing.
|
// The store's fetch() records its failure instead of throwing.
|
||||||
@@ -40,6 +45,7 @@ async function createReference() {
|
|||||||
value: refForm.value.value,
|
value: refForm.value.value,
|
||||||
});
|
});
|
||||||
refForm.value = { category: refForm.value.category, label: "", value: "" };
|
refForm.value = { category: refForm.value.category, label: "", value: "" };
|
||||||
|
adding.value = false;
|
||||||
emit("ok");
|
emit("ok");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
emit("fail", err);
|
emit("fail", err);
|
||||||
@@ -88,47 +94,105 @@ function refsByCategory(category) {
|
|||||||
return references.value.filter((r) => r.category === category);
|
return references.value.filter((r) => r.category === category);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyToClipboard(text) {
|
async function copyToClipboard(ref) {
|
||||||
navigator.clipboard.writeText(text);
|
try {
|
||||||
|
await navigator.clipboard.writeText(ref.value);
|
||||||
|
} catch {
|
||||||
|
// Clipboard access can be refused; the value is on screen to select.
|
||||||
|
emit("fail", "Could not copy — select the text and copy it by hand.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
copiedId.value = ref.id;
|
||||||
|
clearTimeout(copiedTimer);
|
||||||
|
copiedTimer = setTimeout(() => (copiedId.value = null), 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(fetchReferences);
|
onMounted(fetchReferences);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="ja-ref-section">
|
<section class="card">
|
||||||
<h3 class="ja-ref-heading">Quick Reference</h3>
|
<div class="card-header">
|
||||||
<div v-for="cat in REF_CATEGORIES" :key="cat" class="ja-ref-category">
|
<h2 class="card-title"><Icon name="bookmark" /> Quick reference</h2>
|
||||||
<h4 class="ja-ref-cat-label">{{ cat }}</h4>
|
<button
|
||||||
|
class="btn btn-ghost btn-sm"
|
||||||
|
:aria-expanded="adding"
|
||||||
|
@click="adding = !adding"
|
||||||
|
>
|
||||||
|
<Icon :name="adding ? 'x' : 'plus'" :size="14" />
|
||||||
|
{{ adding ? "Cancel" : "Add" }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form v-if="adding" class="qr-form" @submit.prevent="createReference">
|
||||||
|
<select v-model="refForm.category" class="input input-sm qr-cap" aria-label="Category">
|
||||||
|
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
|
||||||
|
{{ c }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input
|
||||||
|
v-model="refForm.label"
|
||||||
|
class="input input-sm"
|
||||||
|
placeholder="Label *"
|
||||||
|
aria-label="Label"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
v-model="refForm.value"
|
||||||
|
class="input input-sm"
|
||||||
|
rows="3"
|
||||||
|
placeholder="Value *"
|
||||||
|
aria-label="Value"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm">Add snippet</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div v-for="cat in REF_CATEGORIES" :key="cat" class="qr-category">
|
||||||
|
<h3 class="qr-cat-label">{{ cat }}</h3>
|
||||||
<div
|
<div
|
||||||
v-for="ref in refsByCategory(cat)"
|
v-for="ref in refsByCategory(cat)"
|
||||||
:key="ref.id"
|
:key="ref.id"
|
||||||
class="ja-ref-item"
|
class="qr-item"
|
||||||
>
|
>
|
||||||
<template v-if="editingRefId !== ref.id">
|
<template v-if="editingRefId !== ref.id">
|
||||||
<span class="ja-ref-label">{{ ref.label }}</span>
|
<div class="qr-text">
|
||||||
<span class="ja-ref-value" :title="ref.value">{{ ref.value }}</span>
|
<span class="qr-label">{{ ref.label }}</span>
|
||||||
<button
|
<span class="qr-value" :title="ref.value">{{ ref.value }}</span>
|
||||||
class="cv-btn cv-btn-sm"
|
</div>
|
||||||
@click="copyToClipboard(ref.value)"
|
<div class="qr-actions">
|
||||||
title="Copy"
|
<button
|
||||||
>
|
class="btn btn-ghost btn-sm btn-icon"
|
||||||
Copy
|
:class="{ 'qr-copied': copiedId === ref.id }"
|
||||||
</button>
|
:title="copiedId === ref.id ? 'Copied' : 'Copy'"
|
||||||
<button class="cv-btn cv-btn-sm" @click="startRefEdit(ref)">
|
:aria-label="`Copy ${ref.label}`"
|
||||||
Edit
|
@click="copyToClipboard(ref)"
|
||||||
</button>
|
>
|
||||||
<button
|
<Icon :name="copiedId === ref.id ? 'check' : 'copy'" />
|
||||||
class="cv-btn cv-btn-sm cv-btn-danger"
|
</button>
|
||||||
@click="deleteReference(ref)"
|
<button
|
||||||
>
|
class="btn btn-ghost btn-sm btn-icon qr-reveal"
|
||||||
Delete
|
title="Edit"
|
||||||
</button>
|
:aria-label="`Edit ${ref.label}`"
|
||||||
|
@click="startRefEdit(ref)"
|
||||||
|
>
|
||||||
|
<Icon name="pencil" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-ghost btn-danger btn-sm btn-icon qr-reveal"
|
||||||
|
title="Delete"
|
||||||
|
:aria-label="`Delete ${ref.label}`"
|
||||||
|
@click="deleteReference(ref)"
|
||||||
|
>
|
||||||
|
<Icon name="trash" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<form v-else class="qr-edit" @submit.prevent="saveRefEdit(ref.id)">
|
||||||
<select
|
<select
|
||||||
v-model="editRefForm.category"
|
v-model="editRefForm.category"
|
||||||
class="ja-input ja-input-sm ja-select"
|
class="input input-sm qr-cap"
|
||||||
|
aria-label="Category"
|
||||||
>
|
>
|
||||||
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
|
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
|
||||||
{{ c }}
|
{{ c }}
|
||||||
@@ -136,115 +200,129 @@ onMounted(fetchReferences);
|
|||||||
</select>
|
</select>
|
||||||
<input
|
<input
|
||||||
v-model="editRefForm.label"
|
v-model="editRefForm.label"
|
||||||
class="ja-input ja-input-sm"
|
class="input input-sm"
|
||||||
placeholder="Label"
|
placeholder="Label"
|
||||||
|
aria-label="Label"
|
||||||
/>
|
/>
|
||||||
<input
|
<textarea
|
||||||
v-model="editRefForm.value"
|
v-model="editRefForm.value"
|
||||||
class="ja-input ja-input-sm"
|
class="input input-sm"
|
||||||
|
rows="3"
|
||||||
placeholder="Value"
|
placeholder="Value"
|
||||||
|
aria-label="Value"
|
||||||
/>
|
/>
|
||||||
<button
|
<div class="qr-edit-actions">
|
||||||
class="cv-btn cv-btn-sm cv-btn-primary"
|
<button type="button" class="btn btn-sm" @click="cancelRefEdit">
|
||||||
@click="saveRefEdit(ref.id)"
|
Cancel
|
||||||
>
|
</button>
|
||||||
Save
|
<button type="submit" class="btn btn-primary btn-sm">Save</button>
|
||||||
</button>
|
</div>
|
||||||
<button class="cv-btn cv-btn-sm" @click="cancelRefEdit">
|
</form>
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<p v-if="!refsByCategory(cat).length" class="ja-ref-empty">
|
<p v-if="!refsByCategory(cat).length" class="hint qr-empty">
|
||||||
No {{ cat }} items yet.
|
No {{ cat }} snippets yet.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<form class="ja-ref-form" @submit.prevent="createReference">
|
</section>
|
||||||
<select v-model="refForm.category" class="ja-input ja-select">
|
|
||||||
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
|
|
||||||
{{ c }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<input
|
|
||||||
v-model="refForm.label"
|
|
||||||
class="ja-input"
|
|
||||||
placeholder="Label *"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
v-model="refForm.value"
|
|
||||||
class="ja-input"
|
|
||||||
placeholder="Value *"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Colours are the paper palette from CVLayout.vue; buttons are .cv-btn from
|
.qr-form,
|
||||||
there too, and the inputs are styled by jobs-shared.css. */
|
.qr-edit {
|
||||||
.ja-ref-section {
|
display: flex;
|
||||||
margin-bottom: 1.5rem;
|
flex-direction: column;
|
||||||
padding: 1rem;
|
gap: 0.45rem;
|
||||||
border: 1px solid var(--color-line-soft);
|
|
||||||
border-radius: 6px;
|
|
||||||
background: var(--color-paper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-heading {
|
.qr-form {
|
||||||
font-size: 1rem;
|
padding: 0.9rem 1.1rem;
|
||||||
font-weight: 600;
|
border-bottom: 1px solid var(--border);
|
||||||
margin-bottom: 0.75rem;
|
background: var(--surface-2);
|
||||||
color: var(--color-ink-soft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-category {
|
.qr-cap {
|
||||||
margin-bottom: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ja-ref-cat-label {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
margin-bottom: 0.35rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-item {
|
.qr-category {
|
||||||
|
padding: 0.75rem 0.6rem 0.6rem;
|
||||||
|
}
|
||||||
|
.qr-category + .qr-category {
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-cat-label {
|
||||||
|
padding: 0 0.5rem 0.35rem;
|
||||||
|
color: var(--text-3);
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 0.3rem 0;
|
padding: 0.45rem 0.5rem;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
}
|
||||||
|
.qr-item:hover {
|
||||||
|
background: var(--surface-2);
|
||||||
|
}
|
||||||
|
.qr-item:has(.qr-edit) {
|
||||||
|
display: block;
|
||||||
|
background: var(--accent-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-label {
|
.qr-text {
|
||||||
font-size: 0.85rem;
|
display: flex;
|
||||||
font-weight: 500;
|
flex-direction: column;
|
||||||
color: var(--color-ink-soft);
|
|
||||||
min-width: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ja-ref-value {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-label {
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-value {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
color: var(--text-2);
|
||||||
|
font-size: 0.8125rem;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-empty {
|
.qr-actions {
|
||||||
font-size: 0.8rem;
|
display: flex;
|
||||||
color: var(--color-ink-faint);
|
flex: none;
|
||||||
margin: 0.2rem 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ja-ref-form {
|
/* Edit and delete wait for a hover so the column reads as a list of values;
|
||||||
|
on touch screens, which have no hover, they are always there. */
|
||||||
|
@media (hover: hover) {
|
||||||
|
.qr-reveal {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.qr-item:hover .qr-reveal,
|
||||||
|
.qr-reveal:focus-visible {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-copied {
|
||||||
|
color: var(--ok);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qr-edit-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
justify-content: flex-end;
|
||||||
margin-top: 0.75rem;
|
gap: 0.4rem;
|
||||||
flex-wrap: wrap;
|
}
|
||||||
|
|
||||||
|
.qr-empty {
|
||||||
|
padding: 0 0.5rem 0.25rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
import { ref, computed, watch, onMounted } from "vue";
|
import { ref, computed, watch, onMounted } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
|
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["fail", "ok"]);
|
const emit = defineEmits(["fail", "ok"]);
|
||||||
|
|
||||||
@@ -66,44 +66,46 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<details class="jl-box" :open="isEmpty">
|
<details class="card disclosure" :open="isEmpty">
|
||||||
<summary class="jl-box-heading">
|
<summary>
|
||||||
Search profile
|
<Icon name="sparkles" />
|
||||||
<span v-if="isEmpty" class="jl-warn">empty — leads will not be scored</span>
|
<span class="card-title">Search profile</span>
|
||||||
|
<span v-if="isEmpty" class="warn">Empty — leads will not be scored</span>
|
||||||
|
<span v-else-if="profile" class="hint">Hiding below {{ profile.minScore }}</span>
|
||||||
</summary>
|
</summary>
|
||||||
<form class="jl-profile" @submit.prevent="save">
|
<form class="sp-form" @submit.prevent="save">
|
||||||
<label class="jl-field jl-field-wide">
|
<label class="field sp-wide">
|
||||||
<span>About you and what you want</span>
|
<span>About you and what you want</span>
|
||||||
<textarea
|
<textarea
|
||||||
v-model="form.profile"
|
v-model="form.profile"
|
||||||
class="ja-input jl-textarea"
|
class="input"
|
||||||
rows="8"
|
rows="7"
|
||||||
placeholder="Experience, skills, the kind of role, level, location and working arrangement you are after. Each lead is scored against this text and nothing else."
|
placeholder="Experience, skills, the kind of role, level, location and working arrangement you are after. Each lead is scored against this text and nothing else."
|
||||||
></textarea>
|
></textarea>
|
||||||
</label>
|
</label>
|
||||||
<label class="jl-field">
|
<label class="field">
|
||||||
<span>Title must include one of</span>
|
<span>Title must include one of</span>
|
||||||
<textarea v-model="form.includeKeywords" class="ja-input jl-textarea" rows="4" placeholder="engineer developer"></textarea>
|
<textarea v-model="form.includeKeywords" class="input" rows="4" placeholder="engineer developer"></textarea>
|
||||||
</label>
|
</label>
|
||||||
<label class="jl-field">
|
<label class="field">
|
||||||
<span>Title must not include</span>
|
<span>Title must not include</span>
|
||||||
<textarea v-model="form.excludeKeywords" class="ja-input jl-textarea" rows="4" placeholder="intern principal"></textarea>
|
<textarea v-model="form.excludeKeywords" class="input" rows="4" placeholder="intern principal"></textarea>
|
||||||
</label>
|
</label>
|
||||||
<label class="jl-field">
|
<label class="field">
|
||||||
<span>Location must include one of</span>
|
<span>Location must include one of</span>
|
||||||
<textarea v-model="form.locations" class="ja-input jl-textarea" rows="4" placeholder="london remote"></textarea>
|
<textarea v-model="form.locations" class="input" rows="4" placeholder="london remote"></textarea>
|
||||||
</label>
|
</label>
|
||||||
<p class="jl-hint jl-field-wide">
|
<p class="hint sp-wide">
|
||||||
One entry per line; an empty list is no restriction. Title keywords match whole words, so
|
One entry per line; an empty list is no restriction. Title keywords match whole words, so
|
||||||
"intern" does not exclude "Internal". Only leads that pass are shown and scored.
|
"intern" does not exclude "Internal". Only leads that pass are shown and scored.
|
||||||
</p>
|
</p>
|
||||||
<div class="jl-profile-actions jl-field-wide">
|
<div class="sp-actions sp-wide">
|
||||||
<label class="jl-inline">
|
<label class="sp-inline">
|
||||||
Hide leads scoring below
|
Hide leads scoring below
|
||||||
<input v-model="form.minScore" class="ja-input jl-num" type="number" min="0" max="100" />
|
<input v-model="form.minScore" class="input input-sm sp-num" type="number" min="0" max="100" />
|
||||||
</label>
|
</label>
|
||||||
<button type="button" class="cv-btn cv-btn-sm" :disabled="!dirty || saving" @click="reset">Reset</button>
|
<button type="button" class="btn btn-sm" :disabled="!dirty || saving" @click="reset">Reset</button>
|
||||||
<button type="submit" class="cv-btn cv-btn-sm cv-btn-primary" :disabled="!dirty || saving">
|
<button type="submit" class="btn btn-primary btn-sm" :disabled="!dirty || saving">
|
||||||
{{ saving ? "Saving…" : "Save" }}
|
{{ saving ? "Saving…" : "Save" }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -112,56 +114,42 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* The box and its heading (.jl-box, .jl-box-heading, .jl-hint, .jl-warn) are
|
.sp-form {
|
||||||
in JobLeads.vue's unscoped block, shared with JobSources.vue. */
|
|
||||||
.jl-profile {
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: 0.75rem;
|
gap: 0.9rem;
|
||||||
margin-top: 0.75rem;
|
padding: 1rem 1.1rem 1.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-field {
|
.sp-wide {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.25rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-field-wide {
|
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-textarea {
|
.sp-actions {
|
||||||
resize: vertical;
|
|
||||||
font-family: inherit;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-profile-actions {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-inline {
|
.sp-inline {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
font-size: 0.8rem;
|
color: var(--text-2);
|
||||||
color: var(--color-ink-muted);
|
font-size: 0.8125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-num {
|
.sp-num {
|
||||||
flex: 0 0 4.5rem;
|
width: 4.5rem;
|
||||||
min-width: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.jl-profile {
|
.sp-form {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
.sp-actions {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+134
-77
@@ -16,7 +16,7 @@
|
|||||||
import { ref, computed, onMounted } from "vue";
|
import { ref, computed, onMounted } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useJobSourcesStore } from "@/stores/jobSources";
|
import { useJobSourcesStore } from "@/stores/jobSources";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["fail", "ok"]);
|
const emit = defineEmits(["fail", "ok"]);
|
||||||
|
|
||||||
@@ -89,111 +89,168 @@ onMounted(fetchSources);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<details class="jl-box" :open="!sources.length">
|
<details class="card disclosure" :open="!sources.length">
|
||||||
<summary class="jl-box-heading">
|
<summary>
|
||||||
Sources
|
<Icon name="globe" />
|
||||||
<span class="jl-hint">{{ sources.filter((s) => s.enabled).length }} watched</span>
|
<span class="card-title">Sources</span>
|
||||||
<span v-if="sources.some((s) => s.lastError)" class="jl-warn">one or more failing</span>
|
<span class="hint">{{ sources.filter((s) => s.enabled).length }} watched</span>
|
||||||
|
<span v-if="sources.some((s) => s.lastError)" class="warn">One or more failing</span>
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
<div v-for="source in sources" :key="source.id" class="jl-source" :class="{ 'jl-source-off': !source.enabled }">
|
<ul v-if="sources.length" class="src-list">
|
||||||
<span class="jl-source-kind">{{ kindOf(source.kind).label }}</span>
|
<li v-for="source in sources" :key="source.id" class="src" :class="{ 'src-off': !source.enabled }">
|
||||||
<span class="jl-source-label">{{ source.label }}</span>
|
<span
|
||||||
<span class="jl-source-what" :title="describe(source)">{{ describe(source) }}</span>
|
class="dot"
|
||||||
<span v-if="source.lastError" class="jl-warn jl-source-status" :title="source.lastError">{{ source.lastError }}</span>
|
:class="source.lastError ? 'dot-warn' : source.enabled ? 'dot-ok' : ''"
|
||||||
<span v-else class="jl-hint jl-source-status">{{ lastPoll(source) }}</span>
|
:title="source.lastError ? 'Failing' : source.enabled ? 'Watching' : 'Paused'"
|
||||||
<button class="cv-btn cv-btn-sm" @click="toggleEnabled(source)">
|
></span>
|
||||||
{{ source.enabled ? "Pause" : "Resume" }}
|
<div class="src-text">
|
||||||
</button>
|
<div class="src-top">
|
||||||
<button class="cv-btn cv-btn-sm cv-btn-danger" @click="deleteSource(source)">Delete</button>
|
<span class="src-label">{{ source.label }}</span>
|
||||||
</div>
|
<span class="src-kind">{{ kindOf(source.kind).label }}</span>
|
||||||
<p v-if="!sources.length" class="jl-hint">
|
</div>
|
||||||
|
<div class="src-what" :title="describe(source)">{{ describe(source) }}</div>
|
||||||
|
<div v-if="source.lastError" class="warn src-status" :title="source.lastError">{{ source.lastError }}</div>
|
||||||
|
<div v-else class="hint src-status">{{ lastPoll(source) }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="src-actions">
|
||||||
|
<button
|
||||||
|
class="btn btn-ghost btn-sm btn-icon"
|
||||||
|
:title="source.enabled ? 'Pause' : 'Resume'"
|
||||||
|
:aria-label="`${source.enabled ? 'Pause' : 'Resume'} ${source.label}`"
|
||||||
|
@click="toggleEnabled(source)"
|
||||||
|
>
|
||||||
|
<Icon :name="source.enabled ? 'pause' : 'play'" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-ghost btn-danger btn-sm btn-icon"
|
||||||
|
title="Delete"
|
||||||
|
:aria-label="`Delete ${source.label}`"
|
||||||
|
@click="deleteSource(source)"
|
||||||
|
>
|
||||||
|
<Icon name="trash" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p v-else class="hint src-none">
|
||||||
Nothing is being watched. Add a company's job board, or a keyword search, below.
|
Nothing is being watched. Add a company's job board, or a keyword search, below.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form class="jl-source-form" @submit.prevent="createSource">
|
<form class="src-form" @submit.prevent="createSource">
|
||||||
<select v-model="form.kind" class="ja-input ja-select">
|
<select v-model="form.kind" class="input input-sm src-kind-select" aria-label="Source kind">
|
||||||
<option v-for="k in KINDS" :key="k.value" :value="k.value">{{ k.label }}</option>
|
<option v-for="k in KINDS" :key="k.value" :value="k.value">{{ k.label }}</option>
|
||||||
</select>
|
</select>
|
||||||
<template v-if="formKind.board">
|
<template v-if="formKind.board">
|
||||||
<input v-model="form.label" class="ja-input" placeholder="Company name *" required />
|
<input v-model="form.label" class="input input-sm" placeholder="Company name *" aria-label="Company name" required />
|
||||||
<input v-model="form.token" class="ja-input" :placeholder="`Board slug * — ${formKind.hint}`" required />
|
<input v-model="form.token" class="input input-sm" :placeholder="`Board slug * — ${formKind.hint}`" aria-label="Board slug" required />
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<input v-model="form.query" class="ja-input" placeholder="Keywords * — e.g. golang backend" required />
|
<input v-model="form.query" class="input input-sm" placeholder="Keywords * — e.g. golang backend" aria-label="Keywords" required />
|
||||||
<input v-model="form.location" class="ja-input" placeholder="Location — e.g. London" />
|
<input v-model="form.location" class="input input-sm" placeholder="Location — e.g. London" aria-label="Location" />
|
||||||
</template>
|
</template>
|
||||||
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
|
<button type="submit" class="btn btn-primary btn-sm">
|
||||||
|
<Icon name="plus" :size="14" />
|
||||||
|
Add
|
||||||
|
</button>
|
||||||
|
<p v-if="!formKind.board" class="hint src-wide">
|
||||||
|
{{ formKind.label }} needs its API key set under Admin → Environment → Job leads.
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<p v-if="!formKind.board" class="jl-hint">
|
|
||||||
{{ formKind.label }} needs its API key set under Admin → Environment → Job leads.
|
|
||||||
</p>
|
|
||||||
</details>
|
</details>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* The box and its heading (.jl-box, .jl-box-heading, .jl-hint, .jl-warn) are
|
.src-list {
|
||||||
in JobLeads.vue's unscoped block, shared with JobSearchProfile.vue. */
|
margin: 0;
|
||||||
.jl-source {
|
padding: 0.4rem 0.6rem;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 0.6rem;
|
gap: 0.75rem;
|
||||||
padding: 0.3rem 0;
|
padding: 0.55rem 0.5rem;
|
||||||
font-size: 0.85rem;
|
border-radius: var(--radius-sm);
|
||||||
|
}
|
||||||
|
.src:hover {
|
||||||
|
background: var(--surface-2);
|
||||||
|
}
|
||||||
|
.src > .dot {
|
||||||
|
margin-top: 0.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-source:first-of-type {
|
.src-off {
|
||||||
margin-top: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-source-off {
|
|
||||||
opacity: 0.55;
|
opacity: 0.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-source-kind {
|
.src-text {
|
||||||
flex: 0 0 6.5rem;
|
flex: 1;
|
||||||
color: var(--color-ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-source-label {
|
|
||||||
flex: 0 0 9rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--color-ink-soft);
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-source-what {
|
|
||||||
flex: 1 1 6rem;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jl-source-status {
|
.src-top {
|
||||||
flex: 1 1 10rem;
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jl-source-form {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
margin-top: 0.75rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
.src-label {
|
||||||
.jl-source {
|
font-weight: 600;
|
||||||
flex-wrap: wrap;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.jl-source-status {
|
.src-kind {
|
||||||
flex-basis: 100%;
|
color: var(--text-3);
|
||||||
text-align: left;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.src-what,
|
||||||
|
.src-status {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-what {
|
||||||
|
color: var(--text-2);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-status {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-actions {
|
||||||
|
display: flex;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-none {
|
||||||
|
padding: 1rem 1.1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-form {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
padding: 0.9rem 1.1rem 1.1rem;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-none + .src-form {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-form > .input {
|
||||||
|
flex: 1 1 11rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-form > .src-kind-select {
|
||||||
|
flex: 0 0 9.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-wide {
|
||||||
|
flex-basis: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+154
-132
@@ -15,9 +15,8 @@
|
|||||||
* panel.
|
* panel.
|
||||||
*/
|
*/
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { RouterLink } from "vue-router";
|
|
||||||
import { api } from "@/api";
|
import { api } from "@/api";
|
||||||
import "./jobs-shared.css";
|
import Icon from "@/components/Icon.vue";
|
||||||
|
|
||||||
const error = ref("");
|
const error = ref("");
|
||||||
const busy = ref(false);
|
const busy = ref(false);
|
||||||
@@ -130,162 +129,185 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="ja-root st-root">
|
<div class="page st-page">
|
||||||
<div class="ja-header">
|
<header class="page-header">
|
||||||
<div class="ja-header-left">
|
<div>
|
||||||
<RouterLink to="/" class="ja-back">← Tracker</RouterLink>
|
<h1 class="page-title">Settings</h1>
|
||||||
<h2 class="ja-heading">Settings</h2>
|
<p class="page-sub">
|
||||||
|
The capture script's token and the email pipeline. API keys, the mailbox and the
|
||||||
|
timers are the container's environment, on the main site's admin panel.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div v-if="error" class="alert" role="alert">
|
||||||
|
<span>{{ error }}</span>
|
||||||
|
<button
|
||||||
|
class="btn btn-ghost btn-sm btn-icon"
|
||||||
|
title="Dismiss"
|
||||||
|
aria-label="Dismiss"
|
||||||
|
@click="error = ''"
|
||||||
|
>
|
||||||
|
<Icon name="x" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p v-if="error" class="ja-error" @click="error = ''">{{ error }}</p>
|
<section class="card">
|
||||||
|
<div class="card-header">
|
||||||
<section class="st-box">
|
<h2 class="card-title"><Icon name="key" /> Job capture</h2>
|
||||||
<h3 class="st-heading">Job capture</h3>
|
<span v-if="capture" class="st-state">
|
||||||
<p class="st-hint">
|
<span class="dot" :class="{ 'dot-ok': capture.set }"></span>
|
||||||
The credential for the
|
{{ capture.set ? "Active" : "Off" }}
|
||||||
<a :href="userscriptUrl" target="_blank" rel="noopener">job capture userscript</a>.
|
</span>
|
||||||
Generate one, then paste it into the script's <em>Configure job capture</em> menu
|
</div>
|
||||||
command. Only a hash is stored, so it takes effect at once and cannot be recovered —
|
<div class="card-body st-body">
|
||||||
generate again to replace it.
|
<p class="st-text">
|
||||||
</p>
|
The credential for the
|
||||||
<template v-if="capture">
|
<a :href="userscriptUrl" target="_blank" rel="noopener">job capture userscript</a>.
|
||||||
<p class="st-hint">
|
Generate one, then paste it into the script's <em>Configure job capture</em> menu
|
||||||
<template v-if="capture.set">
|
command. Only a hash is stored, so it takes effect at once and cannot be recovered —
|
||||||
Active, generated {{ new Date(capture.createdAt).toLocaleString() }}.
|
generate again to replace it.
|
||||||
</template>
|
|
||||||
<template v-else>No token: capture is switched off.</template>
|
|
||||||
</p>
|
</p>
|
||||||
<div v-if="newToken" class="st-secret">
|
<template v-if="capture">
|
||||||
<p class="st-hint">Copy this now. It will not be shown again.</p>
|
<p class="hint">
|
||||||
<code class="st-token">{{ newToken }}</code>
|
<template v-if="capture.set">
|
||||||
<button class="cv-btn cv-btn-sm" @click="copyToken">
|
Generated {{ new Date(capture.createdAt).toLocaleString() }}.
|
||||||
{{ copied ? "Copied" : "Copy" }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="st-actions">
|
|
||||||
<button class="cv-btn" :disabled="busy" @click="generate">
|
|
||||||
{{ capture.set ? "Regenerate" : "Generate token" }}
|
|
||||||
</button>
|
|
||||||
<button v-if="capture.set" class="cv-btn cv-btn-danger" :disabled="busy" @click="revoke">
|
|
||||||
Revoke
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="st-box">
|
|
||||||
<h3 class="st-heading">Email</h3>
|
|
||||||
<template v-if="email">
|
|
||||||
<p v-if="!email.backend" class="st-hint">
|
|
||||||
Not configured: set <code>EMAIL_BACKEND</code> to <code>graph</code> or
|
|
||||||
<code>imap</code> and the matching credentials.
|
|
||||||
</p>
|
|
||||||
<template v-else>
|
|
||||||
<p class="st-hint">
|
|
||||||
Reading mail over <strong>{{ email.backend === "graph" ? "Microsoft Graph" : "IMAP" }}</strong>.
|
|
||||||
<template v-if="email.ready">
|
|
||||||
{{ email.enabled ? "Syncs on a timer." : "The timer is off; sync by hand below." }}
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="email.authUrl">Not signed in yet.</template>
|
<template v-else>No token: capture is switched off.</template>
|
||||||
<template v-else>Not ready: check the tracker's log.</template>
|
|
||||||
</p>
|
|
||||||
<p v-if="email.authUrl" class="st-hint">
|
|
||||||
<a :href="email.authUrl" rel="noopener">Sign in to Microsoft</a>. After signing in,
|
|
||||||
restart the tracker so the timer picks the session up; "Sync now" works at once.
|
|
||||||
</p>
|
</p>
|
||||||
|
<div v-if="newToken" class="st-secret">
|
||||||
|
<p class="st-secret-note">Copy this now. It will not be shown again.</p>
|
||||||
|
<div class="st-secret-row">
|
||||||
|
<code class="st-token">{{ newToken }}</code>
|
||||||
|
<button class="btn btn-sm" @click="copyToken">
|
||||||
|
<Icon :name="copied ? 'check' : 'copy'" :size="14" />
|
||||||
|
{{ copied ? "Copied" : "Copy" }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="st-actions">
|
<div class="st-actions">
|
||||||
<button class="cv-btn" :disabled="busy || !email.ready" @click="syncNow">
|
<button class="btn" :class="{ 'btn-primary': !capture.set }" :disabled="busy" @click="generate">
|
||||||
{{ busy ? "Syncing…" : "Sync now" }}
|
<Icon :name="capture.set ? 'refresh' : 'key'" />
|
||||||
|
{{ capture.set ? "Regenerate" : "Generate token" }}
|
||||||
|
</button>
|
||||||
|
<button v-if="capture.set" class="btn btn-danger" :disabled="busy" @click="revoke">
|
||||||
|
Revoke
|
||||||
</button>
|
</button>
|
||||||
<span class="st-hint">{{ syncResult }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2 class="card-title"><Icon name="mail" /> Email</h2>
|
||||||
|
<span v-if="email" class="st-state">
|
||||||
|
<span class="dot" :class="email.ready ? 'dot-ok' : email.backend ? 'dot-warn' : ''"></span>
|
||||||
|
{{ email.ready ? "Connected" : email.backend ? "Not ready" : "Not configured" }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body st-body">
|
||||||
|
<template v-if="email">
|
||||||
|
<p v-if="!email.backend" class="st-text">
|
||||||
|
Not configured: set <code>EMAIL_BACKEND</code> to <code>graph</code> or
|
||||||
|
<code>imap</code> and the matching credentials.
|
||||||
|
</p>
|
||||||
|
<template v-else>
|
||||||
|
<p class="st-text">
|
||||||
|
Reading mail over <strong>{{ email.backend === "graph" ? "Microsoft Graph" : "IMAP" }}</strong>.
|
||||||
|
<template v-if="email.ready">
|
||||||
|
{{ email.enabled ? "Syncs on a timer." : "The timer is off; sync by hand below." }}
|
||||||
|
</template>
|
||||||
|
<template v-else-if="email.authUrl">Not signed in yet.</template>
|
||||||
|
<template v-else>Not ready: check the tracker's log.</template>
|
||||||
|
</p>
|
||||||
|
<p v-if="email.authUrl" class="st-text">
|
||||||
|
<a :href="email.authUrl" rel="noopener">Sign in to Microsoft</a>. After signing in,
|
||||||
|
restart the tracker so the timer picks the session up; "Sync now" works at once.
|
||||||
|
</p>
|
||||||
|
<div class="st-actions">
|
||||||
|
<button class="btn" :disabled="busy || !email.ready" @click="syncNow">
|
||||||
|
<span v-if="busy" class="spinner" aria-hidden="true"></span>
|
||||||
|
<Icon v-else name="refresh" />
|
||||||
|
{{ busy ? "Syncing…" : "Sync now" }}
|
||||||
|
</button>
|
||||||
|
<span class="hint">{{ syncResult }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<p v-else class="hint">Loading…</p>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Page frame, matching JobApplications.vue's (scoped there). */
|
.st-page {
|
||||||
.ja-root {
|
max-width: 820px;
|
||||||
padding: 1.5rem;
|
margin: 0;
|
||||||
border-top: 2px solid var(--color-ink-soft);
|
|
||||||
background: var(--color-paper-tint);
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
.ja-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
.ja-header-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
.ja-back {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.ja-back:hover {
|
|
||||||
color: var(--color-ink);
|
|
||||||
}
|
|
||||||
.ja-heading {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--color-ink-soft);
|
|
||||||
}
|
|
||||||
.ja-error {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
padding: 0.5rem 0.75rem;
|
|
||||||
border: 1px solid #b91c1c;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: #fef2f2;
|
|
||||||
color: #7f1d1d;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.st-box {
|
.st-page > .card + .card {
|
||||||
background: var(--color-paper);
|
margin-top: 1.25rem;
|
||||||
border: 1px solid var(--color-line-soft);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 1rem 1.25rem;
|
|
||||||
margin-bottom: 1.25rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.6rem;
|
|
||||||
}
|
}
|
||||||
.st-heading {
|
|
||||||
font-size: 1.1rem;
|
.st-state {
|
||||||
}
|
display: inline-flex;
|
||||||
.st-hint {
|
|
||||||
color: var(--color-ink-muted);
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
.st-hint a {
|
|
||||||
color: var(--color-ink-link);
|
|
||||||
}
|
|
||||||
.st-secret {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 0.6rem;
|
color: var(--text-2);
|
||||||
background: var(--color-paper-tint);
|
font-size: 0.8125rem;
|
||||||
border-radius: 4px;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.st-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.st-text {
|
||||||
|
color: var(--text-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.st-secret {
|
||||||
|
padding: 0.85rem 1rem;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: color-mix(in srgb, var(--warn) 8%, var(--surface));
|
||||||
|
}
|
||||||
|
|
||||||
|
.st-secret-note {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
color: color-mix(in srgb, var(--warn) 75%, var(--text));
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.st-secret-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
.st-token {
|
.st-token {
|
||||||
font-size: 0.85rem;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 0.4rem 0.6rem;
|
||||||
|
background: var(--surface);
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
color: var(--color-ink);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.st-actions {
|
.st-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 0.6rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.st-secret-row {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* Form controls shared by the job tracker's components (JobApplications.vue and
|
|
||||||
* the JobReferences / JobApplicationForm components it renders).
|
|
||||||
*
|
|
||||||
* These lived in JobApplications.vue's scoped block until the page was split.
|
|
||||||
* Scoped styles stop at a child component's root element, so the inputs inside
|
|
||||||
* the children would have lost them; this file is imported by each component
|
|
||||||
* instead. It is unscoped, so every selector is prefixed with the page's
|
|
||||||
* `.ja-root` class — which also keeps the specificity at (0,2,0), the same as
|
|
||||||
* the scoped originals, so they still beat CVLayout's `.cv-layout input`.
|
|
||||||
*
|
|
||||||
* Colours are the paper palette from CVLayout.vue.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.ja-root .ja-input {
|
|
||||||
padding: 0.35rem 0.6rem;
|
|
||||||
border: 1px solid var(--color-line);
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
background: var(--color-paper);
|
|
||||||
flex: 1;
|
|
||||||
min-width: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ja-root .ja-input:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: var(--color-ink-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ja-root .ja-select {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ja-root .ja-input-sm {
|
|
||||||
padding: 0.2rem 0.4rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user