Add link to home page on swagger ui (#12601)

* Add link to home page on swagger ui

Signed-off-by: a1012112796 <1012112796@qq.com>

* translate

* Apply review suggestion

* Move to right, Thanks @silverwind

* tweaks

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
赵智超 2020-08-27 00:39:45 +08:00 committed by GitHub
parent 7d14d6c1c1
commit 65444c5ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -21,6 +21,7 @@ signed_in_as = Signed in as
enable_javascript = This website works better with JavaScript. enable_javascript = This website works better with JavaScript.
toc = Table of Contents toc = Table of Contents
licenses = Licenses licenses = Licenses
return_to_gitea = Return to Gitea
username = Username username = Username
email = Email Address email = Email Address

View File

@ -6,19 +6,34 @@
<link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet"> <link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet">
<style> <style>
html { html {
box-sizing: border-box; box-sizing: border-box;
overflow-y: scroll; overflow-y: scroll;
} }
*, *:before, *:after { *, *:before, *:after {
box-sizing: inherit; box-sizing: inherit;
} }
body { body {
margin: 0; margin: 0;
background: #fff; background: #fff;
}
.swagger-back-link {
color: #1f69c0;
text-decoration: none;
position: absolute;
top: 1rem;
right: 1.5rem;
display: flex;
align-items: center;
}
.swagger-back-link svg {
color: inherit;
fill: currentcolor;
margin-right: .5rem;
} }
</style> </style>
</head> </head>
<body> <body>
<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply" 16}}{{.i18n.Tr "return_to_gitea"}}</a>
<div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div> <div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div>
<script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script> <script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script>
</body> </body>