fix(admin): "Material hinzufügen" in die Kartenspalte verschoben
Saß bisher als volle Bar über Sidebar+Kartenspalte (Screenshot-Fund) - jetzt Teil der rechten Kartenspalte, direkt über der Positionsliste. Sidebar wird nur noch gerendert, wenn Positionen existieren (Edge-Case: leeres Objekt konnte bisher kein erstes Material bekommen, da der ganze Bereich hinter positionen.length>0 hing). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVgbozhYmuEhiEJHffRXCV
This commit is contained in:
@@ -152,7 +152,33 @@ export function ObjektPositionenPanel({ objektId, vorlageId, materialien, onFehl
|
|||||||
const verfuegbareMaterialien = materialien.filter((m) => !vorhandeneMaterialIds.has(m.id));
|
const verfuegbareMaterialien = materialien.filter((m) => !vorhandeneMaterialIds.has(m.id));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "1.25rem" }}>
|
||||||
|
{positionen.length > 0 && (
|
||||||
|
<nav
|
||||||
|
className="card"
|
||||||
|
style={{ flex: "0 0 12rem", width: "12rem", boxSizing: "border-box", padding: "0.5rem" }}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className={aktivesFach === null ? "btn btn-primary btn-block" : "btn btn-secondary btn-block"}
|
||||||
|
style={{ marginBottom: "0.3rem" }}
|
||||||
|
onClick={() => setAktivesFach(null)}
|
||||||
|
>
|
||||||
|
Alle ({positionen.length})
|
||||||
|
</button>
|
||||||
|
{fachGruppen.map(([fach, gruppenPositionen]) => (
|
||||||
|
<button
|
||||||
|
key={fach}
|
||||||
|
className={aktivesFach === fach ? "btn btn-primary btn-block" : "btn btn-secondary btn-block"}
|
||||||
|
style={{ marginBottom: "0.3rem" }}
|
||||||
|
onClick={() => setAktivesFach(fach)}
|
||||||
|
>
|
||||||
|
{fach} ({gruppenPositionen.length})
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</nav>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div style={{ flex: "1 1 0%", minWidth: 0 }}>
|
||||||
<div className="row" style={{ flexWrap: "wrap", marginBottom: "1rem" }}>
|
<div className="row" style={{ flexWrap: "wrap", marginBottom: "1rem" }}>
|
||||||
<select
|
<select
|
||||||
className="input"
|
className="input"
|
||||||
@@ -186,32 +212,6 @@ export function ObjektPositionenPanel({ objektId, vorlageId, materialien, onFehl
|
|||||||
|
|
||||||
{positionen.length === 0 && <p className="text-muted">Keine Positionen in diesem Objekt.</p>}
|
{positionen.length === 0 && <p className="text-muted">Keine Positionen in diesem Objekt.</p>}
|
||||||
|
|
||||||
{positionen.length > 0 && (
|
|
||||||
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "1.25rem" }}>
|
|
||||||
<nav
|
|
||||||
className="card"
|
|
||||||
style={{ flex: "0 0 12rem", width: "12rem", boxSizing: "border-box", padding: "0.5rem" }}
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
className={aktivesFach === null ? "btn btn-primary btn-block" : "btn btn-secondary btn-block"}
|
|
||||||
style={{ marginBottom: "0.3rem" }}
|
|
||||||
onClick={() => setAktivesFach(null)}
|
|
||||||
>
|
|
||||||
Alle ({positionen.length})
|
|
||||||
</button>
|
|
||||||
{fachGruppen.map(([fach, gruppenPositionen]) => (
|
|
||||||
<button
|
|
||||||
key={fach}
|
|
||||||
className={aktivesFach === fach ? "btn btn-primary btn-block" : "btn btn-secondary btn-block"}
|
|
||||||
style={{ marginBottom: "0.3rem" }}
|
|
||||||
onClick={() => setAktivesFach(fach)}
|
|
||||||
>
|
|
||||||
{fach} ({gruppenPositionen.length})
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div style={{ flex: "1 1 0%", minWidth: 0 }}>
|
|
||||||
<ul className="card-list">
|
<ul className="card-list">
|
||||||
{sichtbarePositionen.map((p) => {
|
{sichtbarePositionen.map((p) => {
|
||||||
const typ = materialtyp(p.material_id);
|
const typ = materialtyp(p.material_id);
|
||||||
@@ -297,7 +297,5 @@ export function ObjektPositionenPanel({ objektId, vorlageId, materialien, onFehl
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user