Skip to content

Commit da44484

Browse files
wxiaoguanglafriks
andauthored
Fix footer display (#24251) (#24269)
Backport #24251 Fix #24249 Diff with ignoring spaces: https://github.com/go-gitea/gitea/pull/24269/files?diff=split&w=1 Manually tested ![image](https://user-images.githubusercontent.com/2114189/233766806-18eb18ad-0c4d-44f7-b0fc-b40466c64445.png) Co-authored-by: Lauris BH <lauris@nix.lv>
1 parent 5ccb626 commit da44484

File tree

3 files changed

+59
-69
lines changed

3 files changed

+59
-69
lines changed

templates/base/footer_content.tmpl

+25-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
<footer role="group" aria-label="{{.locale.Tr "aria.footer"}}">
2-
<div class="ui container">
3-
<div class="ui left" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
4-
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "powered_by" "Gitea"}}</a>
5-
{{if (or .ShowFooterVersion .PageIsAdmin)}}
6-
{{.locale.Tr "version"}}:
7-
{{if .IsAdmin}}
8-
<a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a>
9-
{{else}}
10-
{{AppVer}}
11-
{{end}}
12-
{{end}}
13-
{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
14-
{{.locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
15-
{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
16-
{{end}}
17-
</div>
18-
<div class="ui right links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
19-
{{if .ShowFooterBranding}}
20-
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">{{svg "octicon-mark-github"}}<span class="sr-only">GitHub</span></a>
2+
<div class="ui left" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
3+
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "powered_by" "Gitea"}}</a>
4+
{{if (or .ShowFooterVersion .PageIsAdmin)}}
5+
{{.locale.Tr "version"}}:
6+
{{if .IsAdmin}}
7+
<a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a>
8+
{{else}}
9+
{{AppVer}}
2110
{{end}}
11+
{{end}}
12+
{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
13+
{{.locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
14+
{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
15+
{{end}}
16+
</div>
17+
<div class="ui right links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
18+
{{if .ShowFooterBranding}}
19+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">{{svg "octicon-mark-github"}}<span class="sr-only">GitHub</span></a>
20+
{{end}}
2221
<div class="ui language bottom floating slide up dropdown link item">
2322
{{svg "octicon-globe"}}
2423
<span>{{.locale.LangName}}</span>
25-
<div class="menu language-menu">
26-
{{range .AllLangs}}
27-
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
28-
{{end}}
29-
</div>
24+
<div class="menu language-menu">
25+
{{range .AllLangs}}
26+
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
27+
{{end}}
3028
</div>
31-
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.locale.Tr "licenses"}}</a>
32-
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
33-
{{template "custom/extra_links_footer" .}}
3429
</div>
30+
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.locale.Tr "licenses"}}</a>
31+
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
32+
{{template "custom/extra_links_footer" .}}
3533
</div>
3634
</footer>

web_src/css/base.css

-40
Original file line numberDiff line numberDiff line change
@@ -1821,46 +1821,6 @@ img.ui.avatar,
18211821
color: var(--color-warning-text);
18221822
}
18231823

1824-
footer {
1825-
background-color: var(--color-footer);
1826-
border-top: 1px solid var(--color-secondary);
1827-
width: 100%;
1828-
flex-basis: 40px;
1829-
color: var(--color-text-light);
1830-
}
1831-
1832-
footer .container {
1833-
padding: 0 0.5rem;
1834-
max-width: 100%;
1835-
}
1836-
1837-
footer .container .links > * {
1838-
border-left: 1px solid var(--color-secondary-dark-1);
1839-
padding-left: 8px;
1840-
margin-left: 5px;
1841-
}
1842-
1843-
footer .container .links > *:first-child {
1844-
border-left: 0;
1845-
}
1846-
1847-
footer .ui.language .menu {
1848-
max-height: 500px;
1849-
overflow-y: auto;
1850-
margin-bottom: 7px;
1851-
}
1852-
1853-
footer .ui.language .svg {
1854-
margin-right: 0.15em;
1855-
vertical-align: top;
1856-
margin-top: calc(2em - 16px);
1857-
}
1858-
1859-
footer .ui.left,
1860-
footer .ui.right {
1861-
line-height: 39px; /* there is a border-top on the footer, so make the line-height 1px less */
1862-
}
1863-
18641824
.center:not(.popup) {
18651825
text-align: center;
18661826
}

web_src/css/home.css

+34-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,41 @@
4343
color: var(--color-green);
4444
}
4545

46+
footer {
47+
background-color: var(--color-footer);
48+
border-top: 1px solid var(--color-secondary);
49+
line-height: 39px;
50+
flex-basis: 40px;
51+
color: var(--color-text-light);
52+
padding: 0 20px;
53+
}
54+
55+
footer .right.links {
56+
min-width: 180px; /* make sure the menu dropdown doesn't overflow horizontally when language name is short */
57+
}
58+
59+
footer .right.links > * {
60+
border-left: 1px solid var(--color-secondary-dark-1);
61+
padding-left: 8px;
62+
margin-left: 5px;
63+
}
64+
65+
footer .right.links > *:first-child {
66+
border-left: none;
67+
}
68+
69+
footer .ui.dropdown.language .menu {
70+
height: 500px;
71+
max-height: calc(100vh - 60px);
72+
overflow-y: auto;
73+
margin-bottom: 10px;
74+
}
75+
76+
4677
@media (max-width: 880px) {
47-
footer .ui.container .left,
48-
footer .ui.container .right {
78+
footer .ui.left,
79+
footer .ui.right {
80+
width: 100%;
4981
display: block;
5082
text-align: center;
5183
float: none;

0 commit comments

Comments
 (0)