chore: initial snapshot of tubco people portal
This commit is contained in:
58
backend/workflows/static/workflows/css/buttons.css
Normal file
58
backend/workflows/static/workflows/css/buttons.css
Normal file
@@ -0,0 +1,58 @@
|
||||
:root {
|
||||
--btn-primary-bg: #000078;
|
||||
--btn-primary-border: #000078;
|
||||
--btn-primary-text: #ffffff;
|
||||
--btn-secondary-bg: #ffffff;
|
||||
--btn-secondary-border: #c7d3e0;
|
||||
--btn-secondary-text: #000078;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid transparent;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
line-height: 1.2;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
|
||||
}
|
||||
|
||||
.btn:focus-visible {
|
||||
outline: 3px solid rgba(0, 0, 120, 0.2);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
opacity: 0.55;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn:active:not(:disabled) {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--btn-primary-bg);
|
||||
border-color: var(--btn-primary-border);
|
||||
color: var(--btn-primary-text);
|
||||
}
|
||||
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--btn-secondary-bg);
|
||||
border-color: var(--btn-secondary-border);
|
||||
color: var(--btn-secondary-text);
|
||||
}
|
||||
|
||||
.btn-secondary:hover:not(:disabled) {
|
||||
background: #f8fafc;
|
||||
}
|
||||
324
backend/workflows/static/workflows/css/form_builder.css
Normal file
324
backend/workflows/static/workflows/css/form_builder.css
Normal file
@@ -0,0 +1,324 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
background: #f4f7fb;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.shell {
|
||||
width: min(1280px, 94%);
|
||||
margin: 20px auto 28px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #d8e2f0;
|
||||
border-radius: 14px;
|
||||
padding: 18px;
|
||||
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 190px;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
margin: 0;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
margin: 6px 0 0;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
margin-top: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tab {
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 999px;
|
||||
padding: 8px 14px;
|
||||
text-decoration: none;
|
||||
color: #1f2937;
|
||||
background: #f8fafc;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
background: #000078;
|
||||
color: #ffffff;
|
||||
border-color: #000078;
|
||||
}
|
||||
|
||||
.status {
|
||||
min-height: 22px;
|
||||
margin: 10px 0 8px;
|
||||
color: #334155;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.flash {
|
||||
margin-top: 10px;
|
||||
border: 1px solid #bbf7d0;
|
||||
background: #f0fdf4;
|
||||
color: #166534;
|
||||
border-radius: 10px;
|
||||
padding: 8px 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.flash.error {
|
||||
border-color: #fecaca;
|
||||
background: #fff1f2;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.status.error {
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.status.success {
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.columns {
|
||||
margin-top: 8px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(220px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.columns.single {
|
||||
grid-template-columns: minmax(320px, 1fr);
|
||||
}
|
||||
|
||||
.column {
|
||||
border: 1px solid #d4dce7;
|
||||
border-radius: 12px;
|
||||
background: #f9fbff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 460px;
|
||||
}
|
||||
|
||||
.column h2 {
|
||||
margin: 0;
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid #dbe3ee;
|
||||
font-size: 16px;
|
||||
color: #0f172a;
|
||||
background: #edf3fb;
|
||||
border-radius: 12px 12px 0 0;
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
padding: 10px;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
align-content: start;
|
||||
min-height: 140px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dropzone.drag-over {
|
||||
background: #ecf5ff;
|
||||
}
|
||||
|
||||
.field-card {
|
||||
background: #ffffff;
|
||||
border: 1px solid #d3dbe8;
|
||||
border-radius: 10px;
|
||||
padding: 9px 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.field-card.dragging {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.field-name {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.badges {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 11px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid #d1d5db;
|
||||
padding: 2px 7px;
|
||||
background: #f8fafc;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.badge.locked {
|
||||
background: #e0e7ff;
|
||||
border-color: #c7d2fe;
|
||||
color: #3730a3;
|
||||
}
|
||||
|
||||
.badge.hidden {
|
||||
background: #fff7ed;
|
||||
border-color: #fed7aa;
|
||||
color: #9a3412;
|
||||
}
|
||||
|
||||
.badge.required {
|
||||
background: #dcfce7;
|
||||
border-color: #bbf7d0;
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.options-panel {
|
||||
margin-top: 16px;
|
||||
border: 1px solid #d4dce7;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.options-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.options-head h2 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.category-switch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.category-switch select {
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 8px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.add-option-form {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
|
||||
gap: 8px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.add-option-form input {
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 8px;
|
||||
padding: 8px 9px;
|
||||
}
|
||||
|
||||
.option-table-wrap {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.option-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.option-table th,
|
||||
.option-table td {
|
||||
border: 1px solid #e2e8f0;
|
||||
padding: 7px 8px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.option-table th {
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.option-table input[type='text'] {
|
||||
width: 100%;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 7px;
|
||||
padding: 6px 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.option-row {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.option-row.dragging {
|
||||
opacity: 0.5;
|
||||
background: #ecf5ff;
|
||||
}
|
||||
|
||||
.drag-handle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 6px;
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.options-actions {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 1120px) {
|
||||
.columns {
|
||||
grid-template-columns: repeat(2, minmax(220px, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.add-option-form {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.options-head {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
29
backend/workflows/static/workflows/css/offboarding_form.css
Normal file
29
backend/workflows/static/workflows/css/offboarding_form.css
Normal file
@@ -0,0 +1,29 @@
|
||||
body {
|
||||
font-family: "IBM Plex Sans", "Trebuchet MS", "Segoe UI", sans-serif;
|
||||
margin: 24px;
|
||||
color: #1f2937;
|
||||
background:
|
||||
radial-gradient(900px 520px at 8% 0%, #dbe8ff, transparent),
|
||||
radial-gradient(900px 520px at 92% 0%, #eef4ff, transparent),
|
||||
#edf2fb;
|
||||
}
|
||||
.wrap { max-width: 920px; margin: 0 auto; }
|
||||
.brand-logo { width: 180px; max-width: 100%; height: auto; margin: 0 0 10px; display: block; }
|
||||
.top-link { margin-bottom: 10px; }
|
||||
.card { background: linear-gradient(180deg, #ffffff, #fbfcff); border: 1px solid #d9dcf3; border-radius: 14px; padding: 18px; margin-bottom: 14px; box-shadow: 0 10px 24px rgba(0, 0, 120, 0.08); }
|
||||
h1 { margin-top: 0; color: #000078; }
|
||||
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
||||
.field { margin-bottom: 12px; }
|
||||
.field-full { grid-column: 1 / -1; }
|
||||
label { display: block; font-weight: 600; margin-bottom: 6px; }
|
||||
input, textarea { width: 100%; min-height: 44px; padding: 9px 11px; box-sizing: border-box; border: 1px solid #d4dbf7; border-radius: 10px; background: #fff; }
|
||||
textarea { min-height: 120px; resize: vertical; }
|
||||
.hint { color: #64748b; font-size: 12px; margin-top: 4px; }
|
||||
.results a { display: inline-block; margin: 4px 8px 4px 0; padding: 6px 8px; border: 1px solid #d4dbf7; border-radius: 6px; text-decoration: none; color: #000078; background: #f7f8ff; }
|
||||
.errorlist { color: #b91c1c; margin: 4px 0; }
|
||||
.popup-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.38); display: none; align-items: center; justify-content: center; z-index: 1000; }
|
||||
.popup-backdrop.show { display: flex; }
|
||||
.popup { background: #fff; border: 1px solid #d8e0ec; border-radius: 12px; padding: 18px; width: min(460px, calc(100% - 28px)); box-shadow: 0 18px 40px rgba(2, 6, 23, 0.25); }
|
||||
.popup h3 { margin: 0 0 8px; color: #000078; }
|
||||
.popup p { margin: 0 0 14px; color: #475569; }
|
||||
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }
|
||||
442
backend/workflows/static/workflows/css/onboarding_form.css
Normal file
442
backend/workflows/static/workflows/css/onboarding_form.css
Normal file
@@ -0,0 +1,442 @@
|
||||
:root {
|
||||
--bg-a: #d3e3ff;
|
||||
--bg-b: #eef4ff;
|
||||
--ink: #182233;
|
||||
--muted: #5e6f85;
|
||||
--brand: #000078;
|
||||
--brand-soft: #eef1ff;
|
||||
--line: #d7dfeb;
|
||||
--danger: #c53030;
|
||||
--warn-bg: #fff7ed;
|
||||
--warn-border: #fdba74;
|
||||
--card: #ffffff;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "IBM Plex Sans", "Trebuchet MS", "Segoe UI", sans-serif;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(980px 540px at 12% 0%, var(--bg-a), transparent),
|
||||
radial-gradient(900px 520px at 88% 0%, var(--bg-b), transparent),
|
||||
#edf2fb;
|
||||
min-height: 100vh;
|
||||
padding: 26px 14px;
|
||||
}
|
||||
|
||||
.shell {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
display: grid;
|
||||
grid-template-columns: 290px 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.top-wrap {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
|
||||
.panel,
|
||||
.main {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 12px 28px rgba(30, 52, 87, 0.08);
|
||||
}
|
||||
|
||||
.panel {
|
||||
padding: 18px;
|
||||
height: fit-content;
|
||||
position: sticky;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
.main {
|
||||
padding: 22px;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 28px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.sub {
|
||||
margin: 0 0 16px;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 180px;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0 0 10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.top-link {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.step-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.step-item {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: flex-start;
|
||||
border: 1px solid #d8e0f4;
|
||||
border-radius: 12px;
|
||||
padding: 10px;
|
||||
background: linear-gradient(160deg, #f8faff, #fcfdff);
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.step-item.active {
|
||||
border-color: #9db4ff;
|
||||
background: linear-gradient(160deg, #eaf0ff, #f4f7ff);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 120, 0.08);
|
||||
}
|
||||
|
||||
.step-item:hover {
|
||||
border-color: #b2c3ff;
|
||||
}
|
||||
|
||||
.step-item:focus-visible {
|
||||
outline: 3px solid rgba(0, 0, 120, 0.18);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 999px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--brand-soft);
|
||||
border: 1px solid #c4cdf7;
|
||||
color: var(--brand);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.step-title {
|
||||
font-weight: 700;
|
||||
color: #1d2c68;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.step-sub {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.page {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.page.active {
|
||||
display: block !important;
|
||||
animation: fade 0.2s ease;
|
||||
}
|
||||
|
||||
@keyframes fade {
|
||||
from { opacity: 0.5; transform: translateY(4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.section-card {
|
||||
border: 1px solid #dbe3f0;
|
||||
border-radius: 14px;
|
||||
padding: 14px;
|
||||
background: linear-gradient(160deg, #ffffff, #fbfcff);
|
||||
box-shadow: 0 4px 10px rgba(15, 35, 74, 0.04);
|
||||
}
|
||||
|
||||
.section-stammdaten {
|
||||
background: linear-gradient(160deg, #ffffff, #f8faff);
|
||||
}
|
||||
|
||||
.section-vertrag {
|
||||
background: linear-gradient(160deg, #ffffff, #f7fbff);
|
||||
}
|
||||
|
||||
.section-itsetup {
|
||||
background: linear-gradient(160deg, #ffffff, #f7faff);
|
||||
}
|
||||
|
||||
.section-abschluss {
|
||||
border-color: #c7d4ff;
|
||||
background: linear-gradient(160deg, #f8fbff, #edf3ff);
|
||||
}
|
||||
|
||||
.section-head {
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px dashed #dde4f1;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.section-head h2 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
color: #1d2c68;
|
||||
}
|
||||
|
||||
.section-head p {
|
||||
margin: 4px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.grid-2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.empty-step {
|
||||
border: 1px dashed #d3dbec;
|
||||
border-radius: 10px;
|
||||
padding: 10px 12px;
|
||||
color: #607086;
|
||||
background: #fafcff;
|
||||
}
|
||||
|
||||
.field-full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.field-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.inline-check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.inline-check label {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="url"],
|
||||
input[type="date"],
|
||||
input[type="file"],
|
||||
select,
|
||||
textarea {
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 10px;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
background: #fff;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
textarea {
|
||||
min-height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
input[type="file"] {
|
||||
background: #f8fbff;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
input[type="file"]::file-selector-button {
|
||||
border: 1px solid #c3d2ef;
|
||||
border-radius: 8px;
|
||||
padding: 6px 10px;
|
||||
background: #fff;
|
||||
color: #1d2c68;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input:focus,
|
||||
textarea:focus,
|
||||
select:focus {
|
||||
outline: none;
|
||||
border-color: var(--brand);
|
||||
box-shadow: 0 0 0 3px rgba(0, 0, 120, 0.12);
|
||||
}
|
||||
|
||||
.checkbox-list ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 10px;
|
||||
columns: 2;
|
||||
column-gap: 20px;
|
||||
background: #fcfdff;
|
||||
}
|
||||
|
||||
.checkbox-list li {
|
||||
margin-bottom: 6px;
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
.hint {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.errorlist {
|
||||
color: var(--danger);
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.error-banner {
|
||||
background: var(--warn-bg);
|
||||
border: 1px solid var(--warn-border);
|
||||
border-radius: 10px;
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 14px;
|
||||
color: #9a3412;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.legal {
|
||||
background: #f3f7ff;
|
||||
border: 1px solid #d4ddff;
|
||||
border-left: 4px solid var(--brand);
|
||||
border-radius: 10px;
|
||||
padding: 12px;
|
||||
color: #223b79;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.finish-note {
|
||||
border: 1px solid #c9d8ff;
|
||||
border-radius: 10px;
|
||||
padding: 10px 12px;
|
||||
background: #ffffff;
|
||||
color: #1f3a7b;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.section-abschluss .grid-2 {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.section-abschluss .finish-field:not(.field-full) {
|
||||
border: 1px solid #d8e2ff;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
padding: 10px;
|
||||
min-height: 170px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.section-abschluss .finish-field:not(.field-full) input,
|
||||
.section-abschluss .finish-field:not(.field-full) textarea,
|
||||
.section-abschluss .finish-field:not(.field-full) select {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.section-abschluss .finish-field textarea {
|
||||
min-height: 128px;
|
||||
}
|
||||
|
||||
.section-abschluss .finish-check {
|
||||
border: 1px solid #d8e2ff;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
margin-top: 14px;
|
||||
padding: 12px 10px 2px;
|
||||
border-top: 1px dashed var(--line);
|
||||
background: #f9fbff;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popup-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(15, 23, 42, 0.38);
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.popup-backdrop.show {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.popup {
|
||||
background: #fff;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 18px;
|
||||
width: min(480px, calc(100% - 30px));
|
||||
box-shadow: 0 18px 40px rgba(2, 6, 23, 0.25);
|
||||
}
|
||||
|
||||
.popup h3 {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
.popup p {
|
||||
margin: 0 0 14px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
@media (max-width: 920px) {
|
||||
.shell {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.panel {
|
||||
position: static;
|
||||
}
|
||||
|
||||
.grid-2 {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.checkbox-list ul {
|
||||
columns: 1;
|
||||
}
|
||||
}
|
||||
148
backend/workflows/static/workflows/js/form_builder.js
Normal file
148
backend/workflows/static/workflows/js/form_builder.js
Normal file
@@ -0,0 +1,148 @@
|
||||
(function () {
|
||||
const columnsRoot = document.getElementById('builder-columns');
|
||||
const saveBtn = document.getElementById('save-order');
|
||||
const statusEl = document.getElementById('status-message');
|
||||
if (!columnsRoot || !saveBtn || !statusEl) return;
|
||||
|
||||
const formType = columnsRoot.dataset.formType;
|
||||
let draggingCard = null;
|
||||
|
||||
function setStatus(message, kind) {
|
||||
statusEl.textContent = message || '';
|
||||
statusEl.classList.remove('error', 'success');
|
||||
if (kind) statusEl.classList.add(kind);
|
||||
}
|
||||
|
||||
function getCsrfToken() {
|
||||
const cookie = document.cookie
|
||||
.split(';')
|
||||
.map((x) => x.trim())
|
||||
.find((x) => x.startsWith('csrftoken='));
|
||||
return cookie ? decodeURIComponent(cookie.split('=')[1]) : '';
|
||||
}
|
||||
|
||||
function buildPayload() {
|
||||
const payload = { form_type: formType, columns: {} };
|
||||
document.querySelectorAll('.dropzone').forEach((zone) => {
|
||||
const key = zone.dataset.columnKey;
|
||||
payload.columns[key] = Array.from(zone.querySelectorAll('.field-card')).map(
|
||||
(card) => card.dataset.fieldName
|
||||
);
|
||||
});
|
||||
return payload;
|
||||
}
|
||||
|
||||
function onDragStart(event) {
|
||||
const card = event.currentTarget;
|
||||
draggingCard = card;
|
||||
card.classList.add('dragging');
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', card.dataset.fieldName);
|
||||
}
|
||||
|
||||
function onDragEnd(event) {
|
||||
event.currentTarget.classList.remove('dragging');
|
||||
document.querySelectorAll('.dropzone').forEach((zone) => zone.classList.remove('drag-over'));
|
||||
draggingCard = null;
|
||||
}
|
||||
|
||||
function getInsertBeforeNode(zone, mouseY) {
|
||||
const cards = Array.from(zone.querySelectorAll('.field-card:not(.dragging)'));
|
||||
return cards.find((card) => {
|
||||
const box = card.getBoundingClientRect();
|
||||
return mouseY < box.top + box.height / 2;
|
||||
});
|
||||
}
|
||||
|
||||
function onDragOver(event) {
|
||||
event.preventDefault();
|
||||
const zone = event.currentTarget;
|
||||
zone.classList.add('drag-over');
|
||||
if (!draggingCard) return;
|
||||
const beforeNode = getInsertBeforeNode(zone, event.clientY);
|
||||
if (beforeNode) {
|
||||
zone.insertBefore(draggingCard, beforeNode);
|
||||
} else {
|
||||
zone.appendChild(draggingCard);
|
||||
}
|
||||
}
|
||||
|
||||
function onDragLeave(event) {
|
||||
event.currentTarget.classList.remove('drag-over');
|
||||
}
|
||||
|
||||
document.querySelectorAll('.field-card').forEach((card) => {
|
||||
card.addEventListener('dragstart', onDragStart);
|
||||
card.addEventListener('dragend', onDragEnd);
|
||||
});
|
||||
|
||||
document.querySelectorAll('.dropzone').forEach((zone) => {
|
||||
zone.addEventListener('dragover', onDragOver);
|
||||
zone.addEventListener('dragleave', onDragLeave);
|
||||
zone.addEventListener('drop', (event) => {
|
||||
event.preventDefault();
|
||||
zone.classList.remove('drag-over');
|
||||
});
|
||||
});
|
||||
|
||||
saveBtn.addEventListener('click', async () => {
|
||||
saveBtn.disabled = true;
|
||||
setStatus('Speichere Reihenfolge ...');
|
||||
try {
|
||||
const response = await fetch('/admin-tools/form-builder/save-order/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': getCsrfToken(),
|
||||
},
|
||||
body: JSON.stringify(buildPayload()),
|
||||
});
|
||||
const data = await response.json();
|
||||
if (!response.ok || !data.ok) {
|
||||
throw new Error(data.error || 'Speichern fehlgeschlagen.');
|
||||
}
|
||||
setStatus('Reihenfolge gespeichert.', 'success');
|
||||
} catch (error) {
|
||||
setStatus(error.message || 'Speichern fehlgeschlagen.', 'error');
|
||||
} finally {
|
||||
saveBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
const optionTableBody = document.getElementById('option-table-body');
|
||||
if (optionTableBody) {
|
||||
let draggingRow = null;
|
||||
|
||||
function getOptionInsertBeforeNode(mouseY) {
|
||||
const rows = Array.from(optionTableBody.querySelectorAll('tr.option-row:not(.dragging)'));
|
||||
return rows.find((row) => {
|
||||
const box = row.getBoundingClientRect();
|
||||
return mouseY < box.top + box.height / 2;
|
||||
});
|
||||
}
|
||||
|
||||
optionTableBody.querySelectorAll('tr.option-row').forEach((row) => {
|
||||
row.addEventListener('dragstart', (event) => {
|
||||
draggingRow = row;
|
||||
row.classList.add('dragging');
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', row.querySelector('input[name="option_ids"]')?.value || '');
|
||||
});
|
||||
row.addEventListener('dragend', () => {
|
||||
row.classList.remove('dragging');
|
||||
draggingRow = null;
|
||||
});
|
||||
});
|
||||
|
||||
optionTableBody.addEventListener('dragover', (event) => {
|
||||
event.preventDefault();
|
||||
if (!draggingRow) return;
|
||||
const beforeNode = getOptionInsertBeforeNode(event.clientY);
|
||||
if (beforeNode) {
|
||||
optionTableBody.insertBefore(draggingRow, beforeNode);
|
||||
} else {
|
||||
optionTableBody.appendChild(draggingRow);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user