aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard/milestones.tmpl
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-06-12 14:08:23 +0200
committerGitHub <noreply@github.com>2022-06-12 20:08:23 +0800
commit796c4eca0bacf67c186768de66fcfee21867045f (patch)
tree3fc7947372c955953c0c6d443b05d3585a6ce300 /templates/user/dashboard/milestones.tmpl
parent0097fbc2ac153a686b68af43e791704e9b5cf74b (diff)
downloadgitea-796c4eca0bacf67c186768de66fcfee21867045f.tar.gz
gitea-796c4eca0bacf67c186768de66fcfee21867045f.zip
Prettify number of issues (#17760)
* Prettify number of issues - Use the PrettyNumber function to add commas in large amount of issues. * Use client-side formatting * prettify on both server and client * remove unused i18n entries * handle more cases, support other int types in PrettyNumber * specify locale to avoid issues with node default locale * remove superfluos argument * introduce template helper, octicon tweaks, js refactor * Update modules/templates/helper.go * Apply some suggestions. * Add comment * Update templates/user/dashboard/issues.tmpl Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/user/dashboard/milestones.tmpl')
-rw-r--r--templates/user/dashboard/milestones.tmpl18
1 files changed, 11 insertions, 7 deletions
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
index 385f5c529b..738438423f 100644
--- a/templates/user/dashboard/milestones.tmpl
+++ b/templates/user/dashboard/milestones.tmpl
@@ -38,12 +38,12 @@
<div class="column">
<div class="ui compact tiny menu">
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
- {{svg "octicon-issue-opened" 16 "mr-3"}}
- {{.i18n.Tr "repo.milestones.open_tab" .MilestoneStats.OpenCount}}
+ {{svg "octicon-milestone" 16 "mr-3"}}
+ {{JsPrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{.i18n.Tr "repo.issues.open_title"}}
</a>
<a class="item{{if .IsShowClosed}} active{{end}}" href="{{.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
- {{svg "octicon-issue-closed" 16 "mr-3"}}
- {{.i18n.Tr "repo.milestones.close_tab" .MilestoneStats.ClosedCount}}
+ {{svg "octicon-check" 16 "mr-3"}}
+ {{JsPrettyNumber .MilestoneStats.ClosedCount}}&nbsp;{{.i18n.Tr "repo.issues.closed_title"}}
</a>
</div>
</div>
@@ -103,9 +103,13 @@
{{end}}
{{end}}
<span class="issue-stats">
- {{svg "octicon-issue-opened"}} {{$.i18n.Tr "repo.milestones.open_tab" .NumOpenIssues}}
- {{svg "octicon-issue-closed"}} {{$.i18n.Tr "repo.milestones.close_tab" .NumClosedIssues}}
- {{if .TotalTrackedTime}}{{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}{{end}}
+ {{svg "octicon-issue-opened" 16 "mr-3"}}
+ {{JsPrettyNumber .NumOpenIssues}}&nbsp;{{$.i18n.Tr "repo.issues.open_title"}}
+ {{svg "octicon-check" 16 "mr-3"}}
+ {{JsPrettyNumber .NumClosedIssues}}&nbsp;{{$.i18n.Tr "repo.issues.closed_title"}}
+ {{if .TotalTrackedTime}}
+ {{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}}
+ {{end}}
</span>
</div>
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}