aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-12-09 15:54:59 +0800
committerGitHub <noreply@github.com>2024-12-09 07:54:59 +0000
commit5675efb3e015fb8d87d86d1b79de2200f7dfb9af (patch)
tree5c5ad18d8a7fd31632f9d2f1dd4e6a65011c5271 /modules
parent2d13eafd69b368bc75faa25d7ecfbda98a0792f8 (diff)
downloadgitea-5675efb3e015fb8d87d86d1b79de2200f7dfb9af.tar.gz
gitea-5675efb3e015fb8d87d86d1b79de2200f7dfb9af.zip
Fix duplicate dropdown dividers (#32760)
Fix #27466 The problem is that any item in the menu could be hidden, pure CSS won't work, and dropdown's builtin "hideDividers" doesn't work with our "scope dividers". The newly introduced "archived" label makes the dividers regression more.
Diffstat (limited to 'modules')
-rw-r--r--modules/templates/helper.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index fdfb21925a..e262892069 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -294,9 +294,7 @@ func timeEstimateString(timeSec any) string {
return util.TimeEstimateString(v)
}
-type QueryString string
-
-func queryBuild(a ...any) QueryString {
+func queryBuild(a ...any) template.URL {
var s string
if len(a)%2 == 1 {
if v, ok := a[0].(string); ok {
@@ -304,7 +302,7 @@ func queryBuild(a ...any) QueryString {
panic("queryBuild: invalid argument")
}
s = v
- } else if v, ok := a[0].(QueryString); ok {
+ } else if v, ok := a[0].(template.URL); ok {
s = string(v)
} else {
panic("queryBuild: invalid argument")
@@ -356,7 +354,7 @@ func queryBuild(a ...any) QueryString {
if s != "" && s != "&" && s[len(s)-1] == '&' {
s = s[:len(s)-1]
}
- return QueryString(s)
+ return template.URL(s)
}
func panicIfDevOrTesting() {