1
0
Fork 0
forked from forgejo/forgejo

Filter Repositories by type (#29231)

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

before:

![image](74e6be62-9010-4ab4-8f9b-bd8afbebb8fb)

after:

![image](e4d85ed6-7864-4150-8d72-5194dac1293f)

(cherry picked from commit e3524c63d6d42865ea8288af89b372544d35474b)
This commit is contained in:
Tim-Niclas Oelschläger 2024-03-03 11:18:34 +01:00 committed by Earl Warren
parent a39f69ac28
commit 83e04328df
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
15 changed files with 200 additions and 79 deletions

View file

@ -389,6 +389,21 @@ func NotificationWatching(ctx *context.Context) {
orderBy = db.SearchOrderByRecentUpdated
}
archived := ctx.FormOptionalBool("archived")
ctx.Data["IsArchived"] = archived
fork := ctx.FormOptionalBool("fork")
ctx.Data["IsFork"] = fork
mirror := ctx.FormOptionalBool("mirror")
ctx.Data["IsMirror"] = mirror
template := ctx.FormOptionalBool("template")
ctx.Data["IsTemplate"] = template
private := ctx.FormOptionalBool("private")
ctx.Data["IsPrivate"] = private
repos, count, err := repo_model.SearchRepository(ctx, &repo_model.SearchRepoOptions{
ListOptions: db.ListOptions{
PageSize: setting.UI.User.RepoPagingNum,
@ -402,6 +417,11 @@ func NotificationWatching(ctx *context.Context) {
Collaborate: optional.Some(false),
TopicOnly: ctx.FormBool("topic"),
IncludeDescription: setting.UI.SearchRepoDescription,
Archived: archived,
Fork: fork,
Mirror: mirror,
Template: template,
IsPrivate: private,
})
if err != nil {
ctx.ServerError("SearchRepository", err)