diff options
-rw-r--r-- | pkg/template/template.go | 17 | ||||
-rw-r--r-- | templates/base/footer.tmpl | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/pkg/template/template.go b/pkg/template/template.go index eb85ca7b..6d6d09da 100644 --- a/pkg/template/template.go +++ b/pkg/template/template.go @@ -33,6 +33,9 @@ func NewFuncMap() []template.FuncMap { "GoVer": func() string { return strings.Title(runtime.Version()) }, + "Year": func() int { + return time.Now().Year() + }, "UseHTTPS": func() bool { return strings.HasPrefix(setting.AppURL, "https") }, @@ -94,13 +97,13 @@ func NewFuncMap() []template.FuncMap { } return str[start:end] }, - "Join": strings.Join, - "EllipsisString": tool.EllipsisString, - "DiffTypeToStr": DiffTypeToStr, - "DiffLineTypeToStr": DiffLineTypeToStr, - "Sha1": Sha1, - "ShortSHA1": tool.ShortSHA1, - "MD5": tool.MD5, + "Join": strings.Join, + "EllipsisString": tool.EllipsisString, + "DiffTypeToStr": DiffTypeToStr, + "DiffLineTypeToStr": DiffLineTypeToStr, + "Sha1": Sha1, + "ShortSHA1": tool.ShortSHA1, + "MD5": tool.MD5, "ActionContent2Commits": ActionContent2Commits, "EscapePound": EscapePound, "RenderCommitMessage": RenderCommitMessage, diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 666d826c..562009d1 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -7,7 +7,7 @@ <footer> <div class="ui container"> <div class="ui left"> - © 2018 Gogs {{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}} + © {{Year}} Gogs {{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}} </div> <div class="ui right links"> {{if .ShowFooterBranding}} |