website/web/templates/partials/user_avatar.html
Noah 6c91c67c97 More Private User Avatars
* Users who set their Profile Picture to "friends only" or "private" can have
  their avatar be private all over the website to users who are not their
  friends or not granted access.
* Users who are not your friends see a yellow placeholder avatar, and users
  not granted access to a private Profile Pic sees a purple avatar.
* Admin users see these same placeholder avatars most places too (on search,
  forums, comments, etc.) if the user did not friend or grant the admin. But
  admins ALWAYS see it on their Profile Page directly, for ability to moderate.
* Fix marking Notifications as read: clicking the link in an unread notification
  now will wait on the ajax request to finish before allowing the redirect.
* Update the FAQ
2022-09-08 21:42:20 -07:00

77 lines
2.9 KiB
HTML

<!-- User avatar widgets -->
<!-- Parameter: .User -->
{{define "avatar-48x48"}}
<figure class="image is-48x48 is-inline-block">
<a href="/u/{{.Username}}" class="has-text-dark">
{{if .ProfilePhoto.ID}}
{{if and (eq .ProfilePhoto.Visibility "private") (not .UserRelationship.IsPrivateGranted)}}
<img src="/static/img/shy-private.png">
{{else if and (eq .ProfilePhoto.Visibility "friends") (not .UserRelationship.IsFriend)}}
<img src="/static/img/shy-friends.png">
{{else}}
<img src="{{PhotoURL .ProfilePhoto.CroppedFilename}}">
{{end}}
{{else}}
<img src="/static/img/shy.png">
{{end}}
</a>
</figure>
{{end}}
<!-- Parameter: .User -->
{{define "avatar-64x64"}}
<figure class="image is-64x64 is-inline-block">
<a href="/u/{{.Username}}" class="has-text-dark">
{{if .ProfilePhoto.ID}}
{{if and (eq .ProfilePhoto.Visibility "private") (not .UserRelationship.IsPrivateGranted)}}
<img src="/static/img/shy-private.png">
{{else if and (eq .ProfilePhoto.Visibility "friends") (not .UserRelationship.IsFriend)}}
<img src="/static/img/shy-friends.png">
{{else}}
<img src="{{PhotoURL .ProfilePhoto.CroppedFilename}}">
{{end}}
{{else}}
<img src="/static/img/shy.png">
{{end}}
</a>
</figure>
{{end}}
<!-- Parameter: .User -->
{{define "avatar-96x96"}}
<figure class="image is-96x96 is-inline-block">
<a href="/u/{{.Username}}" class="has-text-dark">
{{if .ProfilePhoto.ID}}
{{if and (eq .ProfilePhoto.Visibility "private") (not .UserRelationship.IsPrivateGranted)}}
<img src="/static/img/shy-private.png">
{{else if and (eq .ProfilePhoto.Visibility "friends") (not .UserRelationship.IsFriend)}}
<img src="/static/img/shy-friends.png">
{{else}}
<img src="{{PhotoURL .ProfilePhoto.CroppedFilename}}">
{{end}}
{{else}}
<img src="/static/img/shy.png">
{{end}}
</a>
</figure>
{{end}}
<!-- Parameter: .User -->
{{define "avatar-32x32"}}
<figure class="image is-32x32 is-inline-block">
<a href="/u/{{.Username}}" class="has-text-dark">
{{if .ProfilePhoto.ID}}
{{if and (eq .ProfilePhoto.Visibility "private") (not .UserRelationship.IsPrivateGranted)}}
<img class="is-rounded" src="/static/img/shy-private.png">
{{else if and (eq .ProfilePhoto.Visibility "friends") (not .UserRelationship.IsFriend)}}
<img class="is-rounded" src="/static/img/shy-friends.png">
{{else}}
<img class="is-rounded" src="{{PhotoURL .ProfilePhoto.CroppedFilename}}">
{{end}}
{{else}}
<img class="is-rounded" src="/static/img/shy.png">
{{end}}
</a>
</figure>
{{end}}