loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Filter Repositories by type (#29231)

Filter Repositories by type (resolves #1170, #1318)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f)

(cherry picked from commit e3524c63d6d42865ea8288af89b372544d35474b)

authored by

Tim-Niclas Oelschläger and committed by
Earl Warren
83e04328 a39f69ac

+200 -79
+13
options/locale/locale_en-US.ini
··· 143 143 name = Name 144 144 value = Value 145 145 146 + filter = Filter 147 + filter.clear = Clear Filter 148 + filter.is_archived = Archived 149 + filter.not_archived = Not Archived 150 + filter.is_fork = Forked 151 + filter.not_fork = Not Forked 152 + filter.is_mirror = Mirrored 153 + filter.not_mirror = Not Mirrored 154 + filter.is_template = Template 155 + filter.not_template = Not Template 156 + filter.public = Public 157 + filter.private = Private 158 + 146 159 [aria] 147 160 navbar = Navigation Bar 148 161 footer = Footer
+20
routers/web/explore/repo.go
··· 109 109 language := ctx.FormTrim("language") 110 110 ctx.Data["Language"] = language 111 111 112 + archived := ctx.FormOptionalBool("archived") 113 + ctx.Data["IsArchived"] = archived 114 + 115 + fork := ctx.FormOptionalBool("fork") 116 + ctx.Data["IsFork"] = fork 117 + 118 + mirror := ctx.FormOptionalBool("mirror") 119 + ctx.Data["IsMirror"] = mirror 120 + 121 + template := ctx.FormOptionalBool("template") 122 + ctx.Data["IsTemplate"] = template 123 + 124 + private := ctx.FormOptionalBool("private") 125 + ctx.Data["IsPrivate"] = private 126 + 112 127 repos, count, err = repo_model.SearchRepository(ctx, &repo_model.SearchRepoOptions{ 113 128 ListOptions: db.ListOptions{ 114 129 Page: page, ··· 125 140 Language: language, 126 141 IncludeDescription: setting.UI.SearchRepoDescription, 127 142 OnlyShowRelevant: opts.OnlyShowRelevant, 143 + Archived: archived, 144 + Fork: fork, 145 + Mirror: mirror, 146 + Template: template, 147 + IsPrivate: private, 128 148 }) 129 149 if err != nil { 130 150 ctx.ServerError("SearchRepository", err)
+20
routers/web/org/home.go
··· 85 85 page = 1 86 86 } 87 87 88 + archived := ctx.FormOptionalBool("archived") 89 + ctx.Data["IsArchived"] = archived 90 + 91 + fork := ctx.FormOptionalBool("fork") 92 + ctx.Data["IsFork"] = fork 93 + 94 + mirror := ctx.FormOptionalBool("mirror") 95 + ctx.Data["IsMirror"] = mirror 96 + 97 + template := ctx.FormOptionalBool("template") 98 + ctx.Data["IsTemplate"] = template 99 + 100 + private := ctx.FormOptionalBool("private") 101 + ctx.Data["IsPrivate"] = private 102 + 88 103 var ( 89 104 repos []*repo_model.Repository 90 105 count int64 ··· 102 117 Actor: ctx.Doer, 103 118 Language: language, 104 119 IncludeDescription: setting.UI.SearchRepoDescription, 120 + Archived: archived, 121 + Fork: fork, 122 + Mirror: mirror, 123 + Template: template, 124 + IsPrivate: private, 105 125 }) 106 126 if err != nil { 107 127 ctx.ServerError("SearchRepository", err)
+20
routers/web/user/notification.go
··· 389 389 orderBy = db.SearchOrderByRecentUpdated 390 390 } 391 391 392 + archived := ctx.FormOptionalBool("archived") 393 + ctx.Data["IsArchived"] = archived 394 + 395 + fork := ctx.FormOptionalBool("fork") 396 + ctx.Data["IsFork"] = fork 397 + 398 + mirror := ctx.FormOptionalBool("mirror") 399 + ctx.Data["IsMirror"] = mirror 400 + 401 + template := ctx.FormOptionalBool("template") 402 + ctx.Data["IsTemplate"] = template 403 + 404 + private := ctx.FormOptionalBool("private") 405 + ctx.Data["IsPrivate"] = private 406 + 392 407 repos, count, err := repo_model.SearchRepository(ctx, &repo_model.SearchRepoOptions{ 393 408 ListOptions: db.ListOptions{ 394 409 PageSize: setting.UI.User.RepoPagingNum, ··· 402 417 Collaborate: optional.Some(false), 403 418 TopicOnly: ctx.FormBool("topic"), 404 419 IncludeDescription: setting.UI.SearchRepoDescription, 420 + Archived: archived, 421 + Fork: fork, 422 + Mirror: mirror, 423 + Template: template, 424 + IsPrivate: private, 405 425 }) 406 426 if err != nil { 407 427 ctx.ServerError("SearchRepository", err)
+30
routers/web/user/profile.go
··· 164 164 } 165 165 ctx.Data["NumFollowing"] = numFollowing 166 166 167 + archived := ctx.FormOptionalBool("archived") 168 + ctx.Data["IsArchived"] = archived 169 + 170 + fork := ctx.FormOptionalBool("fork") 171 + ctx.Data["IsFork"] = fork 172 + 173 + mirror := ctx.FormOptionalBool("mirror") 174 + ctx.Data["IsMirror"] = mirror 175 + 176 + template := ctx.FormOptionalBool("template") 177 + ctx.Data["IsTemplate"] = template 178 + 179 + private := ctx.FormOptionalBool("private") 180 + ctx.Data["IsPrivate"] = private 181 + 167 182 switch tab { 168 183 case "followers": 169 184 ctx.Data["Cards"] = followers ··· 210 225 TopicOnly: topicOnly, 211 226 Language: language, 212 227 IncludeDescription: setting.UI.SearchRepoDescription, 228 + Archived: archived, 229 + Fork: fork, 230 + Mirror: mirror, 231 + Template: template, 232 + IsPrivate: private, 213 233 }) 214 234 if err != nil { 215 235 ctx.ServerError("SearchRepository", err) ··· 232 252 TopicOnly: topicOnly, 233 253 Language: language, 234 254 IncludeDescription: setting.UI.SearchRepoDescription, 255 + Archived: archived, 256 + Fork: fork, 257 + Mirror: mirror, 258 + Template: template, 259 + IsPrivate: private, 235 260 }) 236 261 if err != nil { 237 262 ctx.ServerError("SearchRepository", err) ··· 277 302 TopicOnly: topicOnly, 278 303 Language: language, 279 304 IncludeDescription: setting.UI.SearchRepoDescription, 305 + Archived: archived, 306 + Fork: fork, 307 + Mirror: mirror, 308 + Template: template, 309 + IsPrivate: private, 280 310 }) 281 311 if err != nil { 282 312 ctx.ServerError("SearchRepository", err)
+1 -1
templates/admin/repo/list.tmpl
··· 7 7 </div> 8 8 </h4> 9 9 <div class="ui attached segment"> 10 - {{template "admin/repo/search" .}} 10 + {{template "shared/repo_search" .}} 11 11 </div> 12 12 <div class="ui attached table segment"> 13 13 <table class="ui very basic striped table unstackable">
-29
templates/admin/repo/search.tmpl
··· 1 - <div class="ui secondary filter menu gt-ac gt-mx-0"> 2 - <form class="ui form ignore-dirty gt-f1"> 3 - <div class="ui fluid action input"> 4 - {{template "shared/searchinput" dict "Value" .Keyword}} 5 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 6 - </div> 7 - </form> 8 - <!-- Sort --> 9 - <div class="ui dropdown type jump item gt-mr-0"> 10 - <span class="text"> 11 - {{ctx.Locale.Tr "repo.issues.filter_sort"}} 12 - </span> 13 - {{svg "octicon-triangle-down" 14 "dropdown icon"}} 14 - <div class="menu"> 15 - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 16 - <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 17 - <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> 18 - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> 19 - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 20 - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 21 - <a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a> 22 - <a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a> 23 - <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a> 24 - <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> 25 - <a class="{{if eq .SortType "size"}}active {{end}}item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.by_size"}}</a> 26 - <a class="{{if eq .SortType "reversesize"}}active {{end}}item" href="{{$.Link}}?sort=reversesize&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> 27 - </div> 28 - </div> 29 - </div>
-44
templates/explore/repo_search.tmpl
··· 1 - <div class="ui secondary filter menu gt-ac gt-mx-0"> 2 - <form class="ui form ignore-dirty gt-f1"> 3 - <input type="hidden" name="sort" value="{{$.SortType}}"> 4 - <input type="hidden" name="language" value="{{$.Language}}"> 5 - <div class="ui fluid action input"> 6 - {{template "shared/searchinput" dict "Value" .Keyword}} 7 - {{if .PageIsExploreRepositories}} 8 - <input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}"> 9 - {{else if .TabName}} 10 - <input type="hidden" name="tab" value="{{.TabName}}"> 11 - {{end}} 12 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 13 - </div> 14 - </form> 15 - <!-- Sort --> 16 - <div class="ui dropdown type jump item gt-mr-0"> 17 - <span class="text"> 18 - {{ctx.Locale.Tr "repo.issues.filter_sort"}} 19 - </span> 20 - {{svg "octicon-triangle-down" 14 "dropdown icon"}} 21 - <div class="menu"> 22 - <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=newest&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 23 - <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=oldest&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 24 - <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=alphabetically&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> 25 - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=reversealphabetically&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> 26 - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=recentupdate&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 27 - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=leastupdate&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 28 - {{if not .DisableStars}} 29 - <a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=moststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a> 30 - <a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=feweststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a> 31 - {{end}} 32 - {{if not .DisableForks}} 33 - <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=mostforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a> 34 - <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=fewestforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> 35 - {{end}} 36 - </div> 37 - </div> 38 - </div> 39 - {{if and .PageIsExploreRepositories .OnlyShowRelevant}} 40 - <div class="ui message explore-relevancy-note"> 41 - <span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}</span> 42 - </div> 43 - {{end}} 44 - <div class="divider"></div>
+1 -1
templates/explore/repos.tmpl
··· 2 2 <div role="main" aria-label="{{.Title}}" class="page-content explore repositories"> 3 3 {{template "explore/navbar" .}} 4 4 <div class="ui container"> 5 - {{template "explore/repo_search" .}} 5 + {{template "shared/repo_search" .}} 6 6 {{template "explore/repo_list" .}} 7 7 {{template "base/paginate" .}} 8 8 </div>
+1 -1
templates/org/home.tmpl
··· 13 13 {{if .ProfileReadme}} 14 14 <div id="readme_profile" class="markup">{{.ProfileReadme}}</div> 15 15 {{end}} 16 - {{template "explore/repo_search" .}} 16 + {{template "shared/repo_search" .}} 17 17 {{template "explore/repo_list" .}} 18 18 {{template "base/paginate" .}} 19 19 </div>
+67
templates/shared/repo_search.tmpl
··· 1 + <div class="ui secondary filter menu"> 2 + <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-flex-row tw-gap-x-2"> 3 + {{if .Language}}<input hidden name="language" value="{{.Language}}">{{end}} 4 + <div class="ui fluid action input tw-flex-1"> 5 + {{template "shared/searchinput" dict "Value" .Keyword}} 6 + {{if .PageIsExploreRepositories}} 7 + <input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}"> 8 + {{else if .TabName}} 9 + <input type="hidden" name="tab" value="{{.TabName}}"> 10 + {{end}} 11 + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 12 + </div> 13 + <!-- Filter --> 14 + <div class="ui dropdown type jump item tw-mr-0"> 15 + <span class="text"> 16 + {{ctx.Locale.Tr "filter"}} 17 + </span> 18 + {{svg "octicon-triangle-down" 14 "dropdown icon"}} 19 + <div class="menu"> 20 + <label class="item"><input type="radio" name="clear-filter"> {{ctx.Locale.Tr "filter.clear"}}</label> 21 + <div class="divider"></div> 22 + <label class="item"><input type="radio" name="archived" {{if .IsArchived.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.is_archived"}}</label> 23 + <label class="item"><input type="radio" name="archived" {{if (not (.IsArchived.ValueOrDefault true))}}checked{{end}} value="0"> {{ctx.Locale.Tr "filter.not_archived"}}</label> 24 + <div class="divider"></div> 25 + <label class="item"><input type="radio" name="fork" {{if .IsFork.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.is_fork"}}</label> 26 + <label class="item"><input type="radio" name="fork" {{if (not (.IsFork.ValueOrDefault true))}}checked{{end}} value="0"> {{ctx.Locale.Tr "filter.not_fork"}}</label> 27 + <div class="divider"></div> 28 + <label class="item"><input type="radio" name="mirror" {{if .IsMirror.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.is_mirror"}}</label> 29 + <label class="item"><input type="radio" name="mirror" {{if (not (.IsMirror.ValueOrDefault true))}}checked{{end}} value="0"> {{ctx.Locale.Tr "filter.not_mirror"}}</label> 30 + <div class="divider"></div> 31 + <label class="item"><input type="radio" name="template" {{if .IsTemplate.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.is_template"}}</label> 32 + <label class="item"><input type="radio" name="template" {{if (not (.IsTemplate.ValueOrDefault true))}}checked{{end}} value="0"> {{ctx.Locale.Tr "filter.not_template"}}</label> 33 + <div class="divider"></div> 34 + <label class="item"><input type="radio" name="private" {{if .IsPrivate.Value}}checked{{end}} value="1"> {{ctx.Locale.Tr "filter.private"}}</label> 35 + <label class="item"><input type="radio" name="private" {{if (not (.IsPrivate.ValueOrDefault true))}}checked{{end}} value="0"> {{ctx.Locale.Tr "filter.public"}}</label> 36 + </div> 37 + </div> 38 + <!-- Sort --> 39 + <div class="ui dropdown type jump item gt-mr-0"> 40 + <span class="text"> 41 + {{ctx.Locale.Tr "repo.issues.filter_sort"}} 42 + </span> 43 + {{svg "octicon-triangle-down" 14 "dropdown icon"}} 44 + <div class="menu"> 45 + <label class="{{if eq .SortType "newest"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "newest"}}checked{{end}} value="newest"> {{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</label> 46 + <label class="{{if eq .SortType "oldest"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "oldest"}}checked{{end}} value="oldest"> {{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</label> 47 + <label class="{{if eq .SortType "alphabetically"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "alphabetically"}}checked{{end}} value="alphabetically"> {{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</label> 48 + <label class="{{if eq .SortType "reversealphabetically"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "reversealphabetically"}}checked{{end}} value="reversealphabetically"> {{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</label> 49 + <label class="{{if eq .SortType "recentupdate"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "recentupdate"}}checked{{end}} value="recentupdate"> {{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</label> 50 + <label class="{{if eq .SortType "leastupdate"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "leastupdate"}}checked{{end}} value="leastupdate"> {{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</label> 51 + {{if not .DisableStars}} 52 + <label class="{{if eq .SortType "moststars"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "moststars"}}checked{{end}} value="moststars"> {{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</label> 53 + <label class="{{if eq .SortType "feweststars"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "feweststars"}}checked{{end}} value="feweststars"> {{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</label> 54 + {{end}} 55 + <label class="{{if eq .SortType "mostforks"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "mostforks"}}checked{{end}} value="mostforks"> {{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</label> 56 + <label class="{{if eq .SortType "fewestforks"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "fewestforks"}}checked{{end}} value="fewestforks"> {{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</label> 57 + <label class="{{if eq .SortType "size"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "size"}}checked{{end}} value="size"> {{ctx.Locale.Tr "repo.issues.label.filter_sort.by_size"}}</label> 58 + <label class="{{if eq .SortType "reversesize"}}active {{end}}item"><input hidden type="radio" name="sort" {{if eq .SortType "reversesize"}}checked{{end}} value="reversesize"> {{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</label> 59 + </div> 60 + </div> 61 + </form> 62 + </div> 63 + {{if and .PageIsExploreRepositories .OnlyShowRelevant}} 64 + <div class="ui message explore-relevancy-note"> 65 + <span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}</span> 66 + </div> 67 + {{end}}
+1 -1
templates/user/notification/notification_subscriptions.tmpl
··· 69 69 {{template "shared/issuelist" dict "." . "listType" "dashboard"}} 70 70 {{end}} 71 71 {{else}} 72 - {{template "explore/repo_search" .}} 72 + {{template "shared/repo_search" .}} 73 73 {{template "explore/repo_list" .}} 74 74 {{template "base/paginate" .}} 75 75 {{end}}
+2 -2
templates/user/profile.tmpl
··· 21 21 {{template "user/dashboard/feeds" .}} 22 22 {{else if eq .TabName "stars"}} 23 23 <div class="stars"> 24 - {{template "explore/repo_search" .}} 24 + {{template "shared/repo_search" .}} 25 25 {{template "explore/repo_list" .}} 26 26 {{template "base/paginate" .}} 27 27 </div> ··· 32 32 {{else if eq .TabName "overview"}} 33 33 <div id="readme_profile" class="markup">{{.ProfileReadme}}</div> 34 34 {{else}} 35 - {{template "explore/repo_search" .}} 35 + {{template "shared/repo_search" .}} 36 36 {{template "explore/repo_list" .}} 37 37 {{template "base/paginate" .}} 38 38 {{end}}
+22
web_src/js/features/repo-search.js
··· 1 + export function initRepositorySearch() { 2 + const repositorySearchForm = document.querySelector('#repo-search-form'); 3 + if (!repositorySearchForm) return; 4 + 5 + repositorySearchForm.addEventListener('change', (e) => { 6 + e.preventDefault(); 7 + 8 + const formData = new FormData(repositorySearchForm); 9 + const params = new URLSearchParams(formData); 10 + 11 + if (e.target.name === 'clear-filter') { 12 + params.delete('archived'); 13 + params.delete('fork'); 14 + params.delete('mirror'); 15 + params.delete('template'); 16 + params.delete('private'); 17 + } 18 + 19 + params.delete('clear-filter'); 20 + window.location.search = params.toString(); 21 + }); 22 + }
+2
web_src/js/index.js
··· 84 84 import {initRepoRecentCommits} from './features/recent-commits.js'; 85 85 import {initRepoDiffCommitBranchesAndTags} from './features/repo-diff-commit.js'; 86 86 import {initDirAuto} from './modules/dirauto.js'; 87 + import {initRepositorySearch} from './features/repo-search.js'; 87 88 88 89 // Init Gitea's Fomantic settings 89 90 initGiteaFomantic(); ··· 170 171 initRepoWikiForm(); 171 172 initRepository(); 172 173 initRepositoryActionView(); 174 + initRepositorySearch(); 173 175 initRepoContributors(); 174 176 initRepoCodeFrequency(); 175 177 initRepoRecentCommits();