aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/pulls/tab_menu.tmpl
diff options
context:
space:
mode:
authorhiifong <i@hiif.ong>2023-07-03 09:00:28 +0800
committerGitHub <noreply@github.com>2023-07-03 01:00:28 +0000
commit36f1fa779213695db249d2215233e9cec2d5da7c (patch)
tree5a204eb2c34cf2b7b23a26dbb74c2241696630fb /templates/repo/pulls/tab_menu.tmpl
parenteab011db58a3cfdedc6a4d88c354829c38fd84c0 (diff)
downloadgitea-36f1fa779213695db249d2215233e9cec2d5da7c.tar.gz
gitea-36f1fa779213695db249d2215233e9cec2d5da7c.zip
Support displaying diff stats in PR tab bar (#25387)
Fix #25326 --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates/repo/pulls/tab_menu.tmpl')
-rw-r--r--templates/repo/pulls/tab_menu.tmpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl
index f44968c775..6c121bdd1f 100644
--- a/templates/repo/pulls/tab_menu.tmpl
+++ b/templates/repo/pulls/tab_menu.tmpl
@@ -14,4 +14,10 @@
{{$.locale.Tr "repo.pulls.tab_files"}}
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
</a>
+ <span class="item gt-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
+ <span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
+ <span class="diff-stats-bar">
+ <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>
+ </span>
+ </span>
</div>