Skip to content

Commit

Permalink
Add link to home page on swagger ui (#12601)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
4 people authored Aug 26, 2020
1 parent 7d14d6c commit 65444c5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions templates/swagger/ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 65444c5

Please sign in to comment.