remove PageIsWatchers and PageIsStargazers because not used

This commit is contained in:
wxiaoguang 2024-11-21 21:40:43 +08:00
parent 09aac88f30
commit b1aa34a268
2 changed files with 2 additions and 7 deletions

View File

@ -1126,8 +1126,6 @@ func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOp
func Watchers(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.watchers")
ctx.Data["CardsTitle"] = ctx.Tr("repo.watchers")
ctx.Data["PageIsWatchers"] = true
RenderUserCards(ctx, ctx.Repo.Repository.NumWatches, func(opts db.ListOptions) ([]*user_model.User, error) {
return repo_model.GetRepoWatchers(ctx, ctx.Repo.Repository.ID, opts)
}, tplWatchers)
@ -1137,7 +1135,6 @@ func Watchers(ctx *context.Context) {
func Stars(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.stargazers")
ctx.Data["CardsTitle"] = ctx.Tr("repo.stargazers")
ctx.Data["PageIsStargazers"] = true
RenderUserCards(ctx, ctx.Repo.Repository.NumStars, func(opts db.ListOptions) ([]*user_model.User, error) {
return repo_model.GetStargazers(ctx, ctx.Repo.Repository, opts)
}, tplWatchers)

View File

@ -6,10 +6,8 @@ At the moment, no JS initialization would re-trigger (fortunately there is no JS
-->
<div class="no-loading-indicator tw-hidden"></div>
<div class="user-cards"
hx-trigger="refreshUserCards from:body"
hx-indicator=".no-loading-indicator"
hx-get="{{$.CurrentURL}}"
hx-swap="outerHTML" hx-select=".user-cards"
hx-trigger="refreshUserCards from:body" hx-indicator=".no-loading-indicator"
hx-get="{{$.CurrentURL}}" hx-swap="outerHTML" hx-select=".user-cards"
>
{{if .CardsTitle}}
<h2 class="ui dividing header">