Feste Spaltenbreiten für jede Listenzeile
„Keine Textzentrierung" - die Beobachtung stimmte an einundzwanzig Stellen, und die Ursache war überall dieselbe: die Zeilen waren Flex-Behälter, in denen jedes Element so breit war wie sein Inhalt. Damit fing der Titel in jeder Zeile woanders an, und die Stempelmarken hatten nur rechts eine gemeinsame Kante. Bei „ETHIK" und „WS" untereinander sieht man es sofort. Die Breiten stehen jetzt einmal in globals.css - record-key, record-label, record-title, record-meta, stamp-mark - und sind über Variablen je Liste anpassbar: eine Liste von Abteilungskürzeln braucht keine vierzehn Zeichen, eine Liste von Aktenzeichen schon. Zwei Dinge, die dabei mehr sind als Kosmetik: Eine Spalte wird auch reserviert, wenn sie leer ist. Vorher hing der Dienstgrad an einer Bedingung, und bei einer Person ohne Rang rutschte alles Folgende nach links. Was keine Kennung ist, gehört nicht in die Kennungsspalte. In „Zuletzt geöffnet" stand der Name einer Person dort, wo sonst das Aktenzeichen steht: in Mono, abgeschnitten, und der Dienstgrad wanderte an die Stelle des Titels. Für eine Person ist der Name der Titel. Die Stempelmarke ist überall gleich breit; ein zu langer Name wird gekürzt, die Stufenziffer bleibt stehen - sie ist die eigentliche Auskunft. Unter 40 rem fallen die festen Breiten weg, sonst liefen sie über. Nachgesehen im Browser mit dem gebauten CSS, Fallakten, Abteilungen, Zuletzt geöffnet und Beteiligte.
This commit is contained in:
@@ -182,7 +182,7 @@ function Vermerk({
|
||||
|
||||
return (
|
||||
<li>
|
||||
<div className="flex flex-wrap items-baseline gap-x-4 gap-y-1">
|
||||
<div className="record-row">
|
||||
<span className="font-condensed text-2xs text-text-dim">{vermerk.authorName}</span>
|
||||
<time className="text-2xs text-text-dim">
|
||||
{new Date(vermerk.createdAt).toLocaleString('de-DE')}
|
||||
|
||||
@@ -60,7 +60,7 @@ export default async function DepartmentPage({ params }: { params: Promise<{ key
|
||||
<main className="mx-auto max-w-5xl px-6 py-10">
|
||||
<header>
|
||||
<div className="flex flex-wrap items-baseline gap-x-4 gap-y-2">
|
||||
<span className="font-mono text-xs text-text-dim">{abteilung.key}</span>
|
||||
<span className="record-key">{abteilung.key}</span>
|
||||
<span className="font-condensed text-2xs text-text-dim">{de.department.one}</span>
|
||||
{abteilung.isArchived ? (
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
@@ -171,13 +171,11 @@ async function Members({
|
||||
<li key={person.id} className="border-b border-line">
|
||||
<Link
|
||||
href={`/personalakten/${person.id}`}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 pl-3 text-text no-underline"
|
||||
className="record-row py-2 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(person.classification)}
|
||||
>
|
||||
<span className="grow">{person.displayName}</span>
|
||||
{person.rank ? (
|
||||
<span className="font-condensed text-2xs text-text-dim">{person.rank}</span>
|
||||
) : null}
|
||||
<span className="record-title">{person.displayName}</span>
|
||||
<span className="record-meta">{person.rank}</span>
|
||||
<StampMark
|
||||
level={person.classification}
|
||||
name={levelName.get(person.classification) ?? de.common.unknown}
|
||||
@@ -207,12 +205,12 @@ async function Cases({
|
||||
<li key={akte.id} className="border-b border-line">
|
||||
<Link
|
||||
href={`/faelle/${akte.caseNumber}`}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 pl-3 text-text no-underline"
|
||||
className="record-row py-2 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(akte.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{akte.caseNumber}</span>
|
||||
<span className="grow">{akte.title}</span>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
<span className="record-key">{akte.caseNumber}</span>
|
||||
<span className="record-title">{akte.title}</span>
|
||||
<span className="record-meta">
|
||||
{de.case.statusNames[akte.status] ?? akte.status}
|
||||
</span>
|
||||
<StampMark
|
||||
@@ -244,10 +242,10 @@ async function Documents({
|
||||
<li key={dokument.id} className="border-b border-line">
|
||||
<Link
|
||||
href={`/dokumente/${dokument.documentNumber}`}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 text-text no-underline"
|
||||
className="record-row py-2 text-text no-underline"
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{dokument.documentNumber}</span>
|
||||
<span className="grow">{dokument.title}</span>
|
||||
<span className="record-key">{dokument.documentNumber}</span>
|
||||
<span className="record-title">{dokument.title}</span>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Metadata } from 'next'
|
||||
import type { CSSProperties } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { requireUser } from '@/lib/auth/current'
|
||||
import { casesPerDepartment, listDepartments } from '@/lib/departments/service'
|
||||
@@ -50,17 +51,20 @@ export default async function DepartmentsPage() {
|
||||
<li key={abteilung.id} className="border-b border-line">
|
||||
<Link
|
||||
href={`/abteilungen/${abteilung.key}`}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-3 text-text no-underline"
|
||||
className="record-row py-3 text-text no-underline"
|
||||
style={{ '--record-key': '8ch' } as CSSProperties}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{abteilung.key}</span>
|
||||
<span className="grow">{abteilung.name}</span>
|
||||
{abteilung.description ? (
|
||||
<span className="w-full text-2xs text-text-dim sm:w-auto sm:grow-[2]">
|
||||
{abteilung.description}
|
||||
</span>
|
||||
) : null}
|
||||
<span className="record-key">{abteilung.key}</span>
|
||||
<span className="record-title">
|
||||
{abteilung.name}
|
||||
{abteilung.description ? (
|
||||
<span className="mt-0.5 block text-2xs text-text-dim">
|
||||
{abteilung.description}
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
{abteilung.memberCount === null ? null : (
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
<span className="record-meta">
|
||||
{de.department.memberCount(abteilung.memberCount)}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -41,9 +41,9 @@ export function DepartmentForm({
|
||||
|
||||
if (existing && !offen) {
|
||||
return (
|
||||
<div className="flex flex-wrap items-baseline gap-x-4 gap-y-1">
|
||||
<span className="font-mono text-xs text-text-dim">{existing.key}</span>
|
||||
<span className="grow">{existing.name}</span>
|
||||
<div className="record-row">
|
||||
<span className="record-key">{existing.key}</span>
|
||||
<span className="record-title">{existing.name}</span>
|
||||
{existing.memberCount === null ? null : (
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
{departmentAdminText.members} {existing.memberCount}
|
||||
|
||||
@@ -36,12 +36,12 @@ export function Approvals({ jobs }: { jobs: Auftrag[] }) {
|
||||
<ul className="border-t border-line">
|
||||
{jobs.map((auftrag) => (
|
||||
<li key={auftrag.id} className="border-b border-line py-2">
|
||||
<div className="flex flex-wrap items-baseline gap-x-4 gap-y-1 text-2xs">
|
||||
<span className="font-condensed text-text-dim">
|
||||
<div className="record-row text-2xs">
|
||||
<span className="record-label">
|
||||
{exportText.kinds[auftrag.kind] ?? auftrag.kind}
|
||||
</span>
|
||||
<span className="font-mono">{auftrag.label}</span>
|
||||
<span className="grow text-text-dim">
|
||||
<span className="record-key">{auftrag.label}</span>
|
||||
<span className="record-title text-text-dim">
|
||||
{exportText.requestedBy} {auftrag.requestedBy}
|
||||
</span>
|
||||
<button
|
||||
|
||||
@@ -43,7 +43,7 @@ export function CaseLinks({
|
||||
{links.map((link) => (
|
||||
<li
|
||||
key={`${link.direction}:${link.kind}:${link.other.id}`}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 border-b border-line py-2 pl-3"
|
||||
className="record-row border-b border-line py-2 pl-3"
|
||||
style={classificationEdgeStyle(link.other.classification)}
|
||||
>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
@@ -53,7 +53,7 @@ export function CaseLinks({
|
||||
<Link
|
||||
href={`/faelle/${link.other.caseNumber}`}
|
||||
prefetch
|
||||
className="font-mono text-xs text-text-dim"
|
||||
className="record-key"
|
||||
>
|
||||
{link.other.caseNumber}
|
||||
</Link>
|
||||
|
||||
@@ -50,12 +50,12 @@ export function Participants({
|
||||
{participants.map((person) => (
|
||||
<li
|
||||
key={person.id}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 border-b border-line py-2"
|
||||
className="record-row border-b border-line py-2"
|
||||
>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
<span className="record-label">
|
||||
{participantText.roles[person.role] ?? person.role}
|
||||
</span>
|
||||
<span className="grow text-sm">
|
||||
<span className="record-title text-sm">
|
||||
{person.personnelFileId ? (
|
||||
<Link href={`/personalakten/${person.personnelFileId}`}>
|
||||
{person.displayName ?? commonText.unknown}
|
||||
|
||||
@@ -72,7 +72,7 @@ export default async function CaseListPage({
|
||||
<main className="mx-auto max-w-5xl px-6 py-10">
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-4">
|
||||
<h1 className="font-condensed">{de.case.listHeading}</h1>
|
||||
<span className="font-mono text-xs text-text-dim">{de.case.countLabel(total)}</span>
|
||||
<span className="record-key">{de.case.countLabel(total)}</span>
|
||||
</div>
|
||||
|
||||
<nav className="mt-4 flex flex-wrap gap-3 font-condensed text-xs">
|
||||
@@ -98,14 +98,12 @@ export default async function CaseListPage({
|
||||
<Link
|
||||
href={`/faelle/${akte.caseNumber}`}
|
||||
prefetch
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-3 pl-3 text-text no-underline"
|
||||
className="record-row py-3 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(akte.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{akte.caseNumber}</span>
|
||||
<span className="grow">{akte.title}</span>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
{de.case.statusNames[akte.status]}
|
||||
</span>
|
||||
<span className="record-key">{akte.caseNumber}</span>
|
||||
<span className="record-title">{akte.title}</span>
|
||||
<span className="record-meta">{de.case.statusNames[akte.status]}</span>
|
||||
<StampMark
|
||||
level={akte.classification}
|
||||
name={levelName.get(akte.classification) ?? de.common.unknown}
|
||||
|
||||
@@ -44,12 +44,12 @@ export function Assignments({
|
||||
{assignments.map((zuordnung) => (
|
||||
<li
|
||||
key={zuordnung.id}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 border-b border-line py-2"
|
||||
className="record-row border-b border-line py-2"
|
||||
>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
<span className="record-label">
|
||||
{assignmentText.roles[zuordnung.role] ?? zuordnung.role}
|
||||
</span>
|
||||
<span className="grow text-sm">{zuordnung.user.displayName}</span>
|
||||
<span className="record-title text-sm">{zuordnung.user.displayName}</span>
|
||||
{canEdit ? (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -80,11 +80,11 @@ async function Backlinks({
|
||||
<Link
|
||||
href={`/faelle/${akte.caseNumber}`}
|
||||
prefetch
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 pl-3 text-text no-underline"
|
||||
className="record-row py-2 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(akte.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{akte.caseNumber}</span>
|
||||
<span className="grow">{akte.title}</span>
|
||||
<span className="record-key">{akte.caseNumber}</span>
|
||||
<span className="record-title">{akte.title}</span>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
{de.case.statusNames[akte.status]}
|
||||
</span>
|
||||
|
||||
@@ -39,7 +39,7 @@ export default async function PersonnelListPage({
|
||||
<main className="mx-auto max-w-5xl px-6 py-10">
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-4">
|
||||
<h1 className="font-condensed">{de.personnel.listHeading}</h1>
|
||||
<span className="font-mono text-xs text-text-dim">{de.personnel.countLabel(total)}</span>
|
||||
<span className="record-key">{de.personnel.countLabel(total)}</span>
|
||||
</div>
|
||||
|
||||
<form method="get" className="mt-4 flex flex-wrap items-center gap-3">
|
||||
@@ -85,13 +85,11 @@ export default async function PersonnelListPage({
|
||||
<Link
|
||||
href={`/personalakten/${akte.id}`}
|
||||
prefetch
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-3 pl-3 text-text no-underline"
|
||||
className="record-row py-3 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(akte.classification)}
|
||||
>
|
||||
<span className="grow">{akte.displayName}</span>
|
||||
{akte.rank ? (
|
||||
<span className="font-condensed text-2xs text-text-dim">{akte.rank}</span>
|
||||
) : null}
|
||||
<span className="record-title">{akte.displayName}</span>
|
||||
<span className="record-meta">{akte.rank}</span>
|
||||
<StatusTags tags={akte.statusTags} known={statusTags} />
|
||||
<StampMark
|
||||
level={akte.classification}
|
||||
|
||||
@@ -97,7 +97,7 @@ export default async function SearchPage({
|
||||
<main className="mx-auto max-w-5xl px-6 py-10">
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-4">
|
||||
<h1 className="font-condensed">{de.search.heading}</h1>
|
||||
<span className="font-mono text-xs text-text-dim">
|
||||
<span className="record-key">
|
||||
{de.search.countLabel(gesamt)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -294,7 +294,7 @@ function Treffer({
|
||||
/** Gesetzt, wenn der Treffer an einem Beteiligten hängt und nicht am Text. */
|
||||
beteiligung?: { name: string; role: string }[]
|
||||
}) {
|
||||
const zeile = 'flex flex-wrap items-baseline gap-x-4 gap-y-1 py-3 pl-3 text-text no-underline'
|
||||
const zeile = 'record-row py-3 pl-3 text-text no-underline'
|
||||
|
||||
if ('caseNumber' in treffer) {
|
||||
return (
|
||||
@@ -304,8 +304,8 @@ function Treffer({
|
||||
className={zeile}
|
||||
style={classificationEdgeStyle(treffer.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{treffer.caseNumber}</span>
|
||||
<span className="grow">
|
||||
<span className="record-key">{treffer.caseNumber}</span>
|
||||
<span className="record-title">
|
||||
{treffer.title}
|
||||
{beteiligung && beteiligung.length > 0 ? (
|
||||
<span className="mt-0.5 block text-2xs text-text-dim">
|
||||
@@ -339,8 +339,8 @@ function Treffer({
|
||||
className={zeile}
|
||||
style={classificationEdgeStyle(treffer.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{treffer.documentNumber}</span>
|
||||
<span className="grow">{treffer.title}</span>
|
||||
<span className="record-key">{treffer.documentNumber}</span>
|
||||
<span className="record-title">{treffer.title}</span>
|
||||
<span className="font-condensed text-2xs text-text-dim">
|
||||
{de.document.statusNames[treffer.status] ?? treffer.status}
|
||||
</span>
|
||||
@@ -355,7 +355,7 @@ function Treffer({
|
||||
className={zeile}
|
||||
style={classificationEdgeStyle(treffer.classification)}
|
||||
>
|
||||
<span className="grow">{treffer.displayName}</span>
|
||||
<span className="record-title">{treffer.displayName}</span>
|
||||
{treffer.rank ? (
|
||||
<span className="font-condensed text-2xs text-text-dim">{treffer.rank}</span>
|
||||
) : null}
|
||||
|
||||
@@ -114,7 +114,7 @@ export default async function DashboardPage() {
|
||||
prefetch
|
||||
className="flex items-baseline gap-4 py-2 text-text no-underline"
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{eintrag.label}</span>
|
||||
<span className="record-key">{eintrag.label}</span>
|
||||
<span className="grow font-condensed text-2xs text-accent">
|
||||
{de.dashboard.unreadCount(eintrag.count)}
|
||||
</span>
|
||||
@@ -200,6 +200,11 @@ function Block({
|
||||
* Dokument sein — deshalb steht die Art nicht dabei, sondern nur das, woran
|
||||
* man sie erkennt: Aktenzeichen, Name oder Dokumentnummer.
|
||||
*
|
||||
* Eine Akte und ein Dokument tragen eine **Kennung**, eine Person nicht: ihr
|
||||
* Name ist der Titel. Stünde er in der Kennungsspalte, stünde er in Mono, wäre
|
||||
* abgeschnitten, und der Dienstgrad rutschte dorthin, wo sonst der Titel
|
||||
* steht — untereinander ergäbe das keine Spalte mehr.
|
||||
*
|
||||
* Ohne Vorabruf, anders als die übrigen Listen: die Seiten dahinter merken
|
||||
* sich, dass sie geöffnet wurden. Der Vorabruf wird zwar serverseitig erkannt
|
||||
* und zählt nicht mit, aber ausgerechnet diese Liste sollte sich nicht selbst
|
||||
@@ -216,11 +221,27 @@ function Sprung({
|
||||
<Link
|
||||
href={eintrag.href}
|
||||
prefetch={false}
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 pl-3 text-text no-underline"
|
||||
className="record-row py-2 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(eintrag.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{eintrag.label}</span>
|
||||
<span className="grow">{eintrag.secondary}</span>
|
||||
{eintrag.targetType === 'PERSONNEL' ? (
|
||||
<>
|
||||
<span className="record-key" />
|
||||
<span className="record-title">
|
||||
{eintrag.label}
|
||||
{eintrag.secondary ? (
|
||||
<span className="ml-3 font-condensed text-2xs text-text-dim">
|
||||
{eintrag.secondary}
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span className="record-key">{eintrag.label}</span>
|
||||
<span className="record-title">{eintrag.secondary}</span>
|
||||
</>
|
||||
)}
|
||||
<StampMark
|
||||
level={eintrag.classification}
|
||||
name={levelName.get(eintrag.classification) ?? de.common.unknown}
|
||||
@@ -244,16 +265,12 @@ function Akte({
|
||||
<Link
|
||||
href={`/faelle/${akte.caseNumber}`}
|
||||
prefetch
|
||||
className="flex flex-wrap items-baseline gap-x-4 gap-y-1 py-2 pl-3 text-text no-underline"
|
||||
className="record-row py-2 pl-3 text-text no-underline"
|
||||
style={classificationEdgeStyle(akte.classification)}
|
||||
>
|
||||
<span className="font-mono text-xs text-text-dim">{akte.caseNumber}</span>
|
||||
<span className="grow">{akte.title}</span>
|
||||
{zusatz ? (
|
||||
<span className={`font-condensed text-2xs ${dringend ? 'text-stamp-4' : 'text-text-dim'}`}>
|
||||
{zusatz}
|
||||
</span>
|
||||
) : null}
|
||||
<span className="record-key">{akte.caseNumber}</span>
|
||||
<span className="record-title">{akte.title}</span>
|
||||
<span className={`record-meta ${dringend ? 'text-stamp-4' : ''}`}>{zusatz}</span>
|
||||
<StampMark
|
||||
level={akte.classification}
|
||||
name={levelName.get(akte.classification) ?? de.common.unknown}
|
||||
|
||||
Reference in New Issue
Block a user