import sources from develop/0.1.0

This commit is contained in:
Thomas Peetz
2025-04-29 12:52:55 +02:00
committed by Thomas Peetz
parent c30bdd1cd5
commit 19a5623075
670 changed files with 35977 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package tysc
import (
"gitlab.thpeetz.de/kontor/kontor-go/pkg/dao"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/util"
"net/http"
"github.com/gin-gonic/gin"
)
func showIndexPage(c *gin.Context) {
util.Render(c, gin.H{"title": "TradeYourSportsCards", "payload": nil}, "tysc/index.html")
}
func showSportList(c *gin.Context) {
var dao = SportDAO{Db: dao.KontorDb}
if sports, err := dao.FindAll(); err == nil {
util.Render(c, gin.H{"title": "TYSC Sport List", "payload": sports}, "tysc/sports.html")
} else {
c.AbortWithError(http.StatusNotFound, err)
}
}