Skip to content

Commit 65444c5

Browse files
a1012112796silverwindjolheisertechknowlogick
authored
Add link to home page on swagger ui (#12601)
* Add link to home page on swagger ui Signed-off-by: a1012112796 <[email protected]> * translate * Apply review suggestion * Move to right, Thanks @silverwind * tweaks Co-authored-by: silverwind <[email protected]> Co-authored-by: John Olheiser <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 7d14d6c commit 65444c5

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ signed_in_as = Signed in as
2121
enable_javascript = This website works better with JavaScript.
2222
toc = Table of Contents
2323
licenses = Licenses
24+
return_to_gitea = Return to Gitea
2425

2526
username = Username
2627
email = Email Address

templates/swagger/ui.tmpl

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,34 @@
66
<link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet">
77
<style>
88
html {
9-
box-sizing: border-box;
10-
overflow-y: scroll;
9+
box-sizing: border-box;
10+
overflow-y: scroll;
1111
}
1212
*, *:before, *:after {
13-
box-sizing: inherit;
13+
box-sizing: inherit;
1414
}
1515
body {
16-
margin: 0;
17-
background: #fff;
16+
margin: 0;
17+
background: #fff;
18+
}
19+
.swagger-back-link {
20+
color: #1f69c0;
21+
text-decoration: none;
22+
position: absolute;
23+
top: 1rem;
24+
right: 1.5rem;
25+
display: flex;
26+
align-items: center;
27+
}
28+
.swagger-back-link svg {
29+
color: inherit;
30+
fill: currentcolor;
31+
margin-right: .5rem;
1832
}
1933
</style>
2034
</head>
2135
<body>
36+
<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply" 16}}{{.i18n.Tr "return_to_gitea"}}</a>
2237
<div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div>
2338
<script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script>
2439
</body>

0 commit comments

Comments
 (0)