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/repo/issue/milestones.tmpl | |
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/repo/issue/milestones.tmpl')
-rw-r--r-- | templates/repo/issue/milestones.tmpl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 0a113e2484..0336d35c17 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -18,11 +18,11 @@ <div class="ui compact tiny menu"> <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}"> {{svg "octicon-milestone" 16 "gt-mr-3"}} - {{JsPrettyNumber .OpenCount}} {{.locale.Tr "repo.issues.open_title"}} + {{LocaleNumber .OpenCount}} {{.locale.Tr "repo.issues.open_title"}} </a> <a class="item{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=closed&q={{$.Keyword}}"> {{svg "octicon-check" 16 "gt-mr-3"}} - {{JsPrettyNumber .ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} + {{LocaleNumber .ClosedCount}} {{.locale.Tr "repo.issues.closed_title"}} </a> </div> </div> @@ -84,9 +84,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}} {{if .UpdatedUnix}}{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.update_ago" (.TimeSinceUpdate|Sec2Time)}}{{end}} </span> |