Skip to content

Commit 8816956

Browse files
yp05327silverwind
authored andcommitted
Fix display latest sync time for pull mirrors on the repo page (go-gitea#28841)
Follow go-gitea#28712 1. Missing Locale word `mirror_sync` 2. Maybe forgot checking the conflict from go-gitea#27760 Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/6100d35b-7fe3-4095-9c24-7875568f7380) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/69647169-b812-45bc-a267-ab28f2df6ef6)
1 parent cb7809c commit 8816956

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ mirror_prune = Prune
987987
mirror_prune_desc = Remove obsolete remote-tracking references
988988
mirror_interval = Mirror Interval (valid time units are 'h', 'm', 's'). 0 to disable periodic sync. (Minimum interval: %s)
989989
mirror_interval_invalid = The mirror interval is not valid.
990+
mirror_sync = synced
990991
mirror_sync_on_commit = Sync when commits are pushed
991992
mirror_address = Clone From URL
992993
mirror_address_desc = Put any required credentials in the Authorization section.

templates/repo/header.tmpl

+7-8
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828
<div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
2929
{{end}}
3030
</div>
31-
{{if $.PullMirror}}
32-
<div class="fork-flag">
33-
{{ctx.Locale.Tr "repo.mirror_from"}}
34-
<a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a>
35-
{{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}}
36-
</div>
37-
{{end}}
3831
</div>
3932
{{if not (or .IsBeingCreated .IsBroken)}}
4033
<div class="repo-buttons">
@@ -147,7 +140,13 @@
147140
</div>
148141
{{end}}
149142
</div>
150-
{{if $.PullMirror}}<div class="fork-flag">{{ctx.Locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div>{{end}}
143+
{{if $.PullMirror}}
144+
<div class="fork-flag">
145+
{{ctx.Locale.Tr "repo.mirror_from"}}
146+
<a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a>
147+
{{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}}
148+
</div>
149+
{{end}}
151150
{{if .IsFork}}<div class="fork-flag">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
152151
{{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}}
153152
</div>

0 commit comments

Comments
 (0)