Gastansicht, Verbesserungen bei Planung
This commit is contained in:
1 parent
b3afa3ef32
commit
c08d43e7dd
38 files changed
+3845
-219
No files matched your search
@@ -8,6 +8,9 @@ struct PlanResultSheet: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
if let result = model.planResult {
|
||||
let canOfferBeyond = !result.unfilled.isEmpty
|
||||
&& !result.assignments.contains(where: \.beyondPreferences)
|
||||
&& model.people.contains { $0.active && $0.allowBeyondPreferences }
|
||||
SheetHeader(
|
||||
icon: result.unfilled.isEmpty ? "checkmark.seal" : "exclamationmark.triangle",
|
||||
title: result.unfilled.isEmpty ? "Planung abgeschlossen" : "Planung mit Lücken",
|
||||
@@ -98,12 +101,31 @@ struct PlanResultSheet: View {
|
||||
.clipShape(RoundedRectangle(cornerRadius: 9))
|
||||
.overlay(RoundedRectangle(cornerRadius: 9).strokeBorder(LP.line.opacity(0.55), lineWidth: 0.8))
|
||||
}
|
||||
|
||||
if canOfferBeyond {
|
||||
let flagged = model.people.filter { $0.active && $0.allowBeyondPreferences }
|
||||
HStack(alignment: .top, spacing: 9) {
|
||||
Image(systemName: "arrow.up.right.circle")
|
||||
.foregroundStyle(LP.burgundy)
|
||||
Text("\(flagged.count) \(flagged.count == 1 ? "Person hat" : "Personen haben") sich bereit erklärt, nach Rückfrage auch über die eigenen Präferenzen hinaus eingeplant zu werden. Diese Einsätze werden im Plan besonders gekennzeichnet.")
|
||||
.font(.system(size: 10.5))
|
||||
.foregroundStyle(LP.inkSecondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
.padding(12)
|
||||
.background(RoundedRectangle(cornerRadius: 10).fill(LP.burgundySoft.opacity(0.5)))
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(22)
|
||||
}
|
||||
|
||||
SheetFooter {
|
||||
if canOfferBeyond {
|
||||
PrimaryActionButton(title: "Über Präferenzen hinaus planen", icon: "arrow.up.right") {
|
||||
_ = model.autoPlan(replaceExisting: false, allowBeyond: true)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
SecondaryActionButton(title: "Statistik ansehen", icon: "chart.xyaxis.line") {
|
||||
model.planResult = nil
|
||||
|
||||
Reference in new issue
Block a user