forgejo/routers/web/playground.go
2024-05-22 13:49:48 +02:00

25 lines
477 B
Go

// Copyright 2024 Milovann Yanatchkov
// SPDX-License-Identifier: MIT
package web
import (
"net/http"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/services/context"
)
const (
// tplPlayground home page template
tplPlayground base.TplName = "playground/playground"
)
func Playground(ctx *context.Context) {
if ctx.IsSigned {
ctx.Data["UserName"] = ctx.Doer.DisplayName()
}
ctx.Data["PageIsPlayground"] = true
ctx.HTML(http.StatusOK, tplPlayground)
}