Skip to content

Commit 7447b39

Browse files
wxiaoguangsilverwindGiteaBot
authored
Fix footer display (#24251)
Fix #24249 Diff with ignoring spaces: https://github.com/go-gitea/gitea/pull/24251/files?diff=split&w=1 Screenshots: <details> <img width="1440" alt="image" src="https://user-images.githubusercontent.com/2114189/233592840-d9ef7296-64eb-4e48-a598-300807a7c2f9.png"> <img width="923" alt="image" src="https://user-images.githubusercontent.com/2114189/233593015-16edc531-43c2-4ff0-b27e-ca75dbadce0c.png"> </details> --------- Co-authored-by: silverwind <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent fb32b4c commit 7447b39

File tree

3 files changed

+57
-71
lines changed

3 files changed

+57
-71
lines changed

templates/base/footer_content.tmpl

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
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}}
22-
<div class="ui dropdown upward language">
23-
<span>{{svg "octicon-globe"}} {{.locale.LangName}}</span>
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}}
28-
</div>
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}}
21+
<div class="ui dropdown upward language">
22+
<span>{{svg "octicon-globe"}} {{.locale.LangName}}</span>
23+
<div class="menu language-menu">
24+
{{range .AllLangs}}
25+
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
26+
{{end}}
2927
</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" .}}
3328
</div>
29+
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.locale.Tr "licenses"}}</a>
30+
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
31+
{{template "custom/extra_links_footer" .}}
3432
</div>
3533
</footer>

web_src/css/base.css

-40
Original file line numberDiff line numberDiff line change
@@ -1805,46 +1805,6 @@ img.ui.avatar,
18051805
color: var(--color-warning-text);
18061806
}
18071807

1808-
footer {
1809-
background-color: var(--color-footer);
1810-
border-top: 1px solid var(--color-secondary);
1811-
width: 100%;
1812-
flex-basis: 40px;
1813-
color: var(--color-text-light);
1814-
}
1815-
1816-
footer .container {
1817-
padding: 0 0.5rem;
1818-
max-width: 100%;
1819-
}
1820-
1821-
footer .container .links > * {
1822-
border-left: 1px solid var(--color-secondary-dark-1);
1823-
padding-left: 8px;
1824-
margin-left: 5px;
1825-
}
1826-
1827-
footer .container .links > *:first-child {
1828-
border-left: 0;
1829-
}
1830-
1831-
footer .ui.language .menu {
1832-
height: 500px;
1833-
max-height: calc(100vh - 60px);
1834-
overflow-y: auto;
1835-
margin-bottom: 7px;
1836-
}
1837-
1838-
footer .ui.language .svg {
1839-
margin-right: 0.15em;
1840-
margin-top: 1px;
1841-
}
1842-
1843-
footer .ui.left,
1844-
footer .ui.right {
1845-
line-height: 39px; /* there is a border-top on the footer, so make the line-height 1px less */
1846-
}
1847-
18481808
.center:not(.popup) {
18491809
text-align: center;
18501810
}

web_src/css/home.css

+30-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,37 @@
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 > a {
60+
border-left: 1px solid var(--color-secondary-dark-1);
61+
padding-left: 8px;
62+
margin-left: 5px;
63+
}
64+
65+
footer .ui.dropdown.language .menu {
66+
height: 500px;
67+
max-height: calc(100vh - 60px);
68+
overflow-y: auto;
69+
margin-bottom: 10px;
70+
}
71+
72+
4673
@media (max-width: 880px) {
47-
footer .ui.container .left,
48-
footer .ui.container .right {
74+
footer .ui.left,
75+
footer .ui.right {
76+
width: 100%;
4977
display: block;
5078
text-align: center;
5179
float: none;

0 commit comments

Comments
 (0)