@@ -214,6 +214,8 @@ func TagsList(ctx *context.Context) {
214214 ctx .Data ["HideBranchesInDropdown" ] = true
215215 ctx .Data ["CanCreateRelease" ] = ctx .Repo .CanWrite (unit .TypeReleases ) && ! ctx .Repo .Repository .IsArchived
216216
217+ namePattern := ctx .FormTrim ("q" )
218+
217219 listOptions := db.ListOptions {
218220 Page : ctx .FormInt ("page" ),
219221 PageSize : ctx .FormInt ("limit" ),
@@ -233,6 +235,7 @@ func TagsList(ctx *context.Context) {
233235 IncludeTags : true ,
234236 HasSha1 : optional .Some (true ),
235237 RepoID : ctx .Repo .Repository .ID ,
238+ NamePattern : optional .Some (namePattern ),
236239 }
237240
238241 releases , err := db .Find [repo_model.Release ](ctx , opts )
@@ -241,14 +244,21 @@ func TagsList(ctx *context.Context) {
241244 return
242245 }
243246
247+ count , err := db .Count [repo_model.Release ](ctx , opts )
248+ if err != nil {
249+ ctx .ServerError ("GetReleasesByRepoID" , err )
250+ return
251+ }
252+
253+ ctx .Data ["Keyword" ] = namePattern
244254 ctx .Data ["Releases" ] = releases
255+ ctx .Data ["TagCount" ] = count
245256
246- numTags := ctx .Data ["NumTags" ].(int64 )
247- pager := context .NewPagination (int (numTags ), opts .PageSize , opts .Page , 5 )
257+ pager := context .NewPagination (int (count ), opts .PageSize , opts .Page , 5 )
248258 pager .SetDefaultParams (ctx )
249259 ctx .Data ["Page" ] = pager
250-
251260 ctx .Data ["PageIsViewCode" ] = ! ctx .Repo .Repository .UnitEnabled (ctx , unit .TypeReleases )
261+
252262 ctx .HTML (http .StatusOK , tplTagsList )
253263}
254264
0 commit comments