diff options
author | yp05327 <576951401@qq.com> | 2024-01-18 19:27:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 18:27:07 +0800 |
commit | 4674aea25b54baf08594c54f061dee9e44190f02 (patch) | |
tree | 34c094fbc433ebbe83dc03e2ba2eebd134b54003 | |
parent | eba9c0ce48c7d43910eb77db74c6648157663ceb (diff) | |
download | gitea-4674aea25b54baf08594c54f061dee9e44190f02.tar.gz gitea-4674aea25b54baf08594c54f061dee9e44190f02.zip |
Fix display latest sync time for pull mirrors on the repo page (#28841)
Follow #28712
1. Missing Locale word `mirror_sync`
2. Maybe forgot checking the conflict from #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)
-rw-r--r-- | options/locale/locale_en-US.ini | 1 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 15 |
2 files changed, 8 insertions, 8 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 90e3ac503a..6f9ba8c884 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -987,6 +987,7 @@ mirror_prune = Prune mirror_prune_desc = Remove obsolete remote-tracking references mirror_interval = Mirror Interval (valid time units are 'h', 'm', 's'). 0 to disable periodic sync. (Minimum interval: %s) mirror_interval_invalid = The mirror interval is not valid. +mirror_sync = synced mirror_sync_on_commit = Sync when commits are pushed mirror_address = Clone From URL mirror_address_desc = Put any required credentials in the Authorization section. diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c362059ef3..a5ef8daa9a 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -28,13 +28,6 @@ <div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div> {{end}} </div> - {{if $.PullMirror}} - <div class="fork-flag"> - {{ctx.Locale.Tr "repo.mirror_from"}} - <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a> - {{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}} - </div> - {{end}} </div> {{if not (or .IsBeingCreated .IsBroken)}} <div class="repo-buttons"> @@ -147,7 +140,13 @@ </div> {{end}} </div> - {{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}} + {{if $.PullMirror}} + <div class="fork-flag"> + {{ctx.Locale.Tr "repo.mirror_from"}} + <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a> + {{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}} + </div> + {{end}} {{if .IsFork}}<div class="fork-flag">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}} {{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}} </div> |