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
@@ -48,6 +48,29 @@ func (r Role) Complementary() Role {
|
||||
|
||||
func (r Role) IsValid() bool { return r == RoleLector || r == RoleHelper }
|
||||
|
||||
// RoleTitles returns a readable list of roles in canonical order. A person can
|
||||
// hold both roles in the same service, which is shown as
|
||||
// "Lektor und Kommunionhelfer" instead of two separate entries.
|
||||
func RoleTitles(roles []Role) string {
|
||||
var titles []string
|
||||
for _, role := range AllRoles {
|
||||
for _, candidate := range roles {
|
||||
if candidate == role {
|
||||
titles = append(titles, role.Title())
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
switch len(titles) {
|
||||
case 0:
|
||||
return ""
|
||||
case 1:
|
||||
return titles[0]
|
||||
default:
|
||||
return strings.Join(titles[:len(titles)-1], ", ") + " und " + titles[len(titles)-1]
|
||||
}
|
||||
}
|
||||
|
||||
type ChurchSymbol string
|
||||
|
||||
const (
|
||||
|
||||
Reference in new issue
Block a user