an der funktionalität der events gearbeitet
This commit is contained in:
parent
69bbb9aabb
commit
0c8813addf
|
@ -1,5 +1,5 @@
|
|||
username: root
|
||||
password:
|
||||
username: admin
|
||||
password: password
|
||||
address: localhost
|
||||
port: 3306
|
||||
database: ctdo
|
9
func.go
9
func.go
|
@ -34,6 +34,7 @@ func handler() {
|
|||
if keys != nil {
|
||||
for _, key := range keys {
|
||||
httpHandleFunc("admin/"+key, "./web/pages/admin/dashboard.html", "text/html")
|
||||
httpHandleFuncWithPOST("admin/"+key+"/addEvent", "./web/pages/admin/dashboard.html", "text/html")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +147,8 @@ func htmlReplacer(input string, activePage string) string {
|
|||
events := getEvents()
|
||||
|
||||
if len(events) == 0 {
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlElement("h4", "Keine Events in der nächsten Zeit!", ""))
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlElement("h4", "Keine Events in der nächsten Zeit.", ""))
|
||||
output = strings.ReplaceAll(output, "!NEXTEVENTS", htmlElement("h4", "Keine Events in der nächsten Zeit.", ""))
|
||||
} else {
|
||||
tempA, tempB := "", ""
|
||||
for i, Event := range events {
|
||||
|
@ -159,11 +161,14 @@ func htmlReplacer(input string, activePage string) string {
|
|||
tempA += htmlElement("p", Event.date, "")
|
||||
tempB += htmlElement("div", tempA, "class=\"event\"")
|
||||
}
|
||||
output = strings.ReplaceAll(output, "!EVENTS", tempB)
|
||||
output = strings.ReplaceAll(output, "!EVENTS", htmlElement("div", tempB, "class=\"eventList\""))
|
||||
output = strings.ReplaceAll(output, "!NEXTEVENTS", htmlElement("div", string(tempB[0]+tempB[1]+tempB[2]+tempB[3]), "class=\"eventList\""))
|
||||
}
|
||||
|
||||
output = strings.ReplaceAll(output, "!NEWBANNER", htmlNewBanner("Rundgang", "https://www.chaostreff-dortmund.de/rundgang/"))
|
||||
|
||||
output = strings.ReplaceAll(output, "!ADMINKEY", activePage)
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,15 @@
|
|||
</header>
|
||||
<main>
|
||||
!RAUMSTATUS
|
||||
!EVENTS
|
||||
|
||||
<form action="admin/!ADMINKEY/addEvent" method="post">
|
||||
<input type="text" name="title" placeholder="Titel"><br>
|
||||
<input type="text" name="description" placeholder="Beschreibung"><br>
|
||||
<label for="media">Bilder:</label><input type="file" name="media" id="media" multiple><br>
|
||||
<label for="date">Datum:</label><input type="date" name="date" id="date"><br>
|
||||
<input type="submit" value="Event Erstellen">
|
||||
</form>
|
||||
</main>
|
||||
<footer>
|
||||
!FOOTERNAV
|
||||
|
|
Loading…
Reference in New Issue