Skip to content

Commit

Permalink
hide broken user actions in blocked list - closes #15529
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 16, 2024
1 parent 4bb02c8 commit f6f7848
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/relation/src/main/ui/RelationUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class RelationUi(helpers: Helpers):
trans.site.friends()
)
),
pagTable(pag, routes.Relation.following(u.username))
pagTable(pag, routes.Relation.following(u.username), withActions = true)
)

def blocks(u: User, pag: Paginator[Related[UserWithPerfs]])(using Context) =
Expand All @@ -136,7 +136,7 @@ final class RelationUi(helpers: Helpers):
h1(userLink(u, withOnline = false)),
div(cls := "actions")(trans.site.blocks.pluralSame(pag.nbResults))
),
pagTable(pag, routes.Relation.blocks())
pagTable(pag, routes.Relation.blocks(), withActions = false)
)

def opponents(u: User, sugs: List[Related[UserWithPerfs]])(using ctx: Context) =
Expand Down Expand Up @@ -177,7 +177,9 @@ final class RelationUi(helpers: Helpers):
.wrap: body =>
main(cls := "box page-small")(body)

private def pagTable(pager: Paginator[Related[UserWithPerfs]], call: Call)(using ctx: Context) =
private def pagTable(pager: Paginator[Related[UserWithPerfs]], call: Call, withActions: Boolean)(using
ctx: Context
) =
table(cls := "slist slist-pad")(
if pager.nbResults > 0
then
Expand All @@ -189,7 +191,8 @@ final class RelationUi(helpers: Helpers):
td(trans.site.nbGames.plural(r.user.count.game, r.user.count.game.localize)),
td(r.user.seenAt.map: seen =>
trans.site.lastSeenActive(momentFromNow(seen))),
td(actions(r.user.light, relation = r.relation, followable = r.followable, blocked = false))
withActions.option:
td(actions(r.user.light, relation = r.relation, followable = r.followable, blocked = false))
),
pagerNextTable(pager, np => addQueryParam(call.url, "page", np.toString))
)
Expand Down

0 comments on commit f6f7848

Please sign in to comment.