feat(console): direction A redesign and one "Nowa sprawa" door
- app.css rewritten: white cards on a quiet sidebar, Inter (self-hosted, OFL), radius 16/10, light and dark tokens; dead search/stripe styles dropped - "Nowy wniosek" and "Nowy obieg" become one sidebar button: #/new asks what the case is about (a card per request type with its fields and default path, a file, a Galena document when enabled), step 2 is the matching form beside its approval path - run detail: actions in the page head (#runActs), stages as a horizontal path, details and a newest-first timeline side by side - settings: one tab per kind, the tab kept in the hash so a save lands back on it - lists: subject with kind underneath, initials beside the initiator; inbox badge in the menu - e2e: picks the request type by its card, settings by tab, actions from #runActs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
41147e1d55
commit
9f6d222f00
@@ -105,7 +105,7 @@ backend/alembic/ env + 0001_initial (pgcrypto, create_enum_types, create_all)
|
||||
+ 0005_workflow (the workflow tables + custom_field + the event log; idempotent by
|
||||
catalog; on the platform drops the local, empty module_event; refuses downgrade there)
|
||||
backend/scripts/ license_gate · deploy_check
|
||||
frontend/ index.html · app.css · app.js (no build step)
|
||||
frontend/ index.html · app.css · app.js · InterVariable.woff2 (no build step)
|
||||
Tabler icon path data vendored into app.js's ICN map (CREDITS.md)
|
||||
db/init/ 01-roles.sh (creates the app + migrator roles — local stack only)
|
||||
db/managed/ provision.sql (rendered by dredd-core; CI checks it) · README.md (managed-database runbook)
|
||||
|
||||
+2
-1
@@ -25,9 +25,10 @@ gate (`backend/scripts/license_gate.py`) fails the build on GPL, AGPL or SSPL.
|
||||
| Project | License | Why |
|
||||
|---|---|---|
|
||||
| [Open Color](https://yeun.github.io/open-color/) | MIT | the colour palette, light and dark |
|
||||
| [Inter](https://rsms.me/inter/) | SIL OFL 1.1 | the console typeface, the same file Atrium ships — self-hosted as `frontend/InterVariable.woff2` (licence beside it in `LICENSE-Inter.txt`), never loaded from a CDN |
|
||||
| [Tabler Icons](https://tabler.io/icons) | MIT | outline icon set — path data is **vendored** into `frontend/app.js`'s `ICN` map, never loaded from a CDN, because the console's CSP allows no third-party origins |
|
||||
|
||||
No framework, no bundler, no CDN: the console is `index.html` + `app.css` + `app.js`.
|
||||
No framework, no bundler, no CDN: the console is `index.html` + `app.css` + `app.js` + the font.
|
||||
|
||||
## Design credit
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@ def test_expense_happy_path(tmp_path: Path) -> None:
|
||||
go(mod, "#/settings")
|
||||
|
||||
def add(kind_title: str):
|
||||
# One tab per kind; the card only exists once its tab is the one rendered.
|
||||
mod.locator(".tabs a", has_text=kind_title).click()
|
||||
mod.locator(".card", has=mod.locator("h3", has_text=kind_title)) \
|
||||
.get_by_role("button", name="Dodaj", exact=True).click()
|
||||
mod.wait_for_selector("#modalRoot .modal")
|
||||
@@ -152,6 +154,7 @@ def test_expense_happy_path(tmp_path: Path) -> None:
|
||||
second.locator('[data-f="name"]').fill(stage2)
|
||||
second.locator('[data-f="users"]').select_option([people["dyrektor"]["id"]])
|
||||
modal_save(mod)
|
||||
expect(mod.locator("#content")).to_contain_text(f"{stage1} → {stage2}")
|
||||
|
||||
add("Typy wniosków")
|
||||
mod.fill("#sfName", type_name)
|
||||
@@ -159,12 +162,14 @@ def test_expense_happy_path(tmp_path: Path) -> None:
|
||||
mod.select_option("#sfFields", label=[amount, category])
|
||||
mod.select_option("#sfTemplate", label=tpl)
|
||||
modal_save(mod)
|
||||
expect(mod.locator("#content")).to_contain_text(f"{stage1} → {stage2}")
|
||||
expect(mod.locator("#content")).to_contain_text(type_name)
|
||||
|
||||
# ── the filer: a request on the type's default template ────────────────────────────
|
||||
filer = sign_in(browser, problems, people["wnioskodawca"]["email"], PASSWORD)
|
||||
go(filer, "#/requests/new")
|
||||
filer.select_option("#nrType", label=type_name)
|
||||
# „Nowa sprawa”: step 1 picks the request type by its card, step 2 is its form.
|
||||
go(filer, "#/new")
|
||||
filer.locator("a.choice", has_text=type_name).click()
|
||||
filer.wait_for_selector("#nrTitle")
|
||||
expect(filer.locator("#lpTemplate option:checked")).to_have_text(tpl)
|
||||
filer.fill("#nrTitle", title)
|
||||
filer.locator("#nrFields label", has_text=amount).locator("input").fill("4200")
|
||||
@@ -178,7 +183,7 @@ def test_expense_happy_path(tmp_path: Path) -> None:
|
||||
go(clerk, "#/inbox")
|
||||
clerk.get_by_role("link", name=title).click()
|
||||
clerk.wait_for_url(re.compile(re.escape(run_hash) + "$"))
|
||||
clerk.locator("#content .card .row").get_by_role("button", name="Zatwierdź", exact=True).click()
|
||||
clerk.locator("#runActs").get_by_role("button", name="Zatwierdź", exact=True).click()
|
||||
clerk.locator("#modalRoot").get_by_role("button", name="Zatwierdź", exact=True).click()
|
||||
expect(clerk.locator(".stages li.on")).to_contain_text(stage2)
|
||||
|
||||
@@ -187,7 +192,7 @@ def test_expense_happy_path(tmp_path: Path) -> None:
|
||||
go(boss, "#/inbox")
|
||||
boss.get_by_role("link", name=title).click()
|
||||
boss.wait_for_url(re.compile(re.escape(run_hash) + "$"))
|
||||
boss.locator("#content .card .row").get_by_role("button", name="Odrzuć", exact=True).click()
|
||||
boss.locator("#runActs").get_by_role("button", name="Odrzuć", exact=True).click()
|
||||
boss.fill("#raNote", note)
|
||||
boss.locator("#modalRoot").get_by_role("button", name="Odrzuć", exact=True).click()
|
||||
expect(boss.locator(".stages li.on")).to_contain_text(stage1)
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,92 @@
|
||||
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION AND CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
+351
-296
@@ -1,103 +1,106 @@
|
||||
/* Workflow console.
|
||||
/* Workflow console — direction A: white cards on a quiet sidebar, Inter, generous radius.
|
||||
UI chrome stays monochrome (near-black light / near-white dark) — buttons, emphasis, text.
|
||||
The brand is Open Color **gray #495057** (gray7 — the one tile hue no other family module wears), and it is confined to things that read as
|
||||
an identity rather than a control: the app mark, icon tiles, the avatar, the focus ring. Nav
|
||||
and toolbar glyphs stay monochrome, or the whole console turns into a colour field and nothing
|
||||
stands out.
|
||||
Semantic colour (overdue / warning / ok) is a separate axis from the brand and earns its
|
||||
place: something that needs attention has to read at a glance.
|
||||
Dark mode lightens the brand for text-weight use — a shade-8 on a near-black ground is legible
|
||||
as a filled background but too dim as a 2px stroke. */
|
||||
The brand is Open Color **gray #495057** (gray7 — the one tile hue no other family module wears),
|
||||
confined to identity: the app mark, icon tiles, the avatar, the focus ring.
|
||||
Semantic colour (ok / warn / err) is a separate axis and earns its place: something that needs
|
||||
attention has to read at a glance. */
|
||||
|
||||
/* Self-hosted like Atrium's (frontend/ui/v1 there) — the CSP allows no third-party origin. */
|
||||
@font-face {
|
||||
font-family: "Inter Variable";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("InterVariable.woff2") format("woff2");
|
||||
}
|
||||
|
||||
:root {
|
||||
--bg: #f6f7f8;
|
||||
--bg: #ffffff;
|
||||
--side: #f7f7f8;
|
||||
--surface: #ffffff;
|
||||
--surface-2: #f0f2f3;
|
||||
--surface-hover: #e9ecee;
|
||||
--border: #dfe3e6;
|
||||
--border-input: #c8ced3;
|
||||
--text: #14181b;
|
||||
--text-secondary: #4c565e;
|
||||
--text-muted: #6d7880;
|
||||
--text-faint: #98a2a9;
|
||||
--accent: #14181b;
|
||||
--surface-2: #f7f7f8;
|
||||
--surface-hover: #efeff1;
|
||||
--border: #e8e8eb;
|
||||
--border-input: #dcdce0;
|
||||
--text: #18181b;
|
||||
--text-secondary: #3f3f46;
|
||||
--text-muted: #6b6b74;
|
||||
--text-faint: #9f9fa9;
|
||||
--line-faint: #d4d4d8;
|
||||
--accent: #18181b;
|
||||
--accent-text: #ffffff;
|
||||
/* `--brand-bg` carries ICONS (3:1 against the glyph is the bar for graphics).
|
||||
`--brand-ink` is one step darker for the one filled shape that carries TEXT — the avatar's
|
||||
initials — where 4.5:1 applies. Same family, one step, rather than a second colour. */
|
||||
/* `--brand-bg` carries icons (3:1 is the bar for graphics), `--brand-ink` the avatar's initials
|
||||
(4.5:1). Same family, same shade here. */
|
||||
--brand: #495057;
|
||||
--brand-bg: #495057;
|
||||
--brand-ink: #495057;
|
||||
--brand-fg: #f8f9fa;
|
||||
|
||||
--ok: #1f7a4d;
|
||||
--ok-bg: #e7f5ee;
|
||||
--warn: #9a6200;
|
||||
--warn-bg: #fdf3e0;
|
||||
--err: #b02525;
|
||||
--err-bg: #fdeceb;
|
||||
--ok: #15803d;
|
||||
--ok-bg: #ecfdf3;
|
||||
--warn: #a15c07;
|
||||
--warn-bg: #fef6e7;
|
||||
--err: #b42318;
|
||||
--err-bg: #fef3f2;
|
||||
|
||||
--radius: 8px;
|
||||
--radius-sm: 6px;
|
||||
--shadow: 0 1px 2px rgba(20, 24, 27, .06), 0 4px 12px rgba(20, 24, 27, .05);
|
||||
--radius: 16px;
|
||||
--radius-sm: 10px;
|
||||
--shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 8px 24px rgba(24, 24, 27, .06);
|
||||
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
||||
--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
--sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #101315;
|
||||
--surface: #181c1f;
|
||||
--surface-2: #1f2427;
|
||||
--surface-hover: #272d31;
|
||||
--border: #2b3236;
|
||||
--border-input: #3a4247;
|
||||
--text: #eef1f2;
|
||||
--text-secondary: #b3bbc0;
|
||||
--text-muted: #8b959b;
|
||||
--text-faint: #69737a;
|
||||
--accent: #eef1f2;
|
||||
--accent-text: #101315;
|
||||
/* A lighter shade for stroke-weight use; the filled grounds stay put so a tile looks the
|
||||
same in both themes. */
|
||||
--bg: #0e0e10;
|
||||
--side: #131316;
|
||||
--surface: #17171a;
|
||||
--surface-2: #1d1d21;
|
||||
--surface-hover: #232328;
|
||||
--border: #2a2a2f;
|
||||
--border-input: #36363c;
|
||||
--text: #ededf0;
|
||||
--text-secondary: #c8c8ce;
|
||||
--text-muted: #a0a0aa;
|
||||
--text-faint: #6e6e78;
|
||||
--line-faint: #3f3f46;
|
||||
--accent: #ededf0;
|
||||
--accent-text: #0e0e10;
|
||||
/* A lighter shade for stroke-weight use; filled grounds stay put. */
|
||||
--brand: #ced4da;
|
||||
--brand-bg: #495057;
|
||||
--brand-ink: #495057;
|
||||
--brand-fg: #f8f9fa;
|
||||
--ok: #5cc98f;
|
||||
--ok-bg: #16281f;
|
||||
--ok-bg: #132219;
|
||||
--warn: #e8b45c;
|
||||
--warn-bg: #2a2115;
|
||||
--warn-bg: #261e12;
|
||||
--err: #f08a80;
|
||||
--err-bg: #2c1a18;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
|
||||
--err-bg: #2a1716;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #101315;
|
||||
--surface: #181c1f;
|
||||
--surface-2: #1f2427;
|
||||
--surface-hover: #272d31;
|
||||
--border: #2b3236;
|
||||
--border-input: #3a4247;
|
||||
--text: #eef1f2;
|
||||
--text-secondary: #b3bbc0;
|
||||
--text-muted: #8b959b;
|
||||
--text-faint: #69737a;
|
||||
--accent: #eef1f2;
|
||||
--accent-text: #101315;
|
||||
--bg: #0e0e10;
|
||||
--side: #131316;
|
||||
--surface: #17171a;
|
||||
--surface-2: #1d1d21;
|
||||
--surface-hover: #232328;
|
||||
--border: #2a2a2f;
|
||||
--border-input: #36363c;
|
||||
--text: #ededf0;
|
||||
--text-secondary: #c8c8ce;
|
||||
--text-muted: #a0a0aa;
|
||||
--text-faint: #6e6e78;
|
||||
--line-faint: #3f3f46;
|
||||
--accent: #ededf0;
|
||||
--accent-text: #0e0e10;
|
||||
--brand: #ced4da;
|
||||
--brand-bg: #495057;
|
||||
--brand-ink: #495057;
|
||||
--brand-fg: #f8f9fa;
|
||||
--ok: #5cc98f;
|
||||
--ok-bg: #16281f;
|
||||
--ok-bg: #132219;
|
||||
--warn: #e8b45c;
|
||||
--warn-bg: #2a2115;
|
||||
--warn-bg: #261e12;
|
||||
--err: #f08a80;
|
||||
--err-bg: #2c1a18;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
|
||||
--err-bg: #2a1716;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
@@ -110,361 +113,408 @@ body {
|
||||
color: var(--text);
|
||||
background: var(--bg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-feature-settings: "cv11", "ss01";
|
||||
}
|
||||
|
||||
.hidden { display: none !important; }
|
||||
a { color: inherit; cursor: pointer; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
|
||||
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
|
||||
|
||||
/* ── login ─────────────────────────────────────────────────────────────── */
|
||||
#login {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: var(--bg);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
padding: 24px; background: var(--side);
|
||||
}
|
||||
.login-tools { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; }
|
||||
.login-tools .iconbtn { background: var(--surface); border: 1px solid var(--border-input); }
|
||||
.login-tools .iconbtn { background: var(--surface); border: 1px solid var(--border); }
|
||||
.login-card {
|
||||
width: 100%;
|
||||
max-width: 360px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 32px;
|
||||
box-shadow: var(--shadow);
|
||||
width: 100%; max-width: 380px;
|
||||
background: var(--surface); border: 1px solid var(--border);
|
||||
border-radius: 20px; padding: 36px; box-shadow: var(--shadow);
|
||||
}
|
||||
.login-card .logo { width: 40px; height: 40px; display: block; }
|
||||
.login-card h1 { font-size: 22px; margin: 16px 0 2px; letter-spacing: -.01em; }
|
||||
.lsub { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
|
||||
.login-card h1 { font-size: 24px; font-weight: 600; margin: 18px 0 2px; letter-spacing: -.025em; }
|
||||
.lsub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; }
|
||||
.login-card .banner { margin: 14px 0 0; }
|
||||
.login-card .btn { margin-top: 18px; width: 100%; justify-content: center; }
|
||||
.login-card .btn { margin-top: 20px; width: 100%; justify-content: center; }
|
||||
|
||||
/* ── shell ─────────────────────────────────────────────────────────────── */
|
||||
#app { display: flex; min-height: 100vh; }
|
||||
.sidebar {
|
||||
width: 232px;
|
||||
flex: none;
|
||||
background: var(--surface);
|
||||
border-right: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
width: 248px; flex: none;
|
||||
background: var(--side); border-right: 1px solid var(--border);
|
||||
display: flex; flex-direction: column;
|
||||
position: sticky; top: 0; height: 100vh;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; }
|
||||
.brand .logo { width: 26px; height: 26px; flex: none; }
|
||||
.brand .nm { font-weight: 650; letter-spacing: -.01em; font-size: 16px; }
|
||||
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
|
||||
.sidebar-foot { flex: none; border-top: 1px solid var(--border); padding-bottom: 10px; }
|
||||
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
|
||||
.brand .logo { width: 28px; height: 28px; flex: none; }
|
||||
.brand .nm { font-weight: 600; letter-spacing: -.015em; font-size: 16px; }
|
||||
.newcase { margin: 4px 14px 14px; justify-content: center; height: 40px; }
|
||||
.nav { flex: 1; overflow-y: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
|
||||
.sidebar-foot { flex: none; padding-bottom: 14px; }
|
||||
.nav-item {
|
||||
display: flex; align-items: center; gap: 10px;
|
||||
padding: 8px 10px; border-radius: var(--radius-sm);
|
||||
color: var(--text-secondary); cursor: pointer; font-size: 13.5px;
|
||||
height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
|
||||
color: var(--text-muted); cursor: pointer; font-size: 14px; font-weight: 450;
|
||||
}
|
||||
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
|
||||
.nav-item.on { background: var(--surface-2); color: var(--text); font-weight: 550; }
|
||||
.nav-item svg { flex: none; color: var(--text-muted); }
|
||||
.nav-item.on svg { color: var(--text); }
|
||||
.nav-item.on { background: var(--surface); color: var(--text); font-weight: 550;
|
||||
box-shadow: 0 0 0 1px var(--border); }
|
||||
.nav-item svg { flex: none; }
|
||||
.nav-item .cnt {
|
||||
margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums;
|
||||
background: var(--surface-hover); color: var(--text-secondary);
|
||||
border-radius: 999px; padding: 1px 7px;
|
||||
margin-left: auto; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
|
||||
background: var(--accent); color: var(--accent-text);
|
||||
border-radius: 999px; padding: 0 7px; line-height: 19px;
|
||||
}
|
||||
.nav-item .cnt.hot { background: var(--err-bg); color: var(--err); }
|
||||
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
|
||||
color: var(--text-faint); padding: 14px 10px 4px; }
|
||||
|
||||
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
||||
.topbar {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 18px; border-bottom: 1px solid var(--border);
|
||||
background: var(--surface); position: sticky; top: 0; z-index: 4;
|
||||
display: flex; align-items: center; gap: 6px;
|
||||
height: 64px; padding: 0 32px; border-bottom: 1px solid var(--border);
|
||||
background: var(--bg); position: sticky; top: 0; z-index: 4;
|
||||
}
|
||||
.spacer { flex: 1; }
|
||||
.vdiv { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
|
||||
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0;
|
||||
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0;
|
||||
overflow-x: auto; white-space: nowrap; scrollbar-width: none; color: var(--text-muted); }
|
||||
.crumb::-webkit-scrollbar { display: none; }
|
||||
.crumb b { color: var(--text); font-weight: 600; }
|
||||
.crumb .sep { color: var(--text-faint); }
|
||||
.content { padding: 22px; max-width: 1180px; width: 100%; }
|
||||
.crumb b { color: var(--text); font-weight: 550; }
|
||||
.crumb .sep { color: var(--line-faint); }
|
||||
.content { padding: 36px 40px 56px; max-width: 1240px; width: 100%; }
|
||||
|
||||
#navToggle { display: none; }
|
||||
#navScrim { display: none; }
|
||||
.appcard.m-only { display: none; }
|
||||
/* ── global search ─────────────────────────────────────────────────────── */
|
||||
/* Looks like an input, is a button: the field itself is in the overlay, so there is one place
|
||||
the query lives rather than two that can disagree. */
|
||||
.searchbar {
|
||||
display: inline-flex; align-items: center; gap: 8px;
|
||||
min-width: 210px; padding: 5px 8px 5px 10px;
|
||||
border: 1px solid var(--border-input); border-radius: var(--radius-sm);
|
||||
background: var(--bg); color: var(--text-muted);
|
||||
font: inherit; font-size: 13px; cursor: text;
|
||||
}
|
||||
.searchbar:hover { background: var(--surface-hover); }
|
||||
.searchbar .sp { flex: 1; text-align: left; }
|
||||
.searchbar kbd {
|
||||
font: inherit; font-size: 10.5px; color: var(--text-faint);
|
||||
border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px;
|
||||
}
|
||||
|
||||
/* ── controls ──────────────────────────────────────────────────────────── */
|
||||
.btn {
|
||||
display: inline-flex; align-items: center; gap: 7px;
|
||||
padding: 7px 13px; border-radius: var(--radius-sm);
|
||||
display: inline-flex; align-items: center; gap: 8px;
|
||||
height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-input); background: var(--surface);
|
||||
color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
|
||||
color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn:hover { background: var(--surface-hover); }
|
||||
/* A .btn that is an <a> because it navigates rather than acts — the sign-in link on a platform
|
||||
module's login card. Without this it picks up the global `a:hover` underline and is the one
|
||||
button in the console that behaves like a link. Same reset .nav-item and a.appcard already do. */
|
||||
/* An <a> that navigates rather than acts must not pick up the global link underline. */
|
||||
a.btn:hover { text-decoration: none; }
|
||||
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
|
||||
.btn.primary:hover { opacity: .88; }
|
||||
.btn.danger { color: var(--err); border-color: var(--border-input); }
|
||||
.btn.danger { color: var(--err); }
|
||||
.btn.danger:hover { background: var(--err-bg); }
|
||||
.btn:disabled { opacity: .5; cursor: not-allowed; }
|
||||
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
|
||||
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
|
||||
|
||||
.iconbtn {
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
width: 32px; height: 32px; border-radius: var(--radius-sm);
|
||||
width: 36px; height: 36px; border-radius: var(--radius-sm);
|
||||
border: 1px solid transparent; background: transparent;
|
||||
color: var(--text-secondary); cursor: pointer; position: relative;
|
||||
color: var(--text-muted); cursor: pointer; position: relative; flex: none;
|
||||
}
|
||||
.iconbtn:hover { background: var(--surface-hover); color: var(--text); }
|
||||
.iconbtn.txt { font: 600 11.5px/1 var(--sans); letter-spacing: .04em; }
|
||||
/* Unread badge. Semantic red — it means "something needs you", which is separate from brand. */
|
||||
.iconbtn:disabled { opacity: .35; cursor: not-allowed; }
|
||||
.iconbtn.bordered { border-color: var(--border-input); }
|
||||
.iconbtn.txt { font: 600 12px/1 var(--sans); letter-spacing: .04em; }
|
||||
/* Unread badge. Semantic red — "something needs you" is separate from brand. */
|
||||
.iconbtn .cnt {
|
||||
position: absolute; top: 1px; right: 0;
|
||||
min-width: 15px; height: 15px; padding: 0 3px;
|
||||
position: absolute; top: 3px; right: 2px;
|
||||
min-width: 16px; height: 16px; padding: 0 4px;
|
||||
border-radius: 999px; background: var(--err); color: #fff;
|
||||
font: 600 10px/15px var(--sans); text-align: center;
|
||||
font: 600 10px/16px var(--sans); text-align: center;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* Launcher — how sibling apps appear side by side once they share a shell. */
|
||||
/* Lists inside a dialog: notifications and the account sheet. */
|
||||
.applist { display: grid; gap: 8px; }
|
||||
.appcard {
|
||||
display: flex; align-items: center; gap: 12px;
|
||||
padding: 12px 14px; border: 1px solid var(--border);
|
||||
border-radius: var(--radius); background: var(--surface); color: inherit;
|
||||
border-radius: 12px; background: var(--surface); color: inherit;
|
||||
}
|
||||
a.appcard:hover, button.appcard:hover { background: var(--surface-hover); text-decoration: none; }
|
||||
button.appcard { width: 100%; font: inherit; text-align: left; cursor: pointer; }
|
||||
.appcard.on { background: var(--surface-2); }
|
||||
.appcard .ai {
|
||||
width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm);
|
||||
width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm);
|
||||
background: var(--brand-bg); color: var(--brand-fg);
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.appcard .an { font-weight: 550; }
|
||||
.appcard > svg:last-child { margin-left: auto; color: var(--text-faint); flex: none; }
|
||||
.appcard .an { font-weight: 500; }
|
||||
|
||||
.avatar {
|
||||
padding: 0; font-family: inherit; line-height: 1;
|
||||
width: 30px; height: 30px; flex: none; border-radius: 50%;
|
||||
/* --brand-ink, not --brand-bg: these are initials, and text needs 4.5:1. */
|
||||
width: 34px; height: 34px; flex: none; border-radius: 50%;
|
||||
background: var(--brand-ink); border: 1px solid transparent;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
font-size: 11.5px; font-weight: 650; color: var(--brand-fg); cursor: pointer;
|
||||
font-size: 12px; font-weight: 600; color: var(--brand-fg); cursor: pointer;
|
||||
}
|
||||
/* A person in a table row: initials beside the name. */
|
||||
.who { display: inline-flex; align-items: center; gap: 8px; }
|
||||
.who .avatar { width: 26px; height: 26px; font-size: 10.5px; cursor: default; }
|
||||
|
||||
.field { display: block; font-size: 12.5px; color: var(--text-secondary); }
|
||||
.field { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
|
||||
.field > input, .field > select, .field > textarea, .pw-field > input {
|
||||
display: block; width: 100%; margin-top: 5px;
|
||||
padding: 8px 10px; border-radius: var(--radius-sm);
|
||||
display: block; width: 100%; margin-top: 6px;
|
||||
height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-input); background: var(--surface);
|
||||
color: var(--text); font: inherit; font-size: 13.5px;
|
||||
color: var(--text); font: inherit; font-size: 14px; font-weight: 400;
|
||||
}
|
||||
.field > select[multiple] { height: auto; padding: 6px; }
|
||||
.field > input[type="file"] { padding: 8px 12px; height: auto; }
|
||||
.field > textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
|
||||
.field > input:focus, .field > select:focus, .field > textarea:focus, .pw-field > input:focus {
|
||||
outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--surface-hover);
|
||||
}
|
||||
.field > textarea { min-height: 78px; resize: vertical; }
|
||||
.pw-field { position: relative; display: block; }
|
||||
.pw-eye {
|
||||
position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
|
||||
width: 26px; height: 26px; border: 0; background: transparent;
|
||||
position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
|
||||
width: 28px; height: 28px; border: 0; background: transparent;
|
||||
color: var(--text-muted); cursor: pointer; display: inline-flex;
|
||||
align-items: center; justify-content: center;
|
||||
}
|
||||
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
||||
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
|
||||
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
|
||||
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
|
||||
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
||||
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
|
||||
/* A checkbox with its explanation, in a quiet panel. */
|
||||
.check {
|
||||
display: flex; gap: 12px; align-items: flex-start;
|
||||
padding: 14px 16px; border-radius: 12px; background: var(--surface-2); cursor: pointer;
|
||||
}
|
||||
.check input { margin-top: 2px; }
|
||||
.check b { font-weight: 550; display: block; }
|
||||
|
||||
/* ── page furniture ────────────────────────────────────────────────────── */
|
||||
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
|
||||
.page-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
|
||||
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
|
||||
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
|
||||
.page-head h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
|
||||
.page-head .sub { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
|
||||
.page-head .eyebrow { color: var(--text-muted); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
|
||||
.page-head .eyebrow a { text-decoration: underline; text-underline-offset: 3px; }
|
||||
.page-head h2 .chip { vertical-align: middle; margin-left: 10px; font-size: 12.5px; letter-spacing: 0; }
|
||||
/* `flex-wrap` on both, so a row of actions drops below the title instead of pushing the page
|
||||
sideways — a horizontally scrolling body is the one layout bug with no acceptable version. */
|
||||
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
.page-head .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
|
||||
|
||||
.card {
|
||||
background: var(--surface); border: 1px solid var(--border);
|
||||
border-radius: var(--radius); padding: 16px;
|
||||
border-radius: var(--radius); padding: 24px;
|
||||
}
|
||||
.card + .card { margin-top: 14px; }
|
||||
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; }
|
||||
.card h3 .n { color: var(--text-faint); font-weight: 500; margin-left: 6px; }
|
||||
.card + .card { margin-top: 20px; }
|
||||
.card h3 { margin: 0 0 18px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
|
||||
.card h3 .n { color: var(--text-faint); font-weight: 500; margin-left: 8px; }
|
||||
.card .intro { color: var(--text-muted); margin: -10px 0 18px; }
|
||||
/* A card whose content is a table: the table runs edge to edge. */
|
||||
.card.flush { padding: 0; overflow: hidden; }
|
||||
.card.flush > h3 { padding: 22px 24px 0; }
|
||||
|
||||
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
|
||||
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
|
||||
.tile {
|
||||
background: var(--surface); border: 1px solid var(--border);
|
||||
border-radius: var(--radius); padding: 14px 16px;
|
||||
border-radius: var(--radius); padding: 20px 22px;
|
||||
}
|
||||
a.tile { color: inherit; text-decoration: none; }
|
||||
a.tile:hover { border-color: var(--brand); }
|
||||
.tile .k { font-size: 12px; color: var(--text-muted); }
|
||||
.tile .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums;
|
||||
letter-spacing: -.02em; margin-top: 2px; }
|
||||
.tile.hot { border-color: var(--err); }
|
||||
.tile.hot .v { color: var(--err); }
|
||||
.tile.warn { border-color: var(--warn); }
|
||||
.tile.warn .v { color: var(--warn); }
|
||||
a.tile:hover { border-color: var(--accent); }
|
||||
.tile .k { font-size: 13px; color: var(--text-muted); font-weight: 500; }
|
||||
.tile .v { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums;
|
||||
letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
|
||||
|
||||
.tablewrap { overflow-x: auto; }
|
||||
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
|
||||
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
||||
th {
|
||||
text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
|
||||
color: var(--text-faint); font-weight: 600; padding: 6px 10px;
|
||||
text-align: left; font-size: 12.5px; font-weight: 500;
|
||||
color: var(--text-muted); padding: 12px 16px;
|
||||
border-bottom: 1px solid var(--border); white-space: nowrap;
|
||||
}
|
||||
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
|
||||
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
|
||||
th:first-child, td:first-child { padding-left: 24px; }
|
||||
th:last-child, td:last-child { padding-right: 24px; }
|
||||
tr:last-child td { border-bottom: 0; }
|
||||
tbody tr.click:hover { background: var(--surface-2); cursor: pointer; }
|
||||
tbody tr:hover { background: var(--surface-2); }
|
||||
tr.faint td { color: var(--text-faint); }
|
||||
td .ttl { font-weight: 550; }
|
||||
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
|
||||
td.mono { font-family: var(--mono); font-size: 12.5px; }
|
||||
td.acts-cell .row { justify-content: flex-end; flex-wrap: nowrap; }
|
||||
.mono { font-family: var(--mono); font-size: 12.5px; }
|
||||
|
||||
.chip {
|
||||
display: inline-flex; align-items: center; gap: 5px;
|
||||
padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
|
||||
background: var(--surface-2); color: var(--text-secondary);
|
||||
border: 1px solid var(--border); white-space: nowrap;
|
||||
}
|
||||
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
|
||||
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
|
||||
.chip.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
|
||||
|
||||
/* A severity stripe reads faster than a number when you are scanning a list for the one row
|
||||
that will ruin your week. */
|
||||
.stripe { border-left: 3px solid transparent; padding-left: 9px; }
|
||||
.stripe.s3 { border-left-color: var(--err); }
|
||||
.stripe.s2 { border-left-color: var(--warn); }
|
||||
.stripe.s1 { border-left-color: var(--border-input); }
|
||||
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
||||
.path { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-faint); }
|
||||
|
||||
.banner {
|
||||
padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px;
|
||||
padding: 12px 14px; border-radius: 12px; font-size: 13.5px;
|
||||
border: 1px solid var(--border); background: var(--surface-2);
|
||||
}
|
||||
.banner.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
|
||||
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
|
||||
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
|
||||
.banner + .banner, .card > .banner:first-child { margin-bottom: 12px; }
|
||||
.banner + .banner, .card > .banner:first-child, .card > h3 + .banner { margin-bottom: 14px; }
|
||||
|
||||
.empty {
|
||||
padding: 40px 20px; text-align: center; color: var(--text-muted);
|
||||
border: 1px dashed var(--border); border-radius: var(--radius); font-size: 13.5px;
|
||||
padding: 48px 20px; text-align: center; color: var(--text-muted);
|
||||
border: 1px dashed var(--line-faint); border-radius: var(--radius); font-size: 14px;
|
||||
}
|
||||
.card.flush > .empty { border: 0; }
|
||||
.faint { color: var(--text-muted); }
|
||||
.tiny { font-size: 12px; }
|
||||
.tiny { font-size: 12.5px; }
|
||||
.wrap { overflow-wrap: anywhere; }
|
||||
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
|
||||
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
||||
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
|
||||
.toolbar input, .toolbar select {
|
||||
padding: 7px 10px; border-radius: var(--radius-sm);
|
||||
height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-input); background: var(--surface);
|
||||
color: var(--text); font: inherit; font-size: 13.5px;
|
||||
color: var(--text); font: inherit; font-size: 14px;
|
||||
}
|
||||
.toolbar input[type="search"] { min-width: 220px; }
|
||||
.toolbar label.row { gap: 8px; }
|
||||
|
||||
/* ── settings tabs ─────────────────────────────────────────────────────── */
|
||||
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-bottom: 24px;
|
||||
overflow-x: auto; scrollbar-width: none; }
|
||||
.tabs::-webkit-scrollbar { display: none; }
|
||||
.tabs a {
|
||||
display: inline-flex; align-items: center; gap: 8px; padding: 0 0 12px;
|
||||
color: var(--text-muted); font-weight: 500; white-space: nowrap;
|
||||
border-bottom: 2px solid transparent; margin-bottom: -1px;
|
||||
}
|
||||
.tabs a:hover { color: var(--text); text-decoration: none; }
|
||||
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
|
||||
.tabs .n { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* ── new case: step 1, the choice ──────────────────────────────────────── */
|
||||
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
|
||||
.section-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 0 0 12px; }
|
||||
.choices + .section-label { margin-top: 32px; }
|
||||
a.choice {
|
||||
display: flex; flex-direction: column; gap: 6px;
|
||||
padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
|
||||
background: var(--surface); color: inherit; transition: border-color .15s, box-shadow .15s;
|
||||
}
|
||||
a.choice:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0, 0, 0, .06); text-decoration: none; }
|
||||
.choice .ic {
|
||||
width: 36px; height: 36px; border-radius: var(--radius-sm); margin-bottom: 8px;
|
||||
background: var(--surface-2); color: var(--text);
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.choice b { font-size: 15px; font-weight: 600; }
|
||||
.choice .d { color: var(--text-muted); font-size: 13.5px; }
|
||||
.choice .path { margin-top: 6px; font-size: 12.5px; }
|
||||
.choice .path span { color: var(--text-secondary); }
|
||||
|
||||
/* ── new case: step 2, the form beside its approval path ───────────────── */
|
||||
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
|
||||
.split .card + .card { margin-top: 0; }
|
||||
.split .side .grid2 { grid-template-columns: 1fr; }
|
||||
.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
|
||||
.preview { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
|
||||
.preview li { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
|
||||
border-radius: 12px; background: var(--surface-2); }
|
||||
.preview .num { width: 24px; height: 24px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 600;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
background: var(--surface); border: 1px solid var(--border); }
|
||||
|
||||
/* ── modal ─────────────────────────────────────────────────────────────── */
|
||||
#modalRoot:empty { display: none; }
|
||||
.scrim {
|
||||
position: fixed; inset: 0; background: rgba(0, 0, 0, .4);
|
||||
position: fixed; inset: 0; background: rgba(9, 9, 11, .45);
|
||||
display: flex; align-items: flex-start; justify-content: center;
|
||||
padding: 40px 16px; z-index: 40; overflow-y: auto;
|
||||
padding: 56px 16px; z-index: 40; overflow-y: auto;
|
||||
}
|
||||
.modal, .search-modal {
|
||||
.modal {
|
||||
background: var(--surface); border: 1px solid var(--border);
|
||||
border-radius: 10px; box-shadow: var(--shadow); width: 100%;
|
||||
border-radius: 20px; box-shadow: var(--shadow); width: 100%;
|
||||
max-width: 560px; padding: 28px;
|
||||
}
|
||||
.modal { max-width: 560px; padding: 20px; }
|
||||
.modal.wide { max-width: 760px; }
|
||||
.modal h3 { margin: 0 0 4px; font-size: 16px; }
|
||||
.modal .msub { color: var(--text-muted); font-size: 12.5px; margin-bottom: 16px; }
|
||||
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
|
||||
.modal .field + .field, .modal .grid2 + .field, .modal .field + .grid2 { margin-top: 12px; }
|
||||
.modal.wide { max-width: 780px; }
|
||||
.modal h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
|
||||
.modal .msub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; }
|
||||
.modal h3 + #modalBody { margin-top: 18px; }
|
||||
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
|
||||
.modal .field + .field, .modal .grid2 + .field, .modal .field + .grid2,
|
||||
.modal .field + .row, .modal .row + .field { margin-top: 14px; }
|
||||
/* The start screens: a form on the page rather than in a dialog. */
|
||||
.form > *, .form fieldset > *, #nrFields > * { margin-top: 12px; }
|
||||
.form > :first-child, .form fieldset > :first-child { margin-top: 0; }
|
||||
.form > *, .form fieldset > *, #nrFields > * { margin-top: 16px; }
|
||||
.form > :first-child, .form fieldset > :first-child, #nrFields > :first-child { margin-top: 0; }
|
||||
#nrFields:not(:empty) { margin-top: 16px; }
|
||||
#nrFields.grid2 > * { margin-top: 0; }
|
||||
#nrFields:empty { display: none; }
|
||||
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
|
||||
fieldset.plain:disabled { opacity: .6; }
|
||||
/* The stage editor (settings, start screens, "add a stage") and its collapsed advanced settings. */
|
||||
.stage { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 10px; min-width: 0; }
|
||||
.stage > .grid2, .stage > .field { margin-top: 10px; }
|
||||
.adv { margin-top: 14px; }
|
||||
.adv > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
|
||||
.adv > .grid2, .adv > .field, .adv > .row { margin-top: 10px; }
|
||||
/* A run's detail: its stages (the current one marked) and the timeline, one list per round. */
|
||||
.stages, .timeline { margin: 0 0 10px; padding-left: 22px; }
|
||||
.stages li, .timeline li { padding: 6px 0; }
|
||||
.stages li.on { font-weight: 600; }
|
||||
.stages li > * + * { margin-left: 8px; }
|
||||
.timeline li + li { border-top: 1px solid var(--border); }
|
||||
.tl-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
|
||||
.stage { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; min-width: 0; }
|
||||
.stage > .grid2, .stage > .field { margin-top: 12px; }
|
||||
.adv { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
|
||||
.adv > summary { cursor: pointer; font-weight: 550; font-size: 13.5px; }
|
||||
.adv > .grid2, .adv > .field, .adv > .row { margin-top: 12px; }
|
||||
.field .row { margin-top: 8px; font-weight: 400; }
|
||||
|
||||
/* ── command palette ───────────────────────────────────────────────────── */
|
||||
/* After the modal on purpose: it sits on the dialog's `.scrim` and overrides its padding at equal
|
||||
specificity by coming later. It shares the dialog's box (see `.modal, .search-modal`) but not its
|
||||
padding, so its dividers run edge to edge. It sits higher than a dialog — reached from anywhere,
|
||||
including from on top of one — and lands where the eye already is rather than centred. */
|
||||
.search-scrim { padding-top: 12vh; }
|
||||
.search-modal { max-width: 620px; overflow: hidden; }
|
||||
.search-modal .sin {
|
||||
display: flex; align-items: center; gap: 10px;
|
||||
padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted);
|
||||
/* ── run detail ────────────────────────────────────────────────────────── */
|
||||
.run-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px; }
|
||||
.run-grid .card + .card { margin-top: 20px; }
|
||||
|
||||
/* The stages as a horizontal path; the current one is ringed, the ones still ahead dashed. */
|
||||
.stages { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }
|
||||
.stages li { flex: 1; min-width: 0; position: relative; }
|
||||
.stages li:not(:last-child)::after {
|
||||
content: ""; position: absolute; top: 15px; left: 42px; right: 4px;
|
||||
height: 1px; background: var(--border);
|
||||
}
|
||||
.search-modal .sin input {
|
||||
flex: 1; border: 0; background: none; color: var(--text);
|
||||
font: inherit; font-size: 15px; outline: none; padding: 0;
|
||||
.stages .dot {
|
||||
width: 32px; height: 32px; border-radius: 50%; margin-bottom: 12px;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
font-size: 13px; font-weight: 600; background: var(--surface);
|
||||
border: 1px dashed var(--line-faint); color: var(--text-muted);
|
||||
}
|
||||
.search-results { max-height: 58vh; overflow-y: auto; overflow-x: hidden; }
|
||||
.search-results .sgroup {
|
||||
padding: 8px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
|
||||
text-transform: uppercase; color: var(--text-faint);
|
||||
.stages li.done .dot { border: 0; background: var(--ok-bg); color: var(--ok); }
|
||||
.stages li.on .dot { border: 0; background: var(--accent); color: var(--accent-text);
|
||||
box-shadow: 0 0 0 4px var(--surface-hover); }
|
||||
.stages .nm { font-weight: 600; display: block; }
|
||||
.stages li.todo .nm { color: var(--text-muted); font-weight: 500; }
|
||||
.stages .meta { font-size: 12.5px; color: var(--text-muted); display: block; margin-top: 2px; }
|
||||
.stages .you { font-size: 12.5px; color: var(--text); font-weight: 550; display: block; margin-top: 4px; }
|
||||
.round-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
|
||||
|
||||
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
|
||||
.facts .k { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
|
||||
.facts .v { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
|
||||
.lock { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px;
|
||||
border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
|
||||
|
||||
/* Newest first, on a rail; the dot's colour is what happened. */
|
||||
.timeline { list-style: none; margin: 0; padding: 0; }
|
||||
.timeline li { position: relative; padding: 0 0 22px 26px; }
|
||||
.timeline li::before {
|
||||
content: ""; position: absolute; left: 0; top: 6px;
|
||||
width: 10px; height: 10px; border-radius: 50%; background: var(--line-faint);
|
||||
box-shadow: 0 0 0 3px var(--surface);
|
||||
}
|
||||
.search-results .sitem {
|
||||
display: flex; align-items: center; gap: 10px; width: 100%;
|
||||
padding: 8px 14px; border: 0; background: none; color: var(--text);
|
||||
font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
|
||||
.timeline li:not(:last-child)::after {
|
||||
content: ""; position: absolute; left: 4.5px; top: 18px; bottom: 2px;
|
||||
width: 1px; background: var(--border);
|
||||
}
|
||||
.search-results .sitem:hover, .search-results .sitem.on { background: var(--surface-hover); }
|
||||
.search-results .sitem .ic { color: var(--text-muted); flex: none; display: flex; }
|
||||
.search-results .sitem .sb { min-width: 0; flex: 1; }
|
||||
/* Block, or the ellipsis never applies: overflow clipping needs a box, and these are spans. */
|
||||
.search-results .sitem .st, .search-results .sitem .ss { display: block; }
|
||||
.search-results .sitem .st { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.search-results .sitem .ss {
|
||||
font-size: 12px; color: var(--text-muted);
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
.timeline li:last-child { padding-bottom: 0; }
|
||||
.timeline li.k-ok::before { background: var(--ok); }
|
||||
.timeline li.k-err::before { background: var(--err); }
|
||||
.timeline li.k-warn::before { background: var(--warn); }
|
||||
.timeline li.k-start::before { background: var(--accent); }
|
||||
.timeline .what { font-weight: 550; }
|
||||
.timeline .meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
|
||||
.tl-note {
|
||||
white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 4px;
|
||||
padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
|
||||
border-left: 2px solid var(--line-faint); font-size: 13.5px;
|
||||
}
|
||||
.search-modal .shint {
|
||||
padding: 8px 14px; border-top: 1px solid var(--border);
|
||||
font-size: 11.5px; color: var(--text-faint);
|
||||
}
|
||||
.search-empty { padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
|
||||
|
||||
/* ── toast ─────────────────────────────────────────────────────────────── */
|
||||
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; }
|
||||
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; }
|
||||
.toast {
|
||||
background: var(--accent); color: var(--accent-text);
|
||||
padding: 9px 15px; border-radius: var(--radius-sm);
|
||||
font-size: 13px; box-shadow: var(--shadow);
|
||||
padding: 10px 16px; border-radius: 12px;
|
||||
font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
@@ -474,48 +524,53 @@ fieldset.plain:disabled { opacity: .6; }
|
||||
/* ── narrow screens ─────────────────────────────────────────────────────── */
|
||||
/* Breakpoints are last in the file on purpose, widest first: a media query adds no specificity, so
|
||||
an override only wins if it comes after the rule it overrides. */
|
||||
@media (max-width: 1100px) {
|
||||
.run-grid, .split { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
@media (max-width: 880px) {
|
||||
/* `visibility` as well as `transform`: a closed drawer must not be clickable or reachable by
|
||||
keyboard, and a translated-off panel still is. */
|
||||
.sidebar {
|
||||
position: fixed; z-index: 20;
|
||||
transform: translateX(-100%); visibility: hidden;
|
||||
/* Only `transform` transitions. `visibility` flips instantly in both directions, and is
|
||||
deliberately NOT delayed to animate the slide-out: any transition on visibility — even a
|
||||
0s one with a delay — needs the transition machinery to tick, and when frames are
|
||||
throttled (a background tab, a compositor that is not running) the drawer gets stuck in
|
||||
whichever state it was in. An instant close is worth more than 180ms of slide. */
|
||||
/* Only `transform` transitions. Any transition on visibility needs the transition machinery to
|
||||
tick, and when frames are throttled the drawer gets stuck in whichever state it was in. */
|
||||
transition: transform .18s;
|
||||
}
|
||||
.sidebar.open { transform: none; visibility: visible; }
|
||||
#navToggle { display: inline-flex; }
|
||||
#navScrim.on { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 19; }
|
||||
.content { padding: 16px; }
|
||||
.content { padding: 20px 16px 40px; }
|
||||
|
||||
/* Nine controls at 30px each leave the breadcrumb exactly 0 pixels. On a phone the top bar
|
||||
keeps only what you need constantly, and the rest moves into the account sheet. */
|
||||
/* On a phone the top bar keeps only what you need constantly; the rest moves into the account sheet. */
|
||||
.topbar .js-tool { display: none; }
|
||||
.appcard.m-only { display: flex; }
|
||||
.search-modal .shint { display: none; } /* no Esc key on a phone */
|
||||
.search-results { max-height: 62vh; }
|
||||
.topbar { padding: 10px 12px; gap: 6px; }
|
||||
.page-head { margin-bottom: 14px; }
|
||||
.topbar { height: 56px; padding: 0 12px; gap: 4px; }
|
||||
.page-head { margin-bottom: 20px; }
|
||||
.page-head h2 { font-size: 24px; }
|
||||
.page-head .acts { margin-left: 0; width: 100%; }
|
||||
.page-head .acts .btn { flex: 1; justify-content: center; }
|
||||
.toolbar input[type="search"] { min-width: 0; flex: 1; }
|
||||
.card { padding: 18px; }
|
||||
.card.flush > h3 { padding: 18px 18px 0; }
|
||||
.scrim { padding: 12px; }
|
||||
.search-scrim { padding-top: 8vh; }
|
||||
.modal { padding: 16px; }
|
||||
.modal { padding: 20px; }
|
||||
.modal .acts { flex-wrap: wrap; }
|
||||
.modal .acts .btn { flex: 1; justify-content: center; }
|
||||
.tile .v { font-size: 20px; }
|
||||
.tile .v { font-size: 26px; }
|
||||
.stages { flex-direction: column; gap: 16px; }
|
||||
.stages li { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; }
|
||||
.stages .dot { margin: 0; grid-row: span 3; }
|
||||
.stages li:not(:last-child)::after { display: none; }
|
||||
.facts { grid-template-columns: 1fr; }
|
||||
.form-foot .btn { flex: 1; justify-content: center; }
|
||||
}
|
||||
|
||||
/* ── phones: data tables become stacked cards ──────────────────────────── */
|
||||
@media (max-width: 640px) {
|
||||
table.rt thead { display: none; }
|
||||
table.rt, table.rt tbody, table.rt tr { display: block; width: 100%; }
|
||||
table.rt tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
|
||||
table.rt tr { padding: 12px 18px; border-bottom: 1px solid var(--border); }
|
||||
table.rt tr:last-child { border-bottom: 0; }
|
||||
table.rt td {
|
||||
display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
|
||||
@@ -523,9 +578,9 @@ fieldset.plain:disabled { opacity: .6; }
|
||||
}
|
||||
table.rt td::before {
|
||||
content: attr(data-label); flex: none; text-align: left; padding-top: 2px;
|
||||
font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
|
||||
font-size: 12px; color: var(--text-muted);
|
||||
}
|
||||
table.rt td:first-child { justify-content: flex-start; text-align: left; font-weight: 600; padding-bottom: 6px; }
|
||||
table.rt td:first-child { justify-content: flex-start; text-align: left; padding-bottom: 8px; }
|
||||
table.rt td:first-child::before, table.rt td.acts-cell::before { content: none; }
|
||||
table.rt td.acts-cell { justify-content: flex-end; padding-top: 8px; }
|
||||
table.rt td:not(:first-child) .row { justify-content: flex-end; }
|
||||
|
||||
+212
-145
@@ -155,6 +155,8 @@ const ICN = {
|
||||
up: '<path d="M12 5l0 14"/><path d="M18 11l-6 -6"/><path d="M6 11l6 -6"/>',
|
||||
// tabler: arrow-down
|
||||
down: '<path d="M12 5l0 14"/><path d="M18 13l-6 6"/><path d="M6 13l6 6"/>',
|
||||
// tabler: lock
|
||||
lock: '<path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6"/><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"/><path d="M8 11v-4a4 4 0 1 1 8 0v4"/>',
|
||||
// tabler: logout
|
||||
logout: '<path d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"/><path d="M9 12h12l-3 -3"/><path d="M18 15l3 -3"/>',
|
||||
};
|
||||
@@ -372,6 +374,23 @@ const I18N = {
|
||||
'Potwierdź przeczytaną wersję.': 'Confirm the version you read.',
|
||||
'Obieg zmienił się w międzyczasie': 'The run changed in the meantime',
|
||||
'Zmiana wniosku unieważnia dotychczasowe zatwierdzenia.': 'Changing the request voids the approvals given so far.',
|
||||
'Nowa sprawa': 'New case',
|
||||
'Krok 1 z 2': 'Step 1 of 2',
|
||||
'Krok 2 z 2': 'Step 2 of 2',
|
||||
'Czego dotyczy sprawa?': 'What is the case about?',
|
||||
'Wybierz, a pokażemy właściwy formularz i ścieżkę akceptacji.': 'Choose, and you get the right form and approval path.',
|
||||
'Dokument do zatwierdzenia': 'A document to approve',
|
||||
'Plik z komputera': 'A file from your computer',
|
||||
'Wgraj plik i ustal, kto go zatwierdza.': 'Upload a file and decide who approves it.',
|
||||
'Wybierz dokument z repozytorium kancelarii.': "Pick a document from the firm's repository.",
|
||||
'Zmień rodzaj sprawy': 'Change the kind of case',
|
||||
'Wstecz': 'Back',
|
||||
'Ścieżka obiegu': 'Approval path',
|
||||
'Bez tego pola zablokują się po złożeniu.': 'Without it the fields lock once filed.',
|
||||
'Szczegóły': 'Details',
|
||||
'czeka na Ciebie': 'waiting for you',
|
||||
'Złożono': 'Filed',
|
||||
'Szablony': 'Templates',
|
||||
};
|
||||
|
||||
let LANG = (function () {
|
||||
@@ -528,11 +547,9 @@ const isModerator = () => !!(state.user && state.user.is_moderator);
|
||||
hiding them is only about not offering a door that answers 403. */
|
||||
const NAV = [
|
||||
{ hash: '#/', icon: 'dashboard', label: 'Pulpit' },
|
||||
{ hash: '#/inbox', icon: 'inbox', label: 'Czeka na mnie' },
|
||||
{ hash: '#/inbox', icon: 'inbox', label: 'Czeka na mnie', badge: 'inbox' },
|
||||
{ hash: '#/mine', icon: 'folder', label: 'Moje' },
|
||||
{ hash: '#/archive', icon: 'archive', label: 'Archiwum' },
|
||||
{ hash: '#/requests/new', icon: 'file', label: 'Nowy wniosek' },
|
||||
{ hash: '#/runs/new', icon: 'plus', label: 'Nowy obieg' },
|
||||
{ hash: '#/settings', icon: 'settings', label: 'Ustawienia', mod: true },
|
||||
];
|
||||
|
||||
@@ -565,8 +582,9 @@ function pageHead(title, sub, actions) {
|
||||
return `<div class="page-head"><div><h2>${esc(title)}</h2>${sub ? `<div class="sub">${esc(sub)}</div>` : ''}</div>${actions ? `<div class="acts">${actions}</div>` : ''}</div>`;
|
||||
}
|
||||
|
||||
function field(label, value) {
|
||||
return `<div><div class="tiny faint">${esc(label)}</div><div data-no-i18n>${value == null || value === '' ? '—' : esc(String(value))}</div></div>`;
|
||||
/* One fact of a run's subject: a label in the console's words over a value that is people's text. */
|
||||
function field(label, value, cls) {
|
||||
return `<div><div class="k">${esc(label)}</div><div class="v${cls ? ' ' + cls : ''}" data-no-i18n>${value == null || value === '' ? '—' : esc(String(value))}</div></div>`;
|
||||
}
|
||||
|
||||
function parseHash() {
|
||||
@@ -587,15 +605,17 @@ async function router() {
|
||||
const path = seg.join('/');
|
||||
C.innerHTML = '<div class="faint">Wczytywanie…</div>';
|
||||
refreshNotes();
|
||||
refreshCounts();
|
||||
try {
|
||||
if (!seg.length) await viewDashboard(C);
|
||||
else if (path === 'inbox') await viewList(C, '/inbox', 'Czeka na mnie');
|
||||
else if (path === 'mine') await viewList(C, '/mine', 'Moje');
|
||||
else if (path === 'archive') await viewArchive(C, q);
|
||||
else if (path === 'requests/new') await viewNewRequest(C);
|
||||
else if (path === 'runs/new') await viewNewRun(C);
|
||||
else if (path === 'new') await viewNewCase(C);
|
||||
else if (path === 'requests/new') await viewNewRequest(C, q);
|
||||
else if (path === 'runs/new') await viewNewRun(C, q);
|
||||
else if (seg[0] === 'runs' && seg.length === 2) await viewRun(C, seg[1]);
|
||||
else if (path === 'settings' && isModerator()) await viewSettings(C);
|
||||
else if (path === 'settings' && isModerator()) await viewSettings(C, q);
|
||||
else if (seg[0] === 'admin') await viewAdmin(C);
|
||||
else C.innerHTML = '<div class="empty">Nie znaleziono strony.</div>';
|
||||
} catch (ex) {
|
||||
@@ -612,10 +632,22 @@ async function router() {
|
||||
the stats contract keeps the number and the screen behind it equal. */
|
||||
async function viewDashboard(C) {
|
||||
setCrumb([{ label: 'Pulpit' }]);
|
||||
const stats = await api('GET', '/stats');
|
||||
const [stats, inbox] = await Promise.all([api('GET', '/stats'), api('GET', '/inbox')]);
|
||||
C.innerHTML = pageHead('Pulpit', state.user.full_name || state.user.email)
|
||||
+ `<div class="tiles">${stats.tiles.map((t) => `<a class="tile" href="#/${esc(t.link)}">
|
||||
<div class="k">${esc(t.label)}</div><div class="v">${esc(t.count)}</div></a>`).join('')}</div>`;
|
||||
<div class="k">${esc(t.label)}</div><div class="v">${esc(t.count)}</div></a>`).join('')}</div>`
|
||||
+ `<div class="card flush"><h3>Czeka na mnie</h3>${runTable(inbox)}</div>`;
|
||||
}
|
||||
|
||||
/* The inbox badge in the menu: the same /stats tile the dashboard shows. Never awaited, never
|
||||
fatal, like the notification badge. */
|
||||
async function refreshCounts() {
|
||||
try {
|
||||
const stats = await api('GET', '/stats');
|
||||
const t = stats.tiles.find((x) => x.link === 'inbox');
|
||||
state.counts = { inbox: t ? t.count : 0 };
|
||||
} catch { return; }
|
||||
renderNav(state.counts);
|
||||
}
|
||||
|
||||
/* ── runs: lists ────────────────────────────────────────────────────────── */
|
||||
@@ -642,16 +674,17 @@ function typeName(key) {
|
||||
function runTable(rows) {
|
||||
if (!rows.length) return '<div class="empty">Brak wyników</div>';
|
||||
return `<div class="tablewrap"><table class="rt"><thead><tr>
|
||||
<th>Przedmiot</th><th>Rodzaj</th><th>Etap</th><th>Stan</th><th>Inicjator</th><th>Rozpoczęto</th>
|
||||
<th>Przedmiot</th><th>Etap</th><th>Stan</th><th>Inicjator</th><th>Rozpoczęto</th>
|
||||
</tr></thead><tbody>${rows.map((r) => {
|
||||
const [label, cls] = RUN_STATE[r.state] || [r.state, ''];
|
||||
const who = userName(r.started_by);
|
||||
return `<tr>
|
||||
<td class="wrap" data-no-i18n><a href="#/runs/${esc(r.id)}">${esc(r.title)}</a></td>
|
||||
<td${lbl('Rodzaj')}><div>${esc(KIND[r.subject_kind] || r.subject_kind)}${r.request_type
|
||||
? `<div class="faint tiny" data-no-i18n>${esc(typeName(r.request_type))}</div>` : ''}</div></td>
|
||||
<td class="wrap"><div><a class="ttl" href="#/runs/${esc(r.id)}" data-no-i18n>${esc(r.title)}</a>
|
||||
<div class="faint tiny"><span>${esc(KIND[r.subject_kind] || r.subject_kind)}</span>${r.request_type
|
||||
? ` · <span data-no-i18n>${esc(typeName(r.request_type))}</span>` : ''}</div></div></td>
|
||||
<td class="wrap"${lbl('Etap')} data-no-i18n>${esc(r.stage_name || '—')}</td>
|
||||
<td${lbl('Stan')}><span class="chip ${cls}">${esc(label)}</span></td>
|
||||
<td${lbl('Inicjator')} data-no-i18n>${esc(userName(r.started_by))}</td>
|
||||
<td${lbl('Stan')}><span class="chip dot ${cls}">${esc(label)}</span></td>
|
||||
<td${lbl('Inicjator')} data-no-i18n><span class="who"><span class="avatar" aria-hidden="true">${esc(initials(who))}</span>${esc(who)}</span></td>
|
||||
<td class="faint tiny"${lbl('Rozpoczęto')}>${fmtDateTime(r.created_at)}</td>
|
||||
</tr>`;
|
||||
}).join('')}</tbody></table></div>`;
|
||||
@@ -660,7 +693,7 @@ function runTable(rows) {
|
||||
async function viewList(C, path, title) {
|
||||
setCrumb([{ label: title }]);
|
||||
const rows = await api('GET', path);
|
||||
C.innerHTML = pageHead(title, '') + `<div class="card">${runTable(rows)}</div>`;
|
||||
C.innerHTML = pageHead(title, '') + `<div class="card flush">${runTable(rows)}</div>`;
|
||||
}
|
||||
|
||||
/* The filters live in the hash, so a filtered archive is a link and the CSV is the same query. */
|
||||
@@ -690,7 +723,7 @@ async function viewArchive(C, q) {
|
||||
<button class="btn primary" type="submit">Filtruj</button>
|
||||
<a class="btn" href="#/archive">Wyczyść</a>
|
||||
</form>`
|
||||
+ `<div class="card">${runTable(rows)}</div>`;
|
||||
+ `<div class="card flush">${runTable(rows)}</div>`;
|
||||
}
|
||||
|
||||
/* The query is read at click time, never spliced into the onclick: an attribute's entities are
|
||||
@@ -716,10 +749,14 @@ async function loadStart() {
|
||||
|
||||
const templateOptions = (templateId) => state.start.templates
|
||||
.map((p) => option(p.id, p.name, p.id === templateId)).join('') + option('', _tr('Własny obieg'), !templateId);
|
||||
/* The path card of a start screen: the template, its stages as a preview, and the editor once the
|
||||
starter wants them changed. */
|
||||
function layoutPicker(templateId) {
|
||||
return `<div class="field">Szablon obiegu<select id="lpTemplate" onchange="layoutChanged()" data-no-i18n>${templateOptions(templateId)}</select></div>
|
||||
<label class="row" id="lpChangeRow"><input type="checkbox" id="lpChange" onchange="layoutChanged()" />Zmień etapy lub ustawienia szablonu</label>
|
||||
<div id="lpEditor"></div>`;
|
||||
return `<div class="card side"><h3>Ścieżka obiegu</h3>
|
||||
<label class="field">Szablon obiegu<select id="lpTemplate" onchange="layoutChanged()" data-no-i18n>${templateOptions(templateId)}</select></label>
|
||||
<ol class="preview" id="lpPreview" data-no-i18n></ol>
|
||||
<label class="row" id="lpChangeRow" style="margin-top:14px"><input type="checkbox" id="lpChange" onchange="layoutChanged()" />Zmień etapy lub ustawienia szablonu</label>
|
||||
<div id="lpEditor"></div></div>`;
|
||||
}
|
||||
|
||||
/* Switching the template starts the editor again from it: the base changed, so do the stages. */
|
||||
@@ -728,7 +765,10 @@ function layoutChanged() {
|
||||
const t = state.start.templates.find((p) => p.id === id);
|
||||
$('lpChangeRow').classList.toggle('hidden', !t);
|
||||
const own = !t || $('lpChange').checked;
|
||||
$('lpEditor').innerHTML = !own ? '' : `<div class="field" style="margin:12px 0 6px">Etapy</div>
|
||||
$('lpPreview').innerHTML = own ? '' : t.stages.map((s, i) =>
|
||||
`<li><span class="num">${i + 1}</span>${esc(s.name)}</li>`).join('');
|
||||
$('lpPreview').classList.toggle('hidden', own);
|
||||
$('lpEditor').innerHTML = !own ? '' : `<div class="field" style="margin:16px 0 8px">Etapy</div>
|
||||
${stageEditor('lpStages', t ? t.stages : [], { allowRole: state.start.allowRole, groups: state.start.groups })}
|
||||
${settingsEditor('lpSet', t ? t.settings : null)}
|
||||
${isModerator() ? `<div class="row" style="margin-top:12px"><button type="button" class="btn" onclick="saveLayoutAsTemplate()">${svg(ICN.plus)}Zapisz jako szablon</button></div>` : ''}`;
|
||||
@@ -764,37 +804,57 @@ function saveLayoutAsTemplate() {
|
||||
|
||||
const goToRun = (res) => { location.hash = `#/runs/${encodeURIComponent(res.run_id)}`; };
|
||||
|
||||
/* Nowy obieg: an upload, or — only when this deployment knows a Galena (`/options`
|
||||
galena_enabled) — a Galena document by id and path, re-pinned by the server at start. */
|
||||
async function viewNewRun(C) {
|
||||
setCrumb([{ label: 'Nowy obieg' }]);
|
||||
const [opts] = await Promise.all([api('GET', '/options'), loadStart()]);
|
||||
const galena = !!opts.galena_enabled;
|
||||
C.innerHTML = pageHead('Nowy obieg', '')
|
||||
+ `<form class="card form" data-errors onsubmit="startRun(event)">
|
||||
${galena ? `<div class="field">Przedmiot obiegu
|
||||
<label class="row"><input type="radio" name="nsKind" value="file" checked onchange="subjectKind(this.value)" />Wgraj plik</label>
|
||||
<label class="row"><input type="radio" name="nsKind" value="document" onchange="subjectKind(this.value)" />Dokument z Galeny</label></div>` : ''}
|
||||
<label class="field" id="nsFileRow">Plik<input type="file" id="nsFile" /></label>
|
||||
${galena ? `<div class="grid2 hidden" id="nsDocRow">
|
||||
<label class="field">Identyfikator dokumentu<input id="nsDocId" class="mono" /></label>
|
||||
<label class="field">Ścieżka dokumentu<input id="nsDocPath" class="mono" /></label></div>` : ''}
|
||||
${layoutPicker(null)}
|
||||
<div class="row" style="margin-top:16px"><button class="btn primary" type="submit">Rozpocznij obieg</button></div>
|
||||
</form>`;
|
||||
layoutChanged();
|
||||
/* Nowa sprawa, step 1: one door for every start. A request type is a card (its fields and its
|
||||
default path say what it is); a file is a card; a Galena document is a card only when this
|
||||
deployment knows a Galena (`/options` galena_enabled). Step 2 is the matching form. */
|
||||
async function viewNewCase(C) {
|
||||
setCrumb([{ label: 'Nowa sprawa' }]);
|
||||
const [opts, templates, fields] = await Promise.all([
|
||||
api('GET', '/options'), api('GET', '/templates'), api('GET', '/request-fields')]);
|
||||
const byKey = Object.fromEntries(fields.map((f) => [f.key, f]));
|
||||
const path = (id) => {
|
||||
const t = templates.find((p) => p.id === id);
|
||||
return t ? `<div class="path" data-no-i18n>${t.stages.map((s) => `<span>${esc(s.name)}</span>`).join(' → ')}</div>` : '';
|
||||
};
|
||||
const card = (href, icon, name, desc, extra) => `<a class="choice" href="${href}">
|
||||
<span class="ic">${svg(icon, 18)}</span><b>${name}</b><span class="d">${desc}</span>${extra || ''}</a>`;
|
||||
const types = state.types.map((t) => card(`#/requests/new?type=${encodeURIComponent(t.id)}`, ICN.file,
|
||||
`<span data-no-i18n>${esc(t.name)}</span>`,
|
||||
`<span data-no-i18n>${esc(t.field_keys.map((k) => byKey[k] && byKey[k].label).filter(Boolean).join(', ') || '—')}</span>`,
|
||||
path(t.default_template_id))).join('');
|
||||
C.innerHTML = `<div class="page-head"><div><div class="eyebrow">Krok 1 z 2</div><h2>Czego dotyczy sprawa?</h2>
|
||||
<div class="sub">Wybierz, a pokażemy właściwy formularz i ścieżkę akceptacji.</div></div></div>
|
||||
<div class="section-label">Wniosek</div>
|
||||
${types ? `<div class="choices">${types}</div>` : '<div class="empty">Moderator nie zdefiniował jeszcze typów wniosków.</div>'}
|
||||
<div class="section-label" style="margin-top:32px">Dokument do zatwierdzenia</div>
|
||||
<div class="choices">${card('#/runs/new?kind=file', ICN.download, 'Plik z komputera', 'Wgraj plik i ustal, kto go zatwierdza.')}${opts.galena_enabled
|
||||
? card('#/runs/new?kind=document', ICN.folder, 'Dokument z Galeny', 'Wybierz dokument z repozytorium kancelarii.') : ''}</div>`;
|
||||
}
|
||||
|
||||
/* A Galena role is a stage only a document can have, so the editor offers it only then. */
|
||||
function subjectKind(kind) {
|
||||
const doc = kind === 'document';
|
||||
$('nsFileRow').classList.toggle('hidden', doc);
|
||||
$('nsDocRow').classList.toggle('hidden', !doc);
|
||||
/* The step-2 head: where it came from and the way back to the choice. `title` is already escaped. */
|
||||
function stepHead(title) {
|
||||
return `<div class="page-head"><div><div class="eyebrow"><span>Krok 2 z 2</span> · <a href="#/new">Zmień rodzaj sprawy</a></div>
|
||||
<h2>${title}</h2></div></div>`;
|
||||
}
|
||||
const stepFoot = (label) => `<div class="form-foot"><a class="btn" href="#/new">Wstecz</a>
|
||||
<button class="btn primary" type="submit">${label}</button></div>`;
|
||||
|
||||
/* Nowa sprawa, a document: an upload, or a Galena document by id and path, re-pinned by the server
|
||||
at start. A Galena role is a stage only a document can have, so the editor offers it only then. */
|
||||
async function viewNewRun(C, q) {
|
||||
const [opts] = await Promise.all([api('GET', '/options'), loadStart()]);
|
||||
const doc = q.kind === 'document' && !!opts.galena_enabled;
|
||||
const name = doc ? 'Dokument z Galeny' : 'Plik z komputera';
|
||||
setCrumb([{ label: 'Nowa sprawa', href: '#/new' }, { label: name }]);
|
||||
state.start.allowRole = doc;
|
||||
if ($('lpStages')) {
|
||||
_stageOpts.lpStages.allowRole = doc;
|
||||
setStages('lpStages', readStages('lpStages'));
|
||||
}
|
||||
C.innerHTML = stepHead(esc(name))
|
||||
+ `<form data-errors onsubmit="startRun(event)"><div class="split">
|
||||
<div class="card form"><h3>Przedmiot obiegu</h3>${doc
|
||||
? `<label class="field">Identyfikator dokumentu<input id="nsDocId" class="mono" /></label>
|
||||
<label class="field">Ścieżka dokumentu<input id="nsDocPath" class="mono" /></label>`
|
||||
: '<label class="field">Plik<input type="file" id="nsFile" /></label>'}</div>
|
||||
${layoutPicker(null)}</div>${stepFoot('Rozpocznij obieg')}</form>`;
|
||||
layoutChanged();
|
||||
}
|
||||
|
||||
function startRun(e) {
|
||||
@@ -814,36 +874,32 @@ function startRun(e) {
|
||||
});
|
||||
}
|
||||
|
||||
/* Nowy wniosek: the type's form, then the run. Filing and starting are two calls, so a run that
|
||||
is refused leaves a filed request: its id is kept and its part of the form locked, and the next
|
||||
click only retries the start. */
|
||||
/* Nowa sprawa, a request: the type chosen in step 1, its form, then the run. Filing and starting
|
||||
are two calls, so a run that is refused leaves a filed request: its id is kept and its part of
|
||||
the form locked, and the next click only retries the start. */
|
||||
let _filed = null;
|
||||
async function viewNewRequest(C) {
|
||||
setCrumb([{ label: 'Nowy wniosek' }]);
|
||||
async function viewNewRequest(C, q) {
|
||||
const t = state.types.find((x) => x.id === q.type);
|
||||
if (!t) { location.hash = '#/new'; return; } // no type (an old link, an archived one): choose
|
||||
setCrumb([{ label: 'Nowa sprawa', href: '#/new' }, { label: t.name }]);
|
||||
_filed = null;
|
||||
const [fields] = await Promise.all([api('GET', '/request-fields'), loadStart()]);
|
||||
state.start.fields = fields;
|
||||
if (!state.types.length) {
|
||||
C.innerHTML = pageHead('Nowy wniosek', '') + '<div class="empty">Moderator nie zdefiniował jeszcze typów wniosków.</div>';
|
||||
return;
|
||||
}
|
||||
C.innerHTML = pageHead('Nowy wniosek', '')
|
||||
+ `<form class="card form" data-errors onsubmit="fileRequest(event)">
|
||||
<fieldset id="nrReq" class="plain">
|
||||
<label class="field">Typ wniosku<select id="nrType" onchange="requestType()" data-no-i18n>${state.types
|
||||
.map((t) => option(t.id, t.name, false)).join('')}</select></label>
|
||||
const byKey = Object.fromEntries(fields.map((f) => [f.key, f]));
|
||||
// Archived fields are left out: core refuses a new value for them.
|
||||
const inputs = t.field_keys.map((k) => byKey[k]).filter((f) => f && !f.archived).map((f) => fieldInput(f)).join('');
|
||||
C.innerHTML = stepHead(`<span>Wniosek</span>: <span data-no-i18n>${esc(t.name)}</span>`)
|
||||
+ `<form data-errors onsubmit="fileRequest(event)"><input type="hidden" id="nrType" value="${esc(t.id)}" /><div class="split">
|
||||
<div class="card form"><h3>Wniosek</h3><fieldset id="nrReq" class="plain">
|
||||
<label class="field">Tytuł<input id="nrTitle" maxlength="200" /></label>
|
||||
<div id="nrFields"></div>
|
||||
<label class="row" style="margin-top:12px"><input type="checkbox" id="nrEdit" />Można edytować w trakcie obiegu</label>
|
||||
</fieldset>
|
||||
<div id="nrLayout"></div>
|
||||
<div class="row" style="margin-top:16px"><button class="btn primary" type="submit">Złóż wniosek</button></div>
|
||||
</form>`;
|
||||
requestType();
|
||||
<div id="nrFields" class="grid2">${inputs}</div>
|
||||
${t.attachments_allowed ? '<label class="field">Załączniki<input type="file" id="nrFiles" multiple /></label>' : ''}
|
||||
<label class="check"><input type="checkbox" id="nrEdit" /><span><b>Można edytować w trakcie obiegu</b>
|
||||
<span class="faint tiny">Bez tego pola zablokują się po złożeniu.</span></span></label>
|
||||
</fieldset></div>
|
||||
${layoutPicker(t.default_template_id)}</div>${stepFoot('Złóż wniosek')}</form>`;
|
||||
layoutChanged();
|
||||
}
|
||||
|
||||
/* The chosen type's fields (archived ones are left out: core refuses a new value for them), its
|
||||
attachments, and its default template preselected. */
|
||||
/* One request field as a form control, prefilled with `v` (the edit form's current value). */
|
||||
function fieldInput(f, v) {
|
||||
const a = `data-v="${esc(f.key)}"`;
|
||||
@@ -855,17 +911,6 @@ function fieldInput(f, v) {
|
||||
return `<label class="field"><span data-no-i18n>${esc(f.label)}</span>${ctl}</label>`;
|
||||
}
|
||||
|
||||
function requestType() {
|
||||
const t = state.types.find((x) => x.id === $('nrType').value);
|
||||
const byKey = Object.fromEntries(state.start.fields.map((f) => [f.key, f]));
|
||||
$('nrFields').innerHTML = t.field_keys.map((k) => byKey[k]).filter((f) => f && !f.archived).map((f) => fieldInput(f)).join('')
|
||||
+ (t.attachments_allowed ? '<label class="field">Załączniki<input type="file" id="nrFiles" multiple /></label>' : '');
|
||||
$('nrLayout').innerHTML = layoutPicker(t.default_template_id);
|
||||
localize($('nrFields'));
|
||||
localize($('nrLayout'));
|
||||
layoutChanged();
|
||||
}
|
||||
|
||||
/* Only what was filled in is sent; a yes / no field is always an answer. An edit (`clear`) sends an
|
||||
emptied field as null, which is how a partial write clears it. */
|
||||
function readValues(rootId, clear) {
|
||||
@@ -931,31 +976,32 @@ async function viewRun(C, id) {
|
||||
_run = Object.assign(run, { request, fields });
|
||||
setCrumb([{ label: 'Moje', href: '#/mine' }, { label: run.title }]);
|
||||
const [label, cls] = RUN_STATE[run.state] || [run.state, ''];
|
||||
C.innerHTML = `<div class="page-head"><div><h2 data-no-i18n>${esc(run.title)}</h2>
|
||||
<div class="sub"><span>${esc(KIND[run.subject_kind] || run.subject_kind)}</span>${run.template_name
|
||||
? ` · <span data-no-i18n>${esc(run.template_name)}</span>` : ''} · <span data-no-i18n>${esc(userName(run.started_by))}</span>
|
||||
· ${fmtDateTime(run.created_at)}</div></div>
|
||||
<div class="acts"><span class="chip ${cls}">${esc(label)}</span></div></div>`
|
||||
+ runActions() + subjectCard() + stagesCard() + timelineCard();
|
||||
C.innerHTML = `<div class="page-head"><div>
|
||||
<div class="eyebrow"><span>${esc(KIND[run.subject_kind] || run.subject_kind)}</span>${run.template_name
|
||||
? ` · <span data-no-i18n>${esc(run.template_name)}</span>` : ''}</div>
|
||||
<h2><span data-no-i18n>${esc(run.title)}</span><span class="chip dot ${cls}">${esc(label)}</span></h2>
|
||||
<div class="sub" data-no-i18n>${esc(userName(run.started_by))} · ${fmtDateTime(run.created_at)}</div></div>
|
||||
${runActions()}</div>`
|
||||
+ stagesCard()
|
||||
+ `<div class="run-grid"><div>${subjectCard()}</div><div>${timelineCard()}</div></div>`;
|
||||
}
|
||||
|
||||
/* The action bar: only what the flags allow, and the stage's own way of approving it. */
|
||||
/* The action bar, in the page head: only what the flags allow, the stage's own way of approving
|
||||
last (the primary one, where the eye ends). */
|
||||
function runActions() {
|
||||
const r = _run;
|
||||
const stage = stageAt(r.current);
|
||||
const b = (action, primary) => `<button class="btn${primary ? ' primary' : ''}" onclick="openAction('${action}')">${esc(ACTION[action][0])}</button>`;
|
||||
const out = [];
|
||||
if (r.can_act) {
|
||||
out.push(b(stage && stage.type === 'podpis_papierowy' ? 'paper_scan' : 'approve', true), b('reject'));
|
||||
if (r.current > 0) out.push(b('back'));
|
||||
}
|
||||
if (mayEditRequest()) out.push(`<button class="btn" onclick="openEditRequest()">Edytuj wniosek</button>`);
|
||||
if (r.can_add_stage) out.push(`<button class="btn" onclick="guard(openAddStage)">${svg(ICN.plus)}Dodaj etap</button>`);
|
||||
if (r.can_refresh) out.push(b('refresh'));
|
||||
if (r.can_cancel) out.push(b('cancel'));
|
||||
if (mayEditRequest()) out.push(`<button class="btn" onclick="openEditRequest()">Edytuj wniosek</button>`);
|
||||
if (!out.length) return '';
|
||||
return `<div class="card"><div class="row">${stage
|
||||
? `<span class="faint">Bieżący etap</span> <b data-no-i18n>${esc(stage.name)}</b><span class="spacer"></span>` : ''}${out.join('')}</div></div>`;
|
||||
if (r.can_act) {
|
||||
if (r.current > 0) out.push(b('back'));
|
||||
out.push(b('reject'), b(stage && stage.type === 'podpis_papierowy' ? 'paper_scan' : 'approve', true));
|
||||
}
|
||||
return out.length ? `<div class="acts" id="runActs">${out.join('')}</div>` : '';
|
||||
}
|
||||
|
||||
/* requests.update's rule as far as this screen knows it: the filer or a moderator, while this run
|
||||
@@ -972,12 +1018,11 @@ function subjectCard() {
|
||||
const gone = r.subject_available ? '' : '<div class="banner warn">Wersja niedostępna — przypiętej wersji przedmiotu nie da się teraz odczytać.</div>';
|
||||
let body = '';
|
||||
if (r.subject_kind === 'file') {
|
||||
body = `<div class="grid2">${field('Plik', s.name)}<div><div class="tiny faint">sha256</div><div class="mono tiny" data-no-i18n>${esc(shortHash(s.sha256))}</div></div></div>
|
||||
${r.subject_available ? `<div class="row" style="margin-top:10px"><button class="btn" onclick="downloadSubject()">${svg(ICN.download)}Pobierz</button></div>` : ''}`;
|
||||
body = `<div class="facts">${field('Plik', s.name)}${field('sha256', shortHash(s.sha256), 'mono')}</div>
|
||||
${r.subject_available ? `<div class="row" style="margin-top:20px"><button class="btn" onclick="downloadSubject()">${svg(ICN.download)}Pobierz</button></div>` : ''}`;
|
||||
} else if (r.subject_kind === 'document') {
|
||||
body = `<div class="grid2"><div><div class="tiny faint">Ścieżka dokumentu</div><div class="mono" data-no-i18n>${esc(s.path)}</div></div>
|
||||
<div><div class="tiny faint">Commit</div><div class="mono tiny" data-no-i18n>${esc(shortHash(s.commit_sha))}</div></div></div>
|
||||
<div class="tiny faint" style="margin-top:8px">Dokument czytasz w Galenie; ten obieg zatwierdza wskazany commit.</div>`;
|
||||
body = `<div class="facts">${field('Ścieżka dokumentu', s.path, 'mono')}${field('Commit', shortHash(s.commit_sha), 'mono')}</div>
|
||||
<div class="lock">${svg(ICN.folder, 14)}<span>Dokument czytasz w Galenie; ten obieg zatwierdza wskazany commit.</span></div>`;
|
||||
} else if (r.request) {
|
||||
const q = r.request;
|
||||
const byKey = Object.fromEntries(r.fields.map((f) => [f.key, f]));
|
||||
@@ -987,17 +1032,18 @@ function subjectCard() {
|
||||
if (f && f.kind === 'choice') { const o = f.options.find((x) => x.key === v); return o ? o.label : v; }
|
||||
return v;
|
||||
};
|
||||
// Field labels are people's text, so the label stays untranslated too.
|
||||
const rows = Object.keys(q.values).filter((k) => q.values[k] != null)
|
||||
.map((k) => `<div><div class="tiny faint" data-no-i18n>${esc(byKey[k] ? byKey[k].label : k)}</div><div data-no-i18n>${esc(show(k, q.values[k]))}</div></div>`).join('');
|
||||
const files = q.attachments.map((a, i) => `<button class="btn" onclick="downloadAttachment(${i})">${svg(ICN.download)}<span data-no-i18n>${esc(a.name)}</span></button>`).join('');
|
||||
body = `<div class="grid2">${field('Typ wniosku', typeName(r.request_type))}${field('Inicjator', userName(q.created_by))}${rows}</div>
|
||||
${files ? `<div class="field" style="margin-top:10px">Załączniki<div class="row">${files}</div></div>` : ''}
|
||||
<div class="tiny faint" style="margin-top:8px">${q.editable_in_run ? 'Można edytować w trakcie obiegu' : 'Zablokowany w trakcie obiegu'}</div>`;
|
||||
.map((k) => `<div data-no-i18n><div class="k">${esc(byKey[k] ? byKey[k].label : k)}</div><div class="v">${esc(show(k, q.values[k]))}</div></div>`).join('');
|
||||
const files = q.attachments.map((a, i) => `<button class="btn sm" onclick="downloadAttachment(${i})">${svg(ICN.download)}<span data-no-i18n>${esc(a.name)}</span></button>`).join('');
|
||||
body = `<div class="facts">${rows}${field('Typ wniosku', typeName(r.request_type))}${field('Inicjator', userName(q.created_by))}</div>
|
||||
${files ? `<div class="field" style="margin-top:20px">Załączniki<div class="row">${files}</div></div>` : ''}
|
||||
<div class="lock">${svg(ICN.lock, 14)}<span>${q.editable_in_run ? 'Można edytować w trakcie obiegu' : 'Zablokowany w trakcie obiegu'}</span></div>`;
|
||||
}
|
||||
const scan = r.scan ? `<div class="field" style="margin-top:12px">Skan podpisanego dokumentu<div class="row">${r.scan.file_id
|
||||
? `<button class="btn" onclick="downloadScan()">${svg(ICN.download)}<span data-no-i18n>${esc(r.scan.name)}</span></button>`
|
||||
const scan = r.scan ? `<div class="field" style="margin-top:20px">Skan podpisanego dokumentu<div class="row">${r.scan.file_id
|
||||
? `<button class="btn sm" onclick="downloadScan()">${svg(ICN.download)}<span data-no-i18n>${esc(r.scan.name)}</span></button>`
|
||||
: `<span class="mono" data-no-i18n>${esc(r.scan.path || '')}</span><span class="faint tiny">(w Galenie)</span>`}</div></div>` : '';
|
||||
return `<div class="card"><h3>Przedmiot</h3>${gone}${body}${scan}</div>`;
|
||||
return `<div class="card"><h3>Szczegóły</h3>${gone}${body}${scan}</div>`;
|
||||
}
|
||||
|
||||
/* Bytes only as a download, by an id read at click time. */
|
||||
@@ -1005,13 +1051,20 @@ function downloadSubject() { downloadFile(`/files/${encodeURIComponent(_run.subj
|
||||
function downloadAttachment(i) { downloadFile(`/files/${encodeURIComponent(_run.request.attachments[i].file_id)}`); }
|
||||
function downloadScan() { downloadFile(`/files/${encodeURIComponent(_run.scan.file_id)}`); }
|
||||
|
||||
/* The stages as a path: behind the current one done, the current one ringed, the rest dashed. A
|
||||
finished run shows no current stage; an approved or signed one shows every stage done. */
|
||||
function stagesCard() {
|
||||
const r = _run;
|
||||
return `<div class="card"><h3>Etapy<span class="n">${esc(r.stages.length)}</span></h3><ol class="stages">${r.stages.map((s, i) => `
|
||||
<li class="${i === r.current ? 'on' : ''}"><b data-no-i18n>${esc(s.name)}</b>
|
||||
<span class="faint tiny"><span>${esc(STAGE_TYPE[s.type] || s.type)}</span> · <span>${esc(QUORUM[s.quorum] || s.quorum)}</span></span>
|
||||
${i === r.current ? '<span class="chip">Bieżący etap</span>' : ''}</li>`).join('')}</ol>
|
||||
${r.state === 'w_toku' ? `<div class="tiny faint"><span>Runda</span> ${esc(r.round)}</div>` : ''}</div>`;
|
||||
const running = r.state === 'w_toku';
|
||||
const done = (i) => r.state === 'zatwierdzony' || r.state === 'podpisany' || (running && i < r.current);
|
||||
return `<div class="card"><h3>Etapy<span class="n">${esc(r.stages.length)}</span></h3><ol class="stages">${r.stages.map((s, i) => {
|
||||
const on = running && i === r.current;
|
||||
return `<li class="${on ? 'on' : done(i) ? 'done' : 'todo'}"><span class="dot">${done(i) ? svg(ICN.check, 14) : esc(i + 1)}</span>
|
||||
<span class="nm" data-no-i18n>${esc(s.name)}</span>
|
||||
<span class="meta"><span>${esc(STAGE_TYPE[s.type] || s.type)}</span> · <span>${esc(QUORUM[s.quorum] || s.quorum)}</span></span>
|
||||
${on && r.can_act ? '<span class="you">czeka na Ciebie</span>' : ''}</li>`;
|
||||
}).join('')}</ol>
|
||||
${running && r.round > 1 ? `<div class="round-note tiny faint"><span>Runda</span> ${esc(r.round)}</div>` : ''}</div>`;
|
||||
}
|
||||
|
||||
/* The evidence an entry rests on: a document's commit, the hash of the file, of the request's
|
||||
@@ -1022,21 +1075,26 @@ function evidenceHtml(e) {
|
||||
const from = stageAt(e.stage_from);
|
||||
const what = from && from.type === 'podpis_papierowy' && e.kind !== 'start' ? 'Hash skanu'
|
||||
: _run.subject_kind === 'request' ? 'Hash migawki' : 'Hash pliku';
|
||||
return `<div class="tiny faint">${ev.commit_sha ? `<span>Commit</span> <span class="mono" data-no-i18n>${esc(shortHash(ev.commit_sha))}</span> · ` : ''}${ev.sha256
|
||||
return `<div class="meta">${ev.commit_sha ? `<span>Commit</span> <span class="mono" data-no-i18n>${esc(shortHash(ev.commit_sha))}</span> · ` : ''}${ev.sha256
|
||||
? `<span>${what}</span> <span class="mono" data-no-i18n title="${esc(ev.sha256)}">${esc(shortHash(ev.sha256))}</span>` : ''}</div>`;
|
||||
}
|
||||
|
||||
/* The dot's colour is what happened. */
|
||||
const TL_TONE = {
|
||||
start: 'k-start', zatwierdzenie: 'k-ok', zakonczenie: 'k-ok',
|
||||
odrzucenie: 'k-err', cofniecie: 'k-warn', anulowanie: 'k-warn',
|
||||
};
|
||||
|
||||
/* Newest first, one rail; the round is named on each entry once there has been more than one. */
|
||||
function timelineCard() {
|
||||
const rounds = new Map();
|
||||
_run.timeline.forEach((e) => rounds.set(e.round, (rounds.get(e.round) || []).concat([e])));
|
||||
const name = (i) => (stageAt(i) ? stageAt(i).name : '—');
|
||||
const item = (e) => `<li><div class="row"><b>${esc(NOTE_KIND[e.kind] || e.kind)}</b>
|
||||
<span class="faint tiny" data-no-i18n>${esc(userName(e.actor_id))} · ${fmtDateTime(e.created_at)}</span></div>
|
||||
${e.stage_from != null || e.stage_to != null ? `<div class="tiny faint" data-no-i18n>${esc(name(e.stage_from))} → ${esc(name(e.stage_to))}</div>` : ''}
|
||||
const rounds = new Set(_run.timeline.map((e) => e.round)).size > 1;
|
||||
const item = (e) => `<li class="${TL_TONE[e.kind] || ''}"><div class="what">${esc(NOTE_KIND[e.kind] || e.kind)}</div>
|
||||
<div class="meta">${rounds ? `<span>Runda</span> ${esc(e.round)} · ` : ''}<span data-no-i18n>${esc(userName(e.actor_id))} · ${fmtDateTime(e.created_at)}</span></div>
|
||||
${e.stage_from != null || e.stage_to != null ? `<div class="meta" data-no-i18n>${esc(name(e.stage_from))} → ${esc(name(e.stage_to))}</div>` : ''}
|
||||
${e.note ? `<div class="tl-note" data-no-i18n>${esc(e.note)}</div>` : ''}${evidenceHtml(e)}</li>`;
|
||||
return `<div class="card"><h3>Oś czasu</h3>${[...rounds].map(([n, events]) => `
|
||||
<div class="tiny faint"><span>Runda</span> ${esc(n)}</div><ol class="timeline">${events.map(item).join('')}</ol>`).join('')
|
||||
|| '<div class="empty">—</div>'}</div>`;
|
||||
return `<div class="card"><h3>Oś czasu</h3>${_run.timeline.length
|
||||
? `<ol class="timeline">${[..._run.timeline].reverse().map(item).join('')}</ol>` : '<div class="empty">—</div>'}</div>`;
|
||||
}
|
||||
|
||||
const noteField = (required) => `<label class="field">${required ? 'Notatka (wymagana)' : 'Notatka'}<textarea id="raNote" rows="3" maxlength="2000"></textarea></label>`;
|
||||
@@ -1375,39 +1433,48 @@ const ADMIN = {
|
||||
},
|
||||
};
|
||||
|
||||
async function viewSettings(C) {
|
||||
/* One tab per kind, the tab in the hash (`#/settings?tab=type`) so a save, which re-renders through
|
||||
the router, lands back on it. */
|
||||
async function viewSettings(C, q) {
|
||||
setCrumb([{ label: 'Ustawienia' }]);
|
||||
const kinds = Object.keys(ADMIN);
|
||||
const lists = await Promise.all(kinds.map((k) => api('GET', ADMIN[k].path)));
|
||||
kinds.forEach((k, i) => { state.admin[ADMIN[k].list] = lists[i]; });
|
||||
const A = state.admin;
|
||||
const tab = ADMIN[q.tab] ? q.tab : kinds[0];
|
||||
const names = (ids, all, key, label) => ids.map((id) => {
|
||||
const x = all.find((y) => y[key] === id);
|
||||
return x ? x[label] : '—';
|
||||
}).join(', ');
|
||||
const live = (kind) => A[ADMIN[kind].list].filter((x) => !x.archived).length;
|
||||
const card = (kind, heads, cells) => {
|
||||
const rows = A[ADMIN[kind].list];
|
||||
return `<div class="card"><h3 class="row">${esc(ADMIN[kind].title)}<span class="n">${rows.length}</span>
|
||||
return `<div class="card flush"><h3 class="row">${esc(ADMIN[kind].title)}
|
||||
<span class="spacer"></span><button class="btn" onclick="openSetting('${kind}')">${svg(ICN.plus)}Dodaj</button></h3>
|
||||
${rows.length ? `<div class="tablewrap"><table class="rt"><thead><tr>${heads.map((h) => `<th>${esc(h)}</th>`).join('')}<th></th></tr></thead>
|
||||
<tbody>${rows.map((x, i) => `<tr${x.archived ? ' class="faint"' : ''}>${cells(x)}<td>${x.archived
|
||||
<tbody>${rows.map((x, i) => `<tr${x.archived ? ' class="faint"' : ''}>${cells(x)}<td class="acts-cell">${x.archived
|
||||
? '<span class="chip">Zarchiwizowane</span>'
|
||||
: `<div class="row"><button class="btn" onclick="openSetting('${kind}',${i})">Edytuj</button>
|
||||
<button class="btn" onclick="archiveSetting('${kind}',${i})">${svg(ICN.archive)}Archiwizuj</button></div>`}</td></tr>`).join('')}</tbody>
|
||||
</table></div>` : '<div class="empty">Brak wyników</div>'}</div>`;
|
||||
: `<div class="row"><button class="btn sm" onclick="openSetting('${kind}',${i})">Edytuj</button>
|
||||
<button class="iconbtn" title="Archiwizuj" aria-label="Archiwizuj" onclick="archiveSetting('${kind}',${i})">${svg(ICN.archive)}</button></div>`}</td></tr>`).join('')}</tbody>
|
||||
</table></div>` : '<div class="empty" style="margin:0 24px 24px">Brak wyników</div>'}</div>`;
|
||||
};
|
||||
C.innerHTML = pageHead('Ustawienia', 'Grupy, pola i typy wniosków, szablony obiegów')
|
||||
+ card('group', ['Nazwa', 'Członkowie'], (g) => `<td data-no-i18n>${esc(g.name)}</td>
|
||||
<td class="wrap"${lbl('Członkowie')} data-no-i18n>${esc(g.member_ids.map(userName).join(', ') || '—')}</td>`)
|
||||
+ card('field', ['Nazwa', 'Rodzaj pola', 'Opcje listy'], (f) => `<td data-no-i18n>${esc(f.label)}</td>
|
||||
const chips = (p) => p.stages.map((s) => `<span class="chip">${esc(s.name)}</span>`).join(' → ');
|
||||
const CARDS = {
|
||||
group: () => card('group', ['Nazwa', 'Członkowie'], (g) => `<td data-no-i18n>${esc(g.name)}</td>
|
||||
<td class="wrap"${lbl('Członkowie')} data-no-i18n>${esc(g.member_ids.map(userName).join(', ') || '—')}</td>`),
|
||||
field: () => card('field', ['Nazwa', 'Rodzaj pola', 'Opcje listy'], (f) => `<td data-no-i18n>${esc(f.label)}</td>
|
||||
<td${lbl('Rodzaj pola')}>${esc(FIELD_KIND[f.kind] || f.kind)}</td>
|
||||
<td class="wrap"${lbl('Opcje listy')} data-no-i18n>${esc(f.options.filter((o) => !o.archived).map((o) => o.label).join(', ') || '—')}</td>`)
|
||||
+ card('type', ['Nazwa', 'Pola wniosku', 'Szablon domyślny'], (t) => `<td data-no-i18n><div>${esc(t.name)}
|
||||
<td class="wrap"${lbl('Opcje listy')} data-no-i18n>${esc(f.options.filter((o) => !o.archived).map((o) => o.label).join(', ') || '—')}</td>`),
|
||||
type: () => card('type', ['Nazwa', 'Pola wniosku', 'Szablon domyślny'], (t) => `<td data-no-i18n><div>${esc(t.name)}
|
||||
<div class="faint tiny mono">${esc(t.key)}</div></div></td>
|
||||
<td class="wrap"${lbl('Pola wniosku')} data-no-i18n>${esc(names(t.field_keys, A.fields, 'key', 'label') || '—')}</td>
|
||||
<td${lbl('Szablon domyślny')} data-no-i18n>${esc(t.default_template_id ? names([t.default_template_id], A.templates, 'id', 'name') : '—')}</td>`)
|
||||
+ card('template', ['Nazwa', 'Etapy'], (p) => `<td data-no-i18n>${esc(p.name)}</td>
|
||||
<td class="wrap"${lbl('Etapy')} data-no-i18n>${esc(p.stages.map((s) => s.name).join(' → '))}</td>`);
|
||||
<td${lbl('Szablon domyślny')} data-no-i18n>${esc(t.default_template_id ? names([t.default_template_id], A.templates, 'id', 'name') : '—')}</td>`),
|
||||
template: () => card('template', ['Nazwa', 'Etapy'], (p) => `<td data-no-i18n>${esc(p.name)}</td>
|
||||
<td${lbl('Etapy')} data-no-i18n><span class="path">${chips(p)}</span></td>`),
|
||||
};
|
||||
C.innerHTML = pageHead('Ustawienia', 'Grupy, pola i typy wniosków, szablony obiegów')
|
||||
+ `<nav class="tabs">${kinds.map((k) => `<a class="${k === tab ? 'on' : ''}" href="#/settings?tab=${k}"><span>${esc(ADMIN[k].title)}</span><span class="n">${live(k)}</span></a>`).join('')}</nav>`
|
||||
+ CARDS[tab]();
|
||||
}
|
||||
|
||||
/* The form's subject between opening and saving: { kind, x } with x = null for a new one. */
|
||||
@@ -1548,7 +1615,7 @@ async function viewAdmin(C) {
|
||||
|
||||
C.innerHTML = pageHead('Administracja', '',
|
||||
hub ? '' : `<button class="btn primary" onclick="openUserNew()">${svg(ICN.plus)}Użytkownicy</button>`)
|
||||
+ `<div class="card"><h3>Użytkownicy<span class="n">${state.users.length}</span></h3>
|
||||
+ `<div class="card flush"><h3>Użytkownicy<span class="n">${state.users.length}</span></h3>
|
||||
<div class="tablewrap"><table class="rt"><thead><tr>
|
||||
<th>Nazwa</th><th>E-mail</th><th>Rola</th><th>Status</th>
|
||||
</tr></thead><tbody>${state.users.map((u) => `<tr>
|
||||
@@ -1557,11 +1624,11 @@ async function viewAdmin(C) {
|
||||
<td${lbl('Rola')}>${role(u)}</td>
|
||||
<td${lbl('Status')}><div class="row">${u.is_active ? '<span class="chip ok">active</span>' : '<span class="chip err">inactive</span>'}</div></td>
|
||||
</tr>`).join('')}</tbody></table></div>
|
||||
${hub ? `<div class="faint tiny" style="padding:10px 2px 2px">
|
||||
${hub ? `<div class="faint tiny" style="padding:14px 24px 22px;border-top:1px solid var(--border)">
|
||||
<span>Osobami i hasłami zarządza się w jednym miejscu dla całej platformy.</span>
|
||||
<span>Dodanie kogoś, zmiana nazwy, reset hasła czy wyłączenie konta dzieją się tam — i obowiązują od razu wszędzie.</span>
|
||||
<span>Tu ustawiasz tylko to, co dana osoba widzi w tym module.</span></div>` : ''}</div>`
|
||||
+ `<div class="card"><h3>Audit<span class="n">${audit.length}</span></h3>
|
||||
+ `<div class="card flush"><h3>Audit<span class="n">${audit.length}</span></h3>
|
||||
${audit.length ? `<div class="tablewrap"><table class="rt"><thead><tr>
|
||||
<th>Utworzono</th><th>Action</th><th>Entity</th><th>Result</th>
|
||||
</tr></thead><tbody>${audit.map((a) => `<tr>
|
||||
|
||||
+3
-2
@@ -67,6 +67,8 @@
|
||||
<svg class="logo" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect x="2" y="2" width="20" height="20" rx="5" fill="#495057"/><g stroke="#f8f9fa" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" fill="none"><path d="M7 12.5l3.2 3.2L17 9"/></g></svg>
|
||||
<span class="nm">Workflow</span>
|
||||
</div>
|
||||
<!-- One door for everything that starts a run: the next screen asks what the case is about. -->
|
||||
<a class="btn primary newcase" id="newCase" href="#/new">Nowa sprawa</a>
|
||||
<nav class="nav" id="nav"></nav>
|
||||
<div class="nav sidebar-foot"><div class="nav-item" id="navAdmin"></div></div>
|
||||
</aside>
|
||||
@@ -76,8 +78,7 @@
|
||||
<button class="iconbtn" id="navToggle" title="Menu"></button>
|
||||
<div class="crumb" id="crumb"></div>
|
||||
<div class="spacer"></div>
|
||||
<button class="iconbtn" id="aNotes" title="Powiadomienia" aria-label="Powiadomienia"></button>
|
||||
<button class="iconbtn js-theme js-tool" id="aTheme" title="Motyw"></button>
|
||||
<button class="iconbtn" id="aNotes" title="Powiadomienia" aria-label="Powiadomienia"></button> <button class="iconbtn js-theme js-tool" id="aTheme" title="Motyw"></button>
|
||||
<button class="iconbtn txt js-tool" id="aLang" title="Język" data-no-i18n>PL</button>
|
||||
<button type="button" class="avatar" id="aUser" title="Konto" aria-label="Konto" aria-haspopup="dialog">?</button>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user