fix(web): remove duplicate script and mobile overflow
CI / validate (pull_request) Successful in 25m56s

This commit is contained in:
2026-08-14 16:07:49 +02:00
parent 2afec9450c
commit 57ab533c26
3 changed files with 19 additions and 1 deletions
+13
View File
@@ -331,6 +331,7 @@ func newHandlerServicesWithCatalog(authService *auth.Service, repository reposit
}
mux.HandleFunc("GET /static/app.v1.css", s.stylesheet)
mux.HandleFunc("GET /static/app.v2.css", s.stylesheet)
mux.HandleFunc("GET /static/mobile-fixes.css", s.mobileStylesheet)
mux.HandleFunc("GET /static/theme.v1.css", s.themeStylesheet)
mux.HandleFunc("GET /static/theme.v2.css", s.themeStylesheet)
mux.HandleFunc("GET /static/app.v1.js", s.javascript)
@@ -2214,6 +2215,18 @@ func (s *server) stylesheet(w http.ResponseWriter, _ *http.Request) {
_, _ = io.Copy(w, body)
}
func (s *server) mobileStylesheet(w http.ResponseWriter, _ *http.Request) {
body, err := assets.Open("static/mobile-fixes.css")
if err != nil {
http.Error(w, "Not found.", http.StatusNotFound)
return
}
defer func() { _ = body.Close() }()
w.Header().Set("Content-Type", "text/css; charset=utf-8")
w.Header().Set("Cache-Control", "public, max-age=86400")
_, _ = io.Copy(w, body)
}
func (s *server) themeStylesheet(w http.ResponseWriter, _ *http.Request) {
body, err := assets.Open("static/theme.v1.css")
if err != nil {
+5
View File
@@ -0,0 +1,5 @@
@media (max-width: 760px) {
html, body { overflow-x: hidden; }
.mobile-header { width: 100vw; margin-left: calc(50% - 50vw); margin-right: 0; }
.tabs { flex-wrap: wrap; overflow-x: visible; }
}
+1 -1
View File
@@ -1,4 +1,5 @@
{{define "sidebar"}}
<link rel="stylesheet" href="/static/mobile-fixes.css">
<header class="mobile-header">
<a href="/"><img src="/static/dogama.png" alt="DoGaMa"></a>
<button class="menu-button" type="button" aria-controls="app-navigation" aria-expanded="false">Menu</button>
@@ -18,5 +19,4 @@
<form method="post" action="/logout"><input type="hidden" name="csrf_token" value="{{.CSRFToken}}"><button class="signout-button" type="submit">↪ {{.Msg "logout.submit"}}</button></form>
</div>
</aside>
<script src="/static/app.v2.js"></script>
{{end}}