Versendung: doppelseitiges Sammel PDF und diverse Verbesserungen
This commit is contained in:
1 parent
4b88aca958
commit
feab6135ff
31 files changed
+1302
-96
No files matched your search
@@ -36,6 +36,22 @@ public enum Role: String, Codable, CaseIterable, Identifiable, Sendable, Hashabl
|
||||
}
|
||||
}
|
||||
|
||||
/// Readable combination of roles in canonical order, e.g.
|
||||
/// "Lektor und Kommunionhelfer" when one person fills both roles in the
|
||||
/// same service.
|
||||
public static func combinedTitle(_ roles: [Role]) -> String {
|
||||
let ordered = allCases.filter { roles.contains($0) }
|
||||
switch ordered.count {
|
||||
case 0:
|
||||
return ""
|
||||
case 1:
|
||||
return ordered[0].title
|
||||
default:
|
||||
let leading = ordered.dropLast().map(\.title).joined(separator: ", ")
|
||||
return "\(leading) und \(ordered[ordered.count - 1].title)"
|
||||
}
|
||||
}
|
||||
|
||||
/// The other role a service may need. Lector and communion helper do not
|
||||
/// exclude each other, so one person can fill both at the same service.
|
||||
public var complementary: Role {
|
||||
|
||||
Reference in new issue
Block a user