[backend/razor] Allow clicking on display name & avatars in public note preview
This commit is contained in:
parent
d47f2ccd4c
commit
500217021c
3 changed files with 8 additions and 2 deletions
|
@ -19,11 +19,12 @@ else
|
|||
var acct = "@" + note.User.Username + (note.User.IsLocalUser ? "" : "@" + note.User.Host);
|
||||
var displayName = note.User.DisplayName;
|
||||
var username = note.User.Username;
|
||||
var url = note.User.UserProfile?.Url ?? note.User.Uri ?? note.User.GetPublicUrl(Model.WebDomain);
|
||||
var avatarUrl = note.User.AvatarUrl == null || !Model.ShowMedia ? note.User.IdenticonUrlPath : note.User.AvatarUrl;
|
||||
|
||||
<div class="user">
|
||||
<img src="@avatarUrl" class="avatar" alt="User avatar"/>
|
||||
<div class="title">@name by <span>@(displayName ?? username)</span></div>
|
||||
<a href="@url"><img src="@avatarUrl" class="avatar" alt="User avatar"/></a>
|
||||
<div class="title">@name by <a class="display-name" href="@url">@(displayName ?? username)</a></div>
|
||||
<span class="acct">@acct</span>
|
||||
</div>
|
||||
<small>Published at: @note.CreatedAt.ToDisplayString()</small>
|
||||
|
|
|
@ -27,6 +27,7 @@ public class NoteModel(
|
|||
public bool ShowMedia = security.Value.PublicPreview > Enums.PublicPreview.RestrictedNoMedia;
|
||||
public bool ShowRemoteReplies = security.Value.PublicPreview > Enums.PublicPreview.Restricted;
|
||||
public string InstanceName = "Iceshrimp.NET";
|
||||
public string WebDomain = config.Value.WebDomain;
|
||||
|
||||
public Dictionary<string, string> TextContent = new();
|
||||
|
||||
|
|
|
@ -41,4 +41,8 @@
|
|||
|
||||
.note {
|
||||
background-color: var(--background-body)
|
||||
}
|
||||
|
||||
.display-name {
|
||||
color: var(--text-bright);
|
||||
}
|
Loading…
Add table
Reference in a new issue