]> source.dussan.org Git - gitea.git/commitdiff
Fixed 0 closed issues not show 50% closed on activty page (#3802)
authorMorgan Bazalgette <git@howl.moe>
Mon, 16 Apr 2018 05:26:53 +0000 (07:26 +0200)
committerLauris BH <lauris@nix.lv>
Mon, 16 Apr 2018 05:26:53 +0000 (08:26 +0300)
Fixes #3656. Also adds a light grey bar when there are both 0 merged
prs/closed issues and 0 open prs/issues.

templates/repo/activity.tmpl

index f5454afb9346a3e6e78768524aa3dad89f0116cc..ed959c5b0198f72686f47f738266f1bd21c447af 100644 (file)
                                <div class="column">
                                        {{if gt .Activity.ActivePRCount 0}}
                                        <div class="stats-table">
-                                               <a href="#merged-pull-requests" class="table-cell tiny background purple" style="width: {{.Activity.MergedPRPerc}}%"></a>
+                                               <a href="#merged-pull-requests" class="table-cell tiny background purple" style="width: {{.Activity.MergedPRPerc}}{{if ne .Activity.MergedPRPerc 0}}%{{end}}"></a>
                                                <a href="#proposed-pull-requests" class="table-cell tiny background green"></a>
                                        </div>
+                                       {{else}}
+                                       <div class="stats-table">
+                                               <a class="table-cell tiny background light grey"></a>
+                                       </div>
                                        {{end}}
                                        {{.i18n.Tr (TrN .i18n.Lang .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n") .Activity.ActivePRCount | Safe }}
                                </div>
                                <div class="column">
                                        {{if gt .Activity.ActiveIssueCount 0}}
                                        <div class="stats-table">
-                                               <a href="#closed-issues" class="table-cell tiny background red" style="width: {{.Activity.ClosedIssuePerc}}%"></a>
+                                               <a href="#closed-issues" class="table-cell tiny background red" style="width: {{.Activity.ClosedIssuePerc}}{{if ne .Activity.ClosedIssuePerc 0}}%{{end}}"></a>
                                                <a href="#new-issues" class="table-cell tiny background green"></a>
                                        </div>
+                                       {{else}}
+                                       <div class="stats-table">
+                                               <a class="table-cell tiny background light grey"></a>
+                                       </div>
                                        {{end}}
                                        {{.i18n.Tr (TrN .i18n.Lang .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n") .Activity.ActiveIssueCount | Safe }}
                                </div>