mirror of
https://github.com/go-gitea/gitea
synced 2024-11-10 17:25:54 +01:00
Fix date display bug (#24047)
Follow https://github.com/go-gitea/gitea/pull/23988#pullrequestreview-1377696819 Many template helper functions are not good enough and cause various problems, that's why I am cleaning them. ## Before ![image](https://user-images.githubusercontent.com/51889757/230930898-0c48150f-de85-461d-9455-efcfdc36b644.png) ![image](https://user-images.githubusercontent.com/2114189/231111676-b0da1392-5e47-4f89-a81e-85156aca5cfd.png) ## After ![image](https://user-images.githubusercontent.com/2114189/231111732-920f304d-dd44-4c54-9f5f-518e325006fc.png)
This commit is contained in:
parent
704f3aa91c
commit
25faee3c5f
@ -42,7 +42,7 @@
|
|||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
|
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<span class="issue-stats">
|
<span class="issue-stats">
|
||||||
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<div class="column">
|
<div class="column">
|
||||||
{{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}}
|
{{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}}
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
|
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{svg "octicon-calendar"}}
|
{{svg "octicon-calendar"}}
|
||||||
{{if .Milestone.DeadlineString}}
|
{{if .Milestone.DeadlineString}}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
|
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{svg "octicon-calendar"}}
|
{{svg "octicon-calendar"}}
|
||||||
{{if .DeadlineString}}
|
{{if .DeadlineString}}
|
||||||
|
@ -125,9 +125,9 @@
|
|||||||
{{template "shared/user/authorlink" .Poster}}
|
{{template "shared/user/authorlink" .Poster}}
|
||||||
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
|
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
|
||||||
{{if eq $.Issue.PullRequest.Status 3}}
|
{{if eq $.Issue.PullRequest.Status 3}}
|
||||||
{{$.locale.Tr "repo.issues.manually_pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}}
|
{{$.locale.Tr "repo.issues.manually_pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Safe}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$.locale.Tr "repo.issues.pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}}
|
{{$.locale.Tr "repo.issues.pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Safe}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
|
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<span class="issue-stats">
|
<span class="issue-stats">
|
||||||
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
|
{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{svg "octicon-calendar"}}
|
{{svg "octicon-calendar"}}
|
||||||
{{if .DeadlineString}}
|
{{if .DeadlineString}}
|
||||||
|
Loading…
Reference in New Issue
Block a user