diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl
index 511ef7f397..5aa9135efa 100644
--- a/templates/repo/issue/filter_list.tmpl
+++ b/templates/repo/issue/filter_list.tmpl
@@ -23,8 +23,8 @@
{{ctx.Locale.Tr "repo.issues.filter_label_exclude" | Safe}}
- {{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}
- {{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}
+ {{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}
+ {{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}
{{$previousExclusiveScope := "_no_scope"}}
{{range .Labels}}
{{$exclusiveScope := .ExclusiveScope}}
@@ -32,7 +32,7 @@
{{end}}
{{$previousExclusiveScope = $exclusiveScope}}
-
+
{{if .IsExcluded}}
{{svg "octicon-circle-slash"}}
{{else if .IsSelected}}
@@ -62,13 +62,13 @@
- {{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}
- {{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}
+ {{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}
+ {{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}
{{if .OpenMilestones}}
{{range .OpenMilestones}}
-
+
{{svg "octicon-milestone" 16 "mr-2"}}
{{.Name}}
@@ -78,7 +78,7 @@
{{range .ClosedMilestones}}
-
+
{{svg "octicon-milestone" 16 "mr-2"}}
{{.Name}}
@@ -99,15 +99,15 @@
{{svg "octicon-search" 16}}
- {{ctx.Locale.Tr "repo.issues.filter_project_all"}}
- {{ctx.Locale.Tr "repo.issues.filter_project_none"}}
+ {{ctx.Locale.Tr "repo.issues.filter_project_all"}}
+ {{ctx.Locale.Tr "repo.issues.filter_project_none"}}
{{if .OpenProjects}}
{{range .OpenProjects}}
-
+
{{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}{{.Title}}
{{end}}
@@ -118,7 +118,7 @@
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
{{range .ClosedProjects}}
-
+
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
{{end}}
@@ -156,11 +156,11 @@
{{svg "octicon-search" 16}}
- {{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}
- {{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}
+ {{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}
+ {{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}
{{range .Assignees}}
-
+
{{ctx.AvatarUtils.Avatar . 20}}{{template "repo/search_name" .}}
{{end}}
@@ -175,14 +175,14 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
{{end}}
@@ -194,13 +194,13 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go
index 268200be6f..7c00c4f958 100644
--- a/tests/integration/issue_test.go
+++ b/tests/integration/issue_test.go
@@ -1,4 +1,5 @@
// Copyright 2017 The Gitea Authors. All rights reserved.
+// Copyright 2024 The Forgejo Authors c/o Codeberg e.V.. All rights reserved.
// SPDX-License-Identifier: MIT
package integration
@@ -797,3 +798,20 @@ func TestCommitRefComment(t *testing.T) {
assert.Contains(t, event, "referenced this issue")
})
}
+
+func TestIssueFilterNoFollow(t *testing.T) {
+ defer tests.PrepareTestEnv(t)()
+
+ req := NewRequest(t, "GET", "/user2/repo1/issues")
+ resp := MakeRequest(t, req, http.StatusOK)
+ htmlDoc := NewHTMLParser(t, resp.Body)
+
+ // Check that every link in the filter list has rel="nofollow".
+ filterLinks := htmlDoc.Find(".issue-list-toolbar-right a[href*=\"/issues?q=\"]")
+ assert.True(t, filterLinks.Length() > 0)
+ filterLinks.Each(func(i int, link *goquery.Selection) {
+ rel, has := link.Attr("rel")
+ assert.True(t, has)
+ assert.Equal(t, "nofollow", rel)
+ })
+}