diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-04 00:58:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 12:58:09 -0400 |
commit | 19de52e0f4cbd2d62f9d41589fe8815c2c3ceef2 (patch) | |
tree | f5e2f0a5431f315946aed6d72e40e5e9893dabc0 /templates/user/dashboard | |
parent | 01d9466bfdbb2e043a03368ca7872944db211f49 (diff) | |
download | gitea-19de52e0f4cbd2d62f9d41589fe8815c2c3ceef2.tar.gz gitea-19de52e0f4cbd2d62f9d41589fe8815c2c3ceef2.zip |
Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861)
Follow #21429 & #22861
Use `<gitea-locale-number>` instead of backend `PrettyNumber`. All old
`PrettyNumber` related functions are removed. A lot of code could be
simplified.
And some functions haven't been used for long time (dead code), so they
are also removed by the way (eg: `SplitStringAtRuneN`, `Dedent`)
This PR only tries to improve the `PrettyNumber` rendering problem, it
doesn't touch the "plural" problem.
Screenshot:
![image](https://user-images.githubusercontent.com/2114189/229290804-1f63db65-1e34-4a54-84ba-e00b44331b17.png)
![image](https://user-images.githubusercontent.com/2114189/229290911-c88dea00-b11d-48dd-accb-9f52edd73ce4.png)
Diffstat (limited to 'templates/user/dashboard')
-rw-r--r-- | templates/user/dashboard/issues.tmpl | 4 | ||||
-rw-r--r-- | templates/user/dashboard/milestones.tmpl | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 766a6bf7d8..88ab1f9b73 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -65,11 +65,11 @@ <div class="ui compact tiny menu"> <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}"> {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{JsPrettyNumber .IssueStats.OpenCount}} {{.locale.Tr "repo.issues.open_title"}} + {{LocaleNumber .IssueStats.OpenCount}} {{.locale.Tr "repo.issues.open_title"}} </a> <a class="item{{if .IsShowClosed}} active{{end}}" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}"> {{svg "octicon-issue-closed" 16 "gt-mr-3"}} - {{JsPrettyNumber .IssueStats.ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} + {{LocaleNumber .IssueStats.ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} </a> </div> </div> diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl index c20ea9d041..1c379ac09d 100644 --- a/templates/user/dashboard/milestones.tmpl +++ b/templates/user/dashboard/milestones.tmpl @@ -39,11 +39,11 @@ <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-milestone" 16 "gt-mr-3"}} - {{JsPrettyNumber .MilestoneStats.OpenCount}} {{.locale.Tr "repo.issues.open_title"}} + {{LocaleNumber .MilestoneStats.OpenCount}} {{.locale.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-check" 16 "gt-mr-3"}} - {{JsPrettyNumber .MilestoneStats.ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} + {{LocaleNumber .MilestoneStats.ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} </a> </div> </div> @@ -104,9 +104,9 @@ {{end}} <span class="issue-stats"> {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{JsPrettyNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} + {{LocaleNumber .NumOpenIssues}} {{$.locale.Tr "repo.issues.open_title"}} {{svg "octicon-check" 16 "gt-mr-3"}} - {{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} + {{LocaleNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} {{if .TotalTrackedTime}} {{svg "octicon-clock"}} {{.TotalTrackedTime|Sec2Time}} {{end}} |