rename html fragments to go.tmpl extension

This commit is contained in:
2025-05-28 20:08:25 +00:00
parent 3d677a46ee
commit 28c60aecc9
7 changed files with 10 additions and 9 deletions

View File

@@ -50,11 +50,12 @@ func HandleGETIndex(c *gin.Context) {
if err != nil {
common.HandleNonFatalError(c, err)
}
c.HTML(http.StatusOK, "html/index.html", gin.H{
page := gin.H{
"global": common.Global,
"page": "index",
"instances": instances,
})
}
c.HTML(http.StatusOK, "html/index.html", page)
} else { // return index without populating
c.Redirect(http.StatusFound, "/login") // if user is not authed, redirect user to login page
}
@@ -68,7 +69,7 @@ func HandleGETInstancesFragment(c *gin.Context) {
common.HandleNonFatalError(c, err)
}
c.Header("Content-Type", "text/plain")
common.TMPL.ExecuteTemplate(c.Writer, "html/index-instances.frag", gin.H{
common.TMPL.ExecuteTemplate(c.Writer, "html/index-instances.go.tmpl", gin.H{
"instances": instances,
})
c.Status(http.StatusOK)