aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/diff/stats.tmpl
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-11-16 00:50:06 +0100
committerGitHub <noreply@github.com>2020-11-15 23:50:06 +0000
commitefcba9b011b328a425d8b2c8d9f2273bfbaa7340 (patch)
tree92f7812aa0f184b6b76b957eee56d19b14f31ef6 /templates/repo/diff/stats.tmpl
parent0de546009e466486cd88dfa98d07d8775bd3087d (diff)
downloadgitea-efcba9b011b328a425d8b2c8d9f2273bfbaa7340.tar.gz
gitea-efcba9b011b328a425d8b2c8d9f2273bfbaa7340.zip
Render diff stats server-side (#13579)
Eliminates a flash on page load on the diff stat bars.
Diffstat (limited to 'templates/repo/diff/stats.tmpl')
-rw-r--r--templates/repo/diff/stats.tmpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl
new file mode 100644
index 0000000000..7e5d34c3dd
--- /dev/null
+++ b/templates/repo/diff/stats.tmpl
@@ -0,0 +1,6 @@
+<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
+<span class="bar">
+ <div class="pull-left add" style="width: {{DiffStatsWidth .Addition .Deletion}}%"></div>
+ <div class="pull-left del"></div>
+</span>
+<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>