Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-30 22:06:11 +01:00
forgejo/templates/user/profile.tmpl
0ko 3e1d5cc447 feat(ui): better activity messages for cases of private profiles (#5638)
* added a message for the case where the user's profile is private but the Public activity is not hidden
The activity is still hidden anyway because the profile is private, but previously the message would say:
`Your activity is visible to everyone, except for interactions in private spaces...`
which I would consider as a flaw of the original implementation. Now it will say:
`Your activity is only visible to you and the instance administrators because your profile is private...`
* started showing the message for admins that the activity they see should remain private in the case
where the whole profile is private, not just the activity tab. Previously it would say:
This activity is visible to everyone, but as an administrator you can also see interactions in private spaces.`
which I would also consider as a flaw of the original implementation. Now it will say:
`This activity is visible to you because you're an administrator, but the user wants it to remain private.`
* added test cases
* bumped up the number of our GPL-licensed files

Preview
For both screenshots, Forgejo would previously display misinformation.

Change 1: User viewing their private profile, but activity isn't configured as hidden
https://codeberg.org/attachments/6659c80c-15dd-48be-a379-db737fd1dd5e

Change 2: Admin viewing user's private profile
https://codeberg.org/attachments/220da57f-b658-4474-9ad2-049e8438a0af

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5638
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-10-21 14:39:29 +00:00

81 lines
2.8 KiB
Go HTML Template

{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content user profile">
<div class="ui container">
{{template "base/alert" .}}
<div class="ui stackable grid">
<div class="ui four wide column">
{{template "shared/user/profile_big_avatar" .}}
</div>
<div class="ui twelve wide column tw-mb-4">
{{template "user/overview/header" .}}
{{if eq .TabName "activity"}}
{{if eq .SignedUserID .ContextUser.ID}}
<p id="visibility-hint">
{{if .ContextUser.KeepActivityPrivate}}
{{ctx.Locale.Tr "user.public_activity.visibility_hint.self_private" "/user/settings#keep-activity-private"}}
{{else}}
{{if eq .ContextUser.Visibility 2}}
{{ctx.Locale.Tr "user.public_activity.visibility_hint.self_private_profile" "/user/settings#visibility-setting"}}
{{else}}
{{ctx.Locale.Tr "user.public_activity.visibility_hint.self_public" "/user/settings#keep-activity-private"}}
{{end}}
{{end}}
</p>
{{else}}
{{if .IsAdmin}}
<div id="visibility-hint" class="ui info message">
{{if or .ContextUser.KeepActivityPrivate (eq .ContextUser.Visibility 2)}}
{{ctx.Locale.Tr "user.public_activity.visibility_hint.admin_private"}}
{{else}}
{{ctx.Locale.Tr "user.public_activity.visibility_hint.admin_public"}}
{{end}}
</div>
{{else}}
{{if .ContextUser.KeepActivityPrivate}}
<p id="visibility-hint">{{ctx.Locale.Tr "user.disabled_public_activity"}}</p>
{{end}}
{{end}}
{{end}}
{{if or .IsAdmin (eq .SignedUserID .ContextUser.ID) (not .ContextUser.KeepActivityPrivate)}}
{{template "user/heatmap" .}}
{{template "user/dashboard/feeds" .}}
{{end}}
{{else if eq .TabName "stars"}}
<div class="stars">
{{template "shared/repo_search" .}}
{{template "explore/repo_list" .}}
{{template "base/paginate" .}}
</div>
{{else if eq .TabName "following"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "overview"}}
<div id="readme_profile" class="markup">{{.ProfileReadme}}</div>
{{else}}
{{template "shared/repo_search" .}}
{{template "explore/repo_list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
</div>
</div>
</div>
<div class="ui g-modal-confirm delete modal" id="block-user">
<div class="header">
{{ctx.Locale.Tr "user.block_user"}}
</div>
<div class="content">
<p>{{ctx.Locale.Tr "user.block_user.detail"}}</p>
<ul>
<li>{{ctx.Locale.Tr "user.block_user.detail_1"}}</li>
<li>{{ctx.Locale.Tr "user.block_user.detail_2"}}</li>
<li>{{ctx.Locale.Tr "user.block_user.detail_3"}}</li>
</ul>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}