From 60372d13324eca17b4ee90a5c66d1c26084bcf66 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 11 Feb 2022 11:53:54 +0800 Subject: [PATCH 1/3] Display template path of current page in dev mode --- modules/context/context.go | 3 +++ templates/base/footer_content.tmpl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/context/context.go b/modules/context/context.go index 7ae37208e47bd..f61825a3e8de7 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -197,6 +197,9 @@ func (ctx *Context) RedirectToFirst(location ...string) { func (ctx *Context) HTML(status int, name base.TplName) { log.Debug("Template: %s", name) tmplStartTime := time.Now() + if !setting.IsProd { + ctx.Data["TmpName"] = name + } ctx.Data["TmplLoadTimes"] = func() string { return strconv.FormatInt(time.Since(tmplStartTime).Nanoseconds()/1e6, 10) + "ms" } diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 979c03146cdc5..c621461714bf7 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,7 +1,7 @@