diff --git a/routers/web/playground.go b/routers/web/playground.go index 443a06b1c3..83aa32e828 100644 --- a/routers/web/playground.go +++ b/routers/web/playground.go @@ -11,10 +11,15 @@ import ( ) const ( - // tplPlayground home page template - tplPlayground base.TplName = "playground" + tplPlayground base.TplName = "playground/playground" + tplPlaygroundReplIframe base.TplName = "playground/repl-iframe" ) +func PlaygroundReplIframe(ctx *context.Context) { + ctx.Data["PageIsPlayground"] = true + ctx.HTML(http.StatusOK, tplPlaygroundReplIframe) +} + func Playground(ctx *context.Context) { if ctx.IsSigned { ctx.Data["UserName"] = ctx.Doer.DisplayName() diff --git a/routers/web/web.go b/routers/web/web.go index bea5746ff3..c8519e4af5 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -471,6 +471,7 @@ func registerRoutes(m *web.Route) { m.Get("/", Home) m.Get("/playground", Playground) + m.Get("/playground/repl-iframe", PlaygroundReplIframe) m.Get("/sitemap.xml", sitemapEnabled, ignExploreSignIn, HomeSitemap) m.Group("/.well-known", func() { m.Get("/openid-configuration", auth.OIDCWellKnown) diff --git a/templates/playground.tmpl b/templates/playground/playground.tmpl similarity index 100% rename from templates/playground.tmpl rename to templates/playground/playground.tmpl diff --git a/templates/playground/repl-iframe.tmpl b/templates/playground/repl-iframe.tmpl new file mode 100644 index 0000000000..09c8362011 --- /dev/null +++ b/templates/playground/repl-iframe.tmpl @@ -0,0 +1,11 @@ + +{{template "base/head" .}} + + + + +{{template "base/footer" .}}