From 64faecefe10613840709a68c1b8b708115d69d6e Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Thu, 1 Feb 2024 09:04:23 +0900
Subject: [PATCH] Fix UI Spacing Errors in mirror settings (#28990)

---
 options/locale/locale_en-US.ini      |  1 +
 templates/repo/settings/options.tmpl | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index c1e2967d03..9af4d70171 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -2013,6 +2013,7 @@ settings.mirror_settings.docs.doc_link_title = How do I mirror repositories?
 settings.mirror_settings.docs.doc_link_pull_section = the "Pulling from a remote repository" section of the documentation.
 settings.mirror_settings.docs.pulling_remote_title = Pulling from a remote repository
 settings.mirror_settings.mirrored_repository = Mirrored repository
+settings.mirror_settings.pushed_repository = Pushed repository
 settings.mirror_settings.direction = Direction
 settings.mirror_settings.direction.pull = Pull
 settings.mirror_settings.direction.push = Push
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 07b2f58d53..dfb909e743 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -105,8 +105,9 @@
 					{{else}}
 						{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
 					{{end}}
+
+					{{if .Repository.IsMirror}}
 					<table class="ui table">
-						{{if $existingPushMirror}}
 						<thead>
 							<tr>
 								<th style="width:40%">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
@@ -200,8 +201,18 @@
 								</td>
 							</tr>
 						</tbody>
-						<thead><tr><th colspan="4"></th></tr></thead>
-						{{end}}{{/* end if: IsMirror */}}
+					</table>
+					{{end}}{{/* end if: IsMirror */}}
+
+					<table class="ui table">
+						<thead>
+							<tr>
+								<th style="width:40%">{{ctx.Locale.Tr "repo.settings.mirror_settings.pushed_repository"}}</th>
+								<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
+								<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
+								<th></th>
+							</tr>
+						</thead>
 						<tbody>
 							{{range .PushMirrors}}
 							<tr>