private list item

This commit is contained in:
Tim-Niclas Oelschläger 2024-02-22 03:56:25 +01:00
parent 4239ba94f5
commit d1e3a6ce77
No known key found for this signature in database
3 changed files with 133 additions and 107 deletions

View File

@ -3293,6 +3293,8 @@ review_dismissed_reason = Reason:
create_branch = created branch <a href="%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a>
starred_repo = starred <a href="%[1]s">%[2]s</a>
watched_repo = started watching <a href="%[1]s">%[2]s</a>
performed_1 = performed %d private action
performed_n = performed %d private actions
[tool]
now = now

View File

@ -74,7 +74,7 @@ func userProfile(ctx *context.Context) {
profileDbRepo, profileGitRepo, profileReadmeBlob, profileClose := shared_user.FindUserProfileReadme(ctx, ctx.Doer)
defer profileClose()
showPrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID)
showPrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID || ctx.ContextUser.ActionsVisibility.ShowAll())
prepareUserProfileTabData(ctx, showPrivate, profileDbRepo, profileGitRepo, profileReadmeBlob)
// call PrepareContextForProfileBigAvatar later to avoid re-querying the NumFollowers & NumFollowing
shared_user.PrepareContextForProfileBigAvatar(ctx)

View File

@ -1,10 +1,29 @@
<div id="activity-feed" class="flex-list">
{{range .Feeds}}
{{$isPrivateView := and (not $.IsAdmin) .IsPrivate (ne $.ContextUser.ID $.SignedUserID) (not $.IsOrganizationMember)}}
<div class="flex-item">
<div class="flex-item-leading">
{{ctx.AvatarUtils.AvatarByAction .}}
</div>
<div class="flex-item-main gt-gap-3">
{{if $isPrivateView}}
<div>
{{if gt .ActUser.ID 0}}
<a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetDisplayNameTitle ctx}}">{{.GetDisplayName ctx}}</a>
{{else}}
{{.ShortActUserName ctx}}
{{end}}
{{$pushLength := 1}}
{{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
{{$commitLength := (ActionContent2Commits .).Len}}
{{if gt $commitLength $pushLength}}
{{$pushLength = $commitLength}}
{{end}}
{{end}}
{{ctx.Locale.TrN $pushLength "action.performed_1" "action.performed_n" $pushLength}}
{{TimeSince .GetCreate ctx.Locale}}
</div>
{{else}}
<div>
{{if gt .ActUser.ID 0}}
<a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetDisplayNameTitle ctx}}">{{.GetDisplayName ctx}}</a>
@ -117,9 +136,14 @@
<div class="flex-item-body text black">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
<div class="flex-item-body text black">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div>
{{end}}
{{end}}
</div>
<div class="flex-item-trailing">
{{if $isPrivateView}}
{{svg "octicon-lock" 32 "text grey gt-mr-2"}}
{{else}}
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}}
{{end}}
</div>
</div>
{{end}}