Add admin page

This commit is contained in:
2020-10-11 22:45:08 +02:00
parent a82f090370
commit e5c0df6f6f
7 changed files with 137 additions and 4 deletions

14
handler/admin.go Normal file
View File

@@ -0,0 +1,14 @@
package handler
import (
"github.com/gin-gonic/gin"
"github.com/jackc/pgx/v4/pgxpool"
"net/http"
"trikotwaschliste/database"
)
func AdminMainPage(pool *pgxpool.Pool) gin.HandlerFunc {
return func(c *gin.Context) {
c.HTML(http.StatusAccepted, "adminindex.html", database.DbAdminMainpage(pool))
}
}

View File

@@ -25,6 +25,6 @@ func UploadName(pool *pgxpool.Pool) gin.HandlerFunc {
func Credits() gin.HandlerFunc {
return func(c *gin.Context) {
c.HTML(http.StatusAccepted, "credits.html", gin.H{"version":"1.0"})
c.HTML(http.StatusAccepted, "credits.html", gin.H{"version":"1.1"})
}
}