From 8e27547b2f8c162c1c85330195a42913b720a438 Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Tue, 25 Aug 2020 21:22:39 +0800 Subject: [PATCH 1/5] Add link to home page on swagger ui Signed-off-by: a1012112796 <1012112796@qq.com> --- templates/swagger/ui.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 9072b49a37d83..99f4d72681675 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -19,6 +19,7 @@ +

Geturn Home Page

From 7258f831aa2325cacd66b1c14c1c3122bd748fde Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Tue, 25 Aug 2020 21:51:13 +0800 Subject: [PATCH 2/5] translate --- options/locale/locale_en-US.ini | 2 ++ templates/swagger/ui.tmpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 00c5ed60764f8..f9660dbb6df30 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -86,6 +86,8 @@ loading = Loading… error404 = The page you are trying to reach either does not exist or you are not authorized to view it. +api_to_home_page = Return Home Page + [error] occurred = An error has occurred report_message = If you are sure this is a Gitea bug, please search for issue on GitHub and open new issue if necessary. diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 99f4d72681675..d61e0cc4e0ce1 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -19,7 +19,7 @@ -

Geturn Home Page

+

{{.i18n.Tr "api_to_home_page"}}

From f08098106944d00807898cf5a96c3fcebf10fe5f Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Tue, 25 Aug 2020 22:39:48 +0800 Subject: [PATCH 3/5] Apply review suggestion --- options/locale/locale_en-US.ini | 2 -- templates/swagger/ui.tmpl | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f9660dbb6df30..00c5ed60764f8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -86,8 +86,6 @@ loading = Loading… error404 = The page you are trying to reach either does not exist or you are not authorized to view it. -api_to_home_page = Return Home Page - [error] occurred = An error has occurred report_message = If you are sure this is a Gitea bug, please search for issue on GitHub and open new issue if necessary. diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index d61e0cc4e0ce1..3812ef39d714d 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -19,7 +19,7 @@ -

{{.i18n.Tr "api_to_home_page"}}

+

{{.i18n.Tr "home"}}

From 972157455f568aac478c4013fdb3b644517a41b6 Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Tue, 25 Aug 2020 23:31:57 +0800 Subject: [PATCH 4/5] Move to right, Thanks @silverwind --- templates/swagger/ui.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 3812ef39d714d..185c436b737e0 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -16,10 +16,14 @@ margin: 0; background: #fff; } + .swagger-back-link { + position: absolute; + right: 3rem; + } -

{{.i18n.Tr "home"}}

+
From 7f9d52e387336f75d1147440daa66aa515115412 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 25 Aug 2020 18:18:19 +0200 Subject: [PATCH 5/5] tweaks --- options/locale/locale_en-US.ini | 1 + templates/swagger/ui.tmpl | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 00c5ed60764f8..388348e95c694 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -21,6 +21,7 @@ signed_in_as = Signed in as enable_javascript = This website works better with JavaScript. toc = Table of Contents licenses = Licenses +return_to_gitea = Return to Gitea username = Username email = Email Address diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 185c436b737e0..eb30578aca7f2 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -6,24 +6,34 @@ - + {{svg "octicon-reply" 16}}{{.i18n.Tr "return_to_gitea"}}