From 3f67fb2bb02a8b82cc62b6c1c5951cd82a6170f9 Mon Sep 17 00:00:00 2001
From: Earl Warren <contact@earl-warren.org>
Date: Thu, 2 Mar 2023 11:15:05 +0100
Subject: [PATCH] Revert "[UI] Revert "Remove ONLY_SHOW_RELEVANT_REPOS
 setting""

This reverts commit 1681c51b7fc799827b638309c2c45f90f6acd284.

347df0cbf0f8aa7ce4714b818a61e423cd47f398 changed the logic and made it
different. I overlooked @gusted comment on the matter and also the
fact that the CI was not reporting a failed status.
---
 routers/web/explore/repo.go | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/routers/web/explore/repo.go b/routers/web/explore/repo.go
index 8ed94e74f5..058971b9b8 100644
--- a/routers/web/explore/repo.go
+++ b/routers/web/explore/repo.go
@@ -17,7 +17,8 @@ import (
 
 const (
 	// tplExploreRepos explore repositories page template
-	tplExploreRepos base.TplName = "explore/repos"
+	tplExploreRepos        base.TplName = "explore/repos"
+	relevantReposOnlyParam string       = "no_filter"
 )
 
 // RepoSearchOptions when calling search repositories
@@ -83,13 +84,9 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 	default:
 		ctx.Data["SortType"] = "recentupdate"
 		orderBy = db.SearchOrderByRecentUpdated
-		onlyShowRelevant = setting.UI.OnlyShowRelevantRepos && !ctx.FormBool("no_filter")
 	}
 
 	keyword := ctx.FormTrim("q")
-	if keyword != "" {
-		onlyShowRelevant = false
-	}
 
 	ctx.Data["OnlyShowRelevant"] = opts.OnlyShowRelevant
 
@@ -141,7 +138,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 	pager.SetDefaultParams(ctx)
 	pager.AddParam(ctx, "topic", "TopicOnly")
 	pager.AddParam(ctx, "language", "Language")
-	pager.AddParamString("no_filter", ctx.FormString("no_filter"))
+	pager.AddParamString(relevantReposOnlyParam, ctx.FormString(relevantReposOnlyParam))
 	ctx.Data["Page"] = pager
 
 	ctx.HTML(http.StatusOK, opts.TplName)