mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Refactor DateUtils and merge TimeSince (#32409)
Follow #32383 and #32402
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
{{.Fingerprint}}
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (ctx.DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{ctx.DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - <span>{{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}</span></i>
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - <span>{{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}</span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
|
@@ -17,7 +17,7 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>{{FileSize .Size}}</td>
|
||||
<td>{{TimeSince .CreatedUnix.AsTime ctx.Locale}}</td>
|
||||
<td>{{DateUtils.TimeSince .CreatedUnix}}</td>
|
||||
<td class="right aligned">
|
||||
<a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
|
||||
<button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}">
|
||||
|
@@ -32,7 +32,7 @@
|
||||
{{ctx.Locale.Tr "repo.diff.commit"}}
|
||||
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">{{ShortSha .SHA}}</a>
|
||||
</td>
|
||||
<td>{{TimeSince .When ctx.Locale}}</td>
|
||||
<td>{{DateUtils.TimeSince .When}}</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
{{$lock.Owner.DisplayName}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{TimeSince .Created ctx.Locale}}</td>
|
||||
<td>{{DateUtils.TimeSince .Created}}</td>
|
||||
<td class="right aligned">
|
||||
<form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post">
|
||||
{{$.CsrfTokenHtml}}
|
||||
|
@@ -117,7 +117,7 @@
|
||||
<tr>
|
||||
<td>{{.PullMirror.RemoteAddress}}</td>
|
||||
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
|
||||
<td>{{ctx.DateUtils.FullTime .PullMirror.UpdatedUnix}}</td>
|
||||
<td>{{DateUtils.FullTime .PullMirror.UpdatedUnix}}</td>
|
||||
<td class="right aligned">
|
||||
<form method="post" class="tw-inline-block">
|
||||
{{.CsrfTokenHtml}}
|
||||
@@ -205,7 +205,7 @@
|
||||
<tr>
|
||||
<td class="tw-break-anywhere">{{.RemoteAddress}}</td>
|
||||
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
|
||||
<td>{{if .LastUpdateUnix}}{{ctx.DateUtils.FullTime .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
|
||||
<td>{{if .LastUpdateUnix}}{{DateUtils.FullTime .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
|
||||
<td class="right aligned">
|
||||
<button
|
||||
class="ui tiny button show-modal"
|
||||
|
@@ -29,7 +29,7 @@
|
||||
<a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</a>
|
||||
</div>
|
||||
<span class="text grey">
|
||||
{{TimeSince .Delivered.AsTime ctx.Locale}}
|
||||
{{DateUtils.TimeSince .Delivered}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="info tw-hidden" id="info-{{.ID}}">
|
||||
|
Reference in New Issue
Block a user