1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Render diff stats server-side (#13579)

Eliminates a flash on page load on the diff stat bars.
This commit is contained in:
silverwind
2020-11-16 00:50:06 +01:00
committed by GitHub
parent 0de546009e
commit efcba9b011
4 changed files with 12 additions and 29 deletions

View File

@@ -208,6 +208,9 @@ func NewFuncMap() []template.FuncMap {
}
return path
},
"DiffStatsWidth": func(adds int, dels int) string {
return fmt.Sprintf("%f", float64(adds)/(float64(adds)+float64(dels))*100)
},
"Json": func(in interface{}) string {
out, err := json.Marshal(in)
if err != nil {