weiter an der funktionalität der events gearbeitet
This commit is contained in:
parent
309fdcf175
commit
1e4c367836
14
func.go
14
func.go
|
@ -146,10 +146,20 @@ func htmlReplacer(input string, activePage string) string {
|
|||
events := getEvents()
|
||||
|
||||
if len(events) == 0 {
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlNewBanner("Rundgang", "https://www.chaostreff-dortmund.de/rundgang/"))
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlElement("h4", "Keine Events in der nächsten Zeit!", ""))
|
||||
} else {
|
||||
tempA, tempB := "", ""
|
||||
for i, Event := range events {
|
||||
if i == 24 {
|
||||
break
|
||||
}
|
||||
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlNewBanner("Rundgang", "https://www.chaostreff-dortmund.de/rundgang/"))
|
||||
tempA = htmlElement("h2", Event.title, "")
|
||||
tempA += htmlElement("p", Event.description, "")
|
||||
tempA += htmlElement("p", Event.date, "")
|
||||
tempB += htmlElement("div", tempA, "class=\"event\"")
|
||||
}
|
||||
output = strings.ReplaceAll(output, "!EVENTS", tempB)
|
||||
}
|
||||
|
||||
output = strings.ReplaceAll(output, "!NEWBANNER", htmlNewBanner("Rundgang", "https://www.chaostreff-dortmund.de/rundgang/"))
|
||||
|
|
Loading…
Reference in New Issue