diff options
author | Lauris BH <lauris@nix.lv> | 2020-01-20 12:07:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 12:07:30 +0200 |
commit | 81cfe243f9cb90b0a75de7a03bb2d264c97f0036 (patch) | |
tree | 0b98db10d626eff18384ad460ec04e2a6da61468 /modules/templates | |
parent | 7d7ab1eeae43d99fe329878ac9c8db5e45e2dee5 (diff) | |
download | gitea-81cfe243f9cb90b0a75de7a03bb2d264c97f0036.tar.gz gitea-81cfe243f9cb90b0a75de7a03bb2d264c97f0036.zip |
Add top author stats to activity page (#9615)
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index a9fc652ca9..1e5fa01089 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -182,6 +182,13 @@ func NewFuncMap() []template.FuncMap { } return path }, + "Json": func(in interface{}) string { + out, err := json.Marshal(in) + if err != nil { + return "" + } + return string(out) + }, "JsonPrettyPrint": func(in string) string { var out bytes.Buffer err := json.Indent(&out, []byte(in), "", " ") |