Added notice to UserView when profile is not public
This commit is contained in:
parent
7a9715977a
commit
9d528dc8f2
|
@ -1,11 +1,11 @@
|
||||||
@page "/profile/{id:guid}"
|
@page "/profile/{id:guid}"
|
||||||
@using Wave.Data
|
@using Wave.Data
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Wave.Components.Account
|
@using Wave.Utilities
|
||||||
@using System.Security.Claims
|
|
||||||
|
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||||
@inject IStringLocalizer<UserView> Localizer
|
@inject IStringLocalizer<UserView> Localizer
|
||||||
|
@inject IMessageDisplay Message
|
||||||
|
|
||||||
<PageTitle>@(TitlePrefix + @Localizer["Title"] + " | " + (User?.FullName ?? Localizer["NotFound_Title"]))</PageTitle>
|
<PageTitle>@(TitlePrefix + @Localizer["Title"] + " | " + (User?.FullName ?? Localizer["NotFound_Title"]))</PageTitle>
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@
|
||||||
// Validate access to user
|
// Validate access to user
|
||||||
if (User is not null && User.Articles.Count > 0) {
|
if (User is not null && User.Articles.Count > 0) {
|
||||||
} else if (User is not null && HttpContext.User.FindFirst("Id")?.Value == User.Id) {
|
} else if (User is not null && HttpContext.User.FindFirst("Id")?.Value == User.Id) {
|
||||||
|
Message.ShowWarning(Localizer["ProfileNotPublic_Message"]);
|
||||||
} else {
|
} else {
|
||||||
User = null;
|
User = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,4 +116,7 @@
|
||||||
<data name="Articles" xml:space="preserve">
|
<data name="Articles" xml:space="preserve">
|
||||||
<value>Artikel</value>
|
<value>Artikel</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ProfileNotPublic_Message" xml:space="preserve">
|
||||||
|
<value>Ihr Profil ist momentan nicht öffentlich einsehbar. </value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -116,4 +116,7 @@
|
||||||
<data name="Articles" xml:space="preserve">
|
<data name="Articles" xml:space="preserve">
|
||||||
<value>Articles</value>
|
<value>Articles</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ProfileNotPublic_Message" xml:space="preserve">
|
||||||
|
<value>Your profile is currently not publicly visible.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in a new issue