diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e3ee960a9ca17..d37d178352eee 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -177,6 +177,8 @@ project_kind = Search projects... branch_kind = Search branches... commit_kind = Search commits... runner_kind = Search runners... +issue_kind = Search issues... +pull_kind = Search pulls... keyword_search_unavailable = Searching by keyword is currently not available. Please contact your site administrator. [aria] diff --git a/routers/web/user/home.go b/routers/web/user/home.go index caa71152593ef..5440dec477301 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -447,6 +447,8 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { User: ctx.Doer, } + isFuzzy := ctx.FormBool("fuzzy") + // Search all repositories which // // As user: @@ -549,7 +551,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { // USING FINAL STATE OF opts FOR A QUERY. var issues issues_model.IssueList { - issueIDs, _, err := issue_indexer.SearchIssues(ctx, issue_indexer.ToSearchOptions(keyword, opts)) + issueSearchOptions := issue_indexer.ToSearchOptions(keyword, opts) + issueSearchOptions.IsFuzzyKeyword = isFuzzy + issueIDs, _, err := issue_indexer.SearchIssues(ctx, issueSearchOptions) if err != nil { ctx.ServerError("issueIDsFromSearch", err) return @@ -570,7 +574,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { // ------------------------------- // Fill stats to post to ctx.Data. // ------------------------------- - issueStats, err := getUserIssueStats(ctx, ctxUser, filterMode, issue_indexer.ToSearchOptions(keyword, opts)) + issueSearchOptions := issue_indexer.ToSearchOptions(keyword, opts) + issueSearchOptions.IsFuzzyKeyword = isFuzzy + issueStats, err := getUserIssueStats(ctx, ctxUser, filterMode, issueSearchOptions) if err != nil { ctx.ServerError("getUserIssueStats", err) return @@ -624,6 +630,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { ctx.Data["SortType"] = sortType ctx.Data["IsShowClosed"] = isShowClosed ctx.Data["SelectLabels"] = selectedLabels + ctx.Data["IsFuzzy"] = isFuzzy if isShowClosed { ctx.Data["State"] = "closed" @@ -639,6 +646,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { pager.AddParam(ctx, "labels", "SelectLabels") pager.AddParam(ctx, "milestone", "MilestoneID") pager.AddParam(ctx, "assignee", "AssigneeID") + pager.AddParam(ctx, "fuzzy", "IsFuzzy") ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplIssues) diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 0fbf9a7361b4f..ba575e04abbbb 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -5,29 +5,29 @@