Skip to content

Commit 60372d1

Browse files
committed
Display template path of current page in dev mode
1 parent 26718a7 commit 60372d1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

modules/context/context.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ func (ctx *Context) RedirectToFirst(location ...string) {
197197
func (ctx *Context) HTML(status int, name base.TplName) {
198198
log.Debug("Template: %s", name)
199199
tmplStartTime := time.Now()
200+
if !setting.IsProd {
201+
ctx.Data["TmpName"] = name
202+
}
200203
ctx.Data["TmplLoadTimes"] = func() string {
201204
return strconv.FormatInt(time.Since(tmplStartTime).Nanoseconds()/1e6, 10) + "ms"
202205
}

templates/base/footer_content.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<footer>
22
<div class="ui container">
33
<div class="ui left">
4-
{{.i18n.Tr "powered_by" "Gitea"}} {{if (or .ShowFooterVersion .PageIsAdmin)}}{{.i18n.Tr "version"}}: {{AppVer}}{{end}} {{if ShowFooterTemplateLoadTime}}{{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong>{{end}}
4+
{{.i18n.Tr "powered_by" "Gitea"}} {{if (or .ShowFooterVersion .PageIsAdmin)}}{{.i18n.Tr "version"}}: {{AppVer}}{{end}} {{if ShowFooterTemplateLoadTime}}{{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> {{.i18n.Tr "template"}}: <strong>{{if .TmpName}}{{.TmpName}}{{end}} {{call .TmplLoadTimes}}</strong>{{end}}
55
</div>
66
<div class="ui right links">
77
{{if .ShowFooterBranding}}

0 commit comments

Comments
 (0)