Skip to content

Commit cc9971b

Browse files
committed
enhance: added template filter
1 parent f77def7 commit cc9971b

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

routers/web/explore/repo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
118118
mirror := ctx.FormOptionalBool("mirror")
119119
ctx.Data["IsMirror"] = mirror
120120

121+
template := ctx.FormOptionalBool("template")
122+
ctx.Data["IsTemplate"] = template
123+
121124
private := ctx.FormOptionalBool("private")
122125
ctx.Data["IsPrivate"] = private
123126

@@ -140,6 +143,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
140143
Archived: archived,
141144
Fork: fork,
142145
Mirror: mirror,
146+
Template: template,
143147
IsPrivate: private,
144148
})
145149
if err != nil {

routers/web/org/home.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func Home(ctx *context.Context) {
106106
mirror := ctx.FormOptionalBool("mirror")
107107
ctx.Data["IsMirror"] = mirror
108108

109+
template := ctx.FormOptionalBool("template")
110+
ctx.Data["IsTemplate"] = template
111+
109112
private := ctx.FormOptionalBool("private")
110113
ctx.Data["IsPrivate"] = private
111114

@@ -129,6 +132,7 @@ func Home(ctx *context.Context) {
129132
Archived: archived,
130133
Fork: fork,
131134
Mirror: mirror,
135+
Template: template,
132136
IsPrivate: private,
133137
})
134138
if err != nil {

routers/web/user/notification.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ func NotificationWatching(ctx *context.Context) {
398398
mirror := ctx.FormOptionalBool("mirror")
399399
ctx.Data["IsMirror"] = mirror
400400

401+
template := ctx.FormOptionalBool("template")
402+
ctx.Data["IsTemplate"] = template
403+
401404
private := ctx.FormOptionalBool("private")
402405
ctx.Data["IsPrivate"] = private
403406

@@ -417,6 +420,7 @@ func NotificationWatching(ctx *context.Context) {
417420
Archived: archived,
418421
Fork: fork,
419422
Mirror: mirror,
423+
Template: template,
420424
IsPrivate: private,
421425
})
422426
if err != nil {

routers/web/user/profile.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
170170
mirror := ctx.FormOptionalBool("mirror")
171171
ctx.Data["IsMirror"] = mirror
172172

173+
template := ctx.FormOptionalBool("template")
174+
ctx.Data["IsTemplate"] = template
175+
173176
private := ctx.FormOptionalBool("private")
174177
ctx.Data["IsPrivate"] = private
175178

@@ -222,6 +225,7 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
222225
Archived: archived,
223226
Fork: fork,
224227
Mirror: mirror,
228+
Template: template,
225229
IsPrivate: private,
226230
})
227231
if err != nil {
@@ -248,6 +252,7 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
248252
Archived: archived,
249253
Fork: fork,
250254
Mirror: mirror,
255+
Template: template,
251256
IsPrivate: private,
252257
})
253258
if err != nil {
@@ -297,6 +302,7 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
297302
Archived: archived,
298303
Fork: fork,
299304
Mirror: mirror,
305+
Template: template,
300306
IsPrivate: private,
301307
})
302308
if err != nil {

0 commit comments

Comments
 (0)