diff options
author | 赵智超 <1012112796@qq.com> | 2020-08-27 00:39:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 12:39:45 -0400 |
commit | 65444c5ea3b8ee417f0e1194e6e46740256f8cbb (patch) | |
tree | c8ae219f1c27def79510a8114cbc2aa0a2cd1798 /templates | |
parent | 7d14d6c1c13f1eac4b9456c5db4c3594bc4dc237 (diff) | |
download | gitea-65444c5ea3b8ee417f0e1194e6e46740256f8cbb.tar.gz gitea-65444c5ea3b8ee417f0e1194e6e46740256f8cbb.zip |
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>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/swagger/ui.tmpl | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index 9072b49a37..eb30578aca 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -6,19 +6,34 @@ <link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet"> <style> html { - box-sizing: border-box; - overflow-y: scroll; + box-sizing: border-box; + overflow-y: scroll; } *, *:before, *:after { - box-sizing: inherit; + box-sizing: inherit; } body { - margin: 0; - background: #fff; + margin: 0; + 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> </head> <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> <script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script> </body> |