mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-23 01:20:50 +00:00
feat(ui): messages for empty usercards (#7947)
Show a message about list being empty, so the page doesn't look broken-ish empty. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7947 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
2b30c83a0c
commit
765e7bd1b6
6 changed files with 74 additions and 30 deletions
|
@ -1,5 +1,6 @@
|
|||
// Copyright 2015 The Gogs Authors. All rights reserved.
|
||||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package user
|
||||
|
@ -170,10 +171,20 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb
|
|||
ctx.Data["Cards"] = followers
|
||||
total = int(numFollowers)
|
||||
ctx.Data["CardsTitle"] = ctx.TrN(total, "user.followers.title.one", "user.followers.title.few")
|
||||
if ctx.IsSigned && ctx.ContextUser.ID == ctx.Doer.ID {
|
||||
ctx.Data["CardsNoneMsg"] = ctx.Tr("followers.incoming.list.self.none")
|
||||
} else {
|
||||
ctx.Data["CardsNoneMsg"] = ctx.Tr("followers.incoming.list.none")
|
||||
}
|
||||
case "following":
|
||||
ctx.Data["Cards"] = following
|
||||
total = int(numFollowing)
|
||||
ctx.Data["CardsTitle"] = ctx.TrN(total, "user.following.title.one", "user.following.title.few")
|
||||
if ctx.IsSigned && ctx.ContextUser.ID == ctx.Doer.ID {
|
||||
ctx.Data["CardsNoneMsg"] = ctx.Tr("followers.outgoing.list.self.none")
|
||||
} else {
|
||||
ctx.Data["CardsNoneMsg"] = ctx.Tr("followers.outgoing.list.none", ctx.ContextUser.Name)
|
||||
}
|
||||
case "activity":
|
||||
date := ctx.FormString("date")
|
||||
pagingNum = setting.UI.FeedPagingNum
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue