This commit is contained in:
@@ -30,25 +30,24 @@ func ListMediaLoFis(c *gin.Context) {
|
||||
result := schema.DB.Find(&lofis)
|
||||
log.Printf("found %d MediaLoFis", result.RowsAffected)
|
||||
c.JSON(http.StatusOK, lofis)
|
||||
// c.JSON(http.StatusOK, gin.H{
|
||||
// "message": "All MediaLoFis",
|
||||
// "lofis": lofis,
|
||||
// })
|
||||
}
|
||||
|
||||
func ListMediaActorsGetHandler(c *gin.Context) {
|
||||
session := sessions.Default(c)
|
||||
user := session.Get(globals.UserKey)
|
||||
logger := slog.Get(c)
|
||||
|
||||
var actors []schema.MediaActor
|
||||
|
||||
result := schema.DB.Find(&actors)
|
||||
log.Printf("found %d MediaActors", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "media_actor.tmpl", gin.H{
|
||||
logger.Info("ListMediaActorsGetHandler", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "mediaactors.html", gin.H{
|
||||
"title": "Kontor Gin",
|
||||
"version": "0.4.0",
|
||||
"content": "Media Actors...",
|
||||
"actors": actors,
|
||||
"login": globals.LoginUrl,
|
||||
"logout": globals.LogoutUrl,
|
||||
"user": user,
|
||||
})
|
||||
}
|
||||
@@ -61,12 +60,14 @@ func ListMediaFilesGetHandler(c *gin.Context) {
|
||||
var files []schema.MediaFile
|
||||
|
||||
result := schema.DB.Find(&files)
|
||||
logger.Info("found MediaFiles", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "media_files.tmpl", gin.H{
|
||||
logger.Info("ListMediaFilesGetHandler", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "mediafiles.html", gin.H{
|
||||
"title": "Kontor Gin",
|
||||
"version": "0.4.0",
|
||||
"content": "Media Files...",
|
||||
"files": files,
|
||||
"login": globals.LoginUrl,
|
||||
"logout": globals.LogoutUrl,
|
||||
"user": user,
|
||||
})
|
||||
|
||||
@@ -80,14 +81,14 @@ func ListMediaLoFisGetHandler(c *gin.Context) {
|
||||
var lofis []schema.MediaLoFi
|
||||
|
||||
result := schema.DB.Find(&lofis)
|
||||
logger.Info("found MediaActors", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "media_lofi.tmpl", gin.H{
|
||||
logger.Info("ListMediaLoFisGetHandler", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "media_lofi.html", gin.H{
|
||||
"title": "Kontor Gin",
|
||||
"version": "0.4.0",
|
||||
"content": "Media LoFis...",
|
||||
"lofis": lofis,
|
||||
"login": globals.LoginUrl,
|
||||
"logout": globals.LogoutUrl,
|
||||
"user": user,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user