diff --git a/src/JoinRpg.Blazor.Client/UriLocatorExtensions.cs b/src/JoinRpg.Blazor.Client/UriLocatorExtensions.cs index 5c226601c..32c70f970 100644 --- a/src/JoinRpg.Blazor.Client/UriLocatorExtensions.cs +++ b/src/JoinRpg.Blazor.Client/UriLocatorExtensions.cs @@ -8,7 +8,14 @@ public static class UriLocatorExtensions private class UriLocator : IUriLocator, IUriLocator { Uri IUriLocator.GetUri(UserLinkViewModel target) - => new($"/user/{target.UserId}"); + { + if (target.ViewMode == ViewMode.Hide) + { + throw new InvalidOperationException("Should not have url of hidden"); + } + return new($"/user/{target.UserId}"); + } + Uri IUriLocator.GetUri(CharacterGroupLinkSlimViewModel target) => throw new NotImplementedException(); // TODO implement for Blazor. Added so we will have nice exception instead of bla-bla not resolved. diff --git a/src/JoinRpg.Domain/Schedules/ScheduleModels.cs b/src/JoinRpg.Domain/Schedules/ScheduleModels.cs index 463e1a3cd..b6ebd852c 100644 --- a/src/JoinRpg.Domain/Schedules/ScheduleModels.cs +++ b/src/JoinRpg.Domain/Schedules/ScheduleModels.cs @@ -7,22 +7,15 @@ namespace JoinRpg.Domain.Schedules; -public class ProgramItem +public class ProgramItem(Character character) { - public int Id { get; internal set; } - public string Name { get; internal set; } - public MarkdownString Description { get; internal set; } - public User[] Authors { get; internal set; } - public int ProjectId { get; set; } + public int Id { get; } = character.CharacterId; + public string Name { get; } = character.CharacterName; + public MarkdownString Description { get; } = character.Description; + public User[] Authors { get; } = new[] { character.ApprovedClaim?.Player }.WhereNotNull().ToArray(); + public int ProjectId { get; } = character.ProjectId; - public ProgramItem(Character character) - { - Id = character.CharacterId; - Name = character.CharacterName; - Description = character.Description; - Authors = new[] { character.ApprovedClaim?.Player }.WhereNotNull().ToArray(); - ProjectId = character.ProjectId; - } + public bool ShowAuthors { get; } = !character.HidePlayerForCharacter; } public class ProgramItemPlaced diff --git a/src/JoinRpg.Portal/Controllers/GameGroupsController.cs b/src/JoinRpg.Portal/Controllers/GameGroupsController.cs index c9f4bfaca..53af02876 100644 --- a/src/JoinRpg.Portal/Controllers/GameGroupsController.cs +++ b/src/JoinRpg.Portal/Controllers/GameGroupsController.cs @@ -217,9 +217,9 @@ private object ConvertCharacterToJson(CharacterViewModel ch) ch.IsFirstCopy, ch.CharacterName, Description = ch.Description?.ToHtmlString(), - PlayerName = ch.HidePlayer ? "скрыто" : ch.PlayerLink?.DisplayName, - PlayerId = ch.HidePlayer ? null : ch.PlayerLink?.UserId, //TODO Remove - PlayerLink = (ch.HidePlayer || ch.PlayerLink is null) ? null : userLinkLocator.GetUri(ch.PlayerLink).AbsoluteUri, + PlayerName = ch.PlayerLink?.DisplayName, + PlayerId = ch.PlayerLink?.UserId, + PlayerLink = (ch.PlayerLink is null || ch.PlayerLink.ViewMode == ViewMode.Hide) ? null : userLinkLocator.GetUri(ch.PlayerLink).AbsoluteUri, ch.ActiveClaimsCount, ClaimLink = ch.IsAvailable diff --git a/src/JoinRpg.Portal/Views/Character/Details.cshtml b/src/JoinRpg.Portal/Views/Character/Details.cshtml index 628c52b41..d83c1b3c3 100644 --- a/src/JoinRpg.Portal/Views/Character/Details.cshtml +++ b/src/JoinRpg.Portal/Views/Character/Details.cshtml @@ -20,7 +20,7 @@ }
Игрок
-
@Html.DisplayFor(model => model, "IPlayerCharacter")
+
@Html.DisplayFor(model => model.PlayerLink)
@if (Model.ParentGroups.HasAnyGroups) {
@Html.DisplayNameFor(model => model.ParentGroups)
diff --git a/src/JoinRpg.Portal/Views/GameGroups/_CharacterPartial.cshtml b/src/JoinRpg.Portal/Views/GameGroups/_CharacterPartial.cshtml index 24eb3c76f..da7a059f7 100644 --- a/src/JoinRpg.Portal/Views/GameGroups/_CharacterPartial.cshtml +++ b/src/JoinRpg.Portal/Views/GameGroups/_CharacterPartial.cshtml @@ -18,10 +18,8 @@ }
@Html.ActionLink(Model.CharacterName ?? Model.CharacterId.ToString(), "Details", "Character", new { Model.ProjectId, Model.CharacterId }, null) - @if (Model.PlayerLink != null) - { - @Html.DisplayFor(model => model, "IPlayerCharacter") - } + + @Html.DisplayFor(model => model.PlayerLink) else if (Model.ActiveClaimsCount > 0) { @Html.DisplayCount_OfX(Model.ActiveClaimsCount, "заявка", "заявки", "заявок") diff --git a/src/JoinRpg.Portal/Views/Shared/DisplayTemplates/IPlayerCharacter.cshtml b/src/JoinRpg.Portal/Views/Shared/DisplayTemplates/IPlayerCharacter.cshtml deleted file mode 100644 index 341883ddd..000000000 --- a/src/JoinRpg.Portal/Views/Shared/DisplayTemplates/IPlayerCharacter.cshtml +++ /dev/null @@ -1,19 +0,0 @@ -@model JoinRpg.Web.Models.Characters.ICharacterWithPlayerViewModel - -@if (Model != null && Model.PlayerLink != null) -{ - if (!Model.HidePlayer || Model.HasAccess) - { - var hideClassName = Model.HidePlayer ? "world-object-hidden" : ""; - @Html.DisplayFor(model => Model.PlayerLink) - } - else - { - - занято - } -} -else -{ - нет -} diff --git a/src/JoinRpg.Web.ProjectCommon/MasterViewModel.cs b/src/JoinRpg.Web.ProjectCommon/MasterViewModel.cs index 76d1a549d..eb083d474 100644 --- a/src/JoinRpg.Web.ProjectCommon/MasterViewModel.cs +++ b/src/JoinRpg.Web.ProjectCommon/MasterViewModel.cs @@ -1,4 +1,5 @@ using JoinRpg.PrimitiveTypes; +using JoinRpg.WebComponents; namespace JoinRpg.Web.ProjectCommon; @@ -6,4 +7,6 @@ public record MasterViewModel(int MasterId, UserDisplayName DisplayName) { public static MasterViewModel Empty(string label) => new(-1, new UserDisplayName(DisplayName: label, FullName: null)); + + public UserLinkViewModel ToUserLinkViewModel() => new UserLinkViewModel(MasterId, DisplayName.DisplayName, ViewMode.Show); } diff --git a/src/JoinRpg.Web.ProjectMasterTools/ResponsibleMaster/ResponsibleMasterRulesList.razor b/src/JoinRpg.Web.ProjectMasterTools/ResponsibleMaster/ResponsibleMasterRulesList.razor index 1b1ac1c8d..874c50c62 100644 --- a/src/JoinRpg.Web.ProjectMasterTools/ResponsibleMaster/ResponsibleMasterRulesList.razor +++ b/src/JoinRpg.Web.ProjectMasterTools/ResponsibleMaster/ResponsibleMasterRulesList.razor @@ -92,7 +92,7 @@ new ResponsibleMasterRuleViewModel( model.Group.CharacterGroupId, model.Group.Name, - new UserLinkViewModel(model.Master.MasterId, model.Master.DisplayName.DisplayName) + model.Master.ToUserLinkViewModel() )); try diff --git a/src/JoinRpg.WebComponents/UserLink.razor b/src/JoinRpg.WebComponents/UserLink.razor index 5eb5bb1d1..52235003e 100644 --- a/src/JoinRpg.WebComponents/UserLink.razor +++ b/src/JoinRpg.WebComponents/UserLink.razor @@ -1,4 +1,16 @@ @inject IUriLocator userLinkLocator + @switch (Model.ViewMode) + { + case JoinRpg.WebComponents.ViewMode.Show: + @Model.DisplayName + break; + case JoinRpg.WebComponents.ViewMode.ShowAsPrivate: + @Model.DisplayName + break; + case JoinRpg.WebComponents.ViewMode.Hide: + занято + break; + } @Model.DisplayName @code { diff --git a/src/JoinRpg.WebComponents/UserLinkViewModel.cs b/src/JoinRpg.WebComponents/UserLinkViewModel.cs index c8ced7dda..515dcde89 100644 --- a/src/JoinRpg.WebComponents/UserLinkViewModel.cs +++ b/src/JoinRpg.WebComponents/UserLinkViewModel.cs @@ -1,3 +1,12 @@ namespace JoinRpg.WebComponents; -public record UserLinkViewModel(int UserId, string DisplayName); +public enum ViewMode +{ + Show, + ShowAsPrivate, + Hide +} +public record UserLinkViewModel(int UserId, string DisplayName, ViewMode ViewMode) +{ + public static UserLinkViewModel Hidden = new(-1, "скрыто", ViewMode.Hide); +} diff --git a/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageManager.cs b/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageManager.cs index 9d2b2c995..892cfb917 100644 --- a/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageManager.cs +++ b/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageManager.cs @@ -34,15 +34,16 @@ IProjectMetadataRepository projectMetadataRepository public async Task GetSchedule() { (var project, var result) = await GetCompiledSchedule(); + var hasMasterAccess = project.HasMasterAccess(CurrentUserAccessor); var viewModel = new SchedulePageViewModel() { ProjectId = CurrentProject.ProjectId, DisplayName = project.ProjectName, - NotScheduledProgramItems = result.NotScheduled.ToViewModel(), + NotScheduledProgramItems = result.NotScheduled.ToViewModel(hasMasterAccess), Columns = result.Rooms.ToViewModel(), Rows = result.TimeSlots.ToViewModel(), - ConflictedProgramItems = result.Conflicted.ToViewModel(), - Slots = result.Slots.Select2DList(x => x.ToViewModel()) + ConflictedProgramItems = result.Conflicted.ToViewModel(hasMasterAccess), + Slots = result.Slots.Select2DList(x => x.ToViewModel(hasMasterAccess)), }; MergeSlots(viewModel); diff --git a/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageViewModelBuilder.cs b/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageViewModelBuilder.cs index efebd637c..be43c09b4 100644 --- a/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageViewModelBuilder.cs +++ b/src/JoinRpg.WebPortal.Managers/Schedule/SchedulePageViewModelBuilder.cs @@ -2,18 +2,20 @@ using JoinRpg.Helpers.Web; using JoinRpg.Markdown; using JoinRpg.Web.Models.Schedules; +using JoinRpg.Web.Models.UserProfile; +using JoinRpg.WebComponents; namespace JoinRpg.WebPortal.Managers.Schedule; internal static class SchedulePageViewModelBuilder { - public static IReadOnlyList ToViewModel(this IEnumerable items) - => items.Select(item => item.ToViewModel()).ToList(); + public static IReadOnlyList ToViewModel(this IEnumerable items, bool hasMasterAccess) + => items.Select(item => item.ToViewModel(hasMasterAccess)).ToList(); public static IReadOnlyList ToViewModel(this IEnumerable items) => items.Select(item => item.ToViewModel()).ToList(); - public static ProgramItemViewModel ToViewModel(this ProgramItem? item) + public static ProgramItemViewModel ToViewModel(this ProgramItem? item, bool hasMasterAccess) { if (item == null) { @@ -25,10 +27,23 @@ public static ProgramItemViewModel ToViewModel(this ProgramItem? item) Name = item.Name, Description = item.Description, ProjectId = item.ProjectId, - Users = item.Authors, + Users = GetAuthors(item, hasMasterAccess), }; } + public static UserLinkViewModel[] GetAuthors(ProgramItem item, bool hasMasterAccess) + { + if (item.Authors.Length == 0) + { + return []; + } + if (!item.ShowAuthors && !hasMasterAccess) + { + return [UserLinkViewModel.Hidden]; + } + return [.. item.Authors.Select(x => UserLinks.Create(x, ViewMode.Show))]; + } + public static TableHeaderViewModel ToViewModel(this ScheduleItemAttribute scheduleItem) { if (scheduleItem is TimeSlot slot) diff --git a/src/JoinRpg.WebPortal.Models/Characters/CharacterDetailsViewModel.cs b/src/JoinRpg.WebPortal.Models/Characters/CharacterDetailsViewModel.cs index a26f5d0a2..15d41e1bc 100644 --- a/src/JoinRpg.WebPortal.Models/Characters/CharacterDetailsViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Characters/CharacterDetailsViewModel.cs @@ -4,7 +4,6 @@ using JoinRpg.PrimitiveTypes.ProjectMetadata; using JoinRpg.Services.Interfaces; using JoinRpg.Web.Models.Plot; -using JoinRpg.Web.Models.UserProfile; using JoinRpg.WebComponents; namespace JoinRpg.Web.Models.Characters; @@ -30,15 +29,7 @@ public CharacterParentGroupsViewModel(Character character, bool hasMasterAccess) } } -//TODO merge everything into UserLinkViewModel and remove this interface -public interface ICharacterWithPlayerViewModel -{ - UserLinkViewModel? PlayerLink { get; } - bool HidePlayer { get; } - bool HasAccess { get; } -} - -public class CharacterDetailsViewModel : ICharacterWithPlayerViewModel, ICreatedUpdatedTracked +public class CharacterDetailsViewModel : ICreatedUpdatedTracked { [ReadOnly(true), DisplayName("Входит в группы")] public CharacterParentGroupsViewModel ParentGroups { get; } @@ -47,9 +38,6 @@ public class CharacterDetailsViewModel : ICharacterWithPlayerViewModel, ICreated public PlotDisplayViewModel Plot { get; } - public bool HidePlayer { get; } - public bool HasAccess { get; } - public CustomFieldsViewModel Fields { get; } public CharacterNavigationViewModel Navigation { get; } @@ -62,10 +50,9 @@ public CharacterDetailsViewModel( IUriService uriService, ProjectInfo projectInfo) { - PlayerLink = UserLinks.Create(character.ApprovedClaim?.Player); - HasAccess = character.HasAnyAccess(currentUserIdOrDefault); + + PlayerLink = character.GetCharacterPlayerLinkViewModel(currentUserIdOrDefault); ParentGroups = new CharacterParentGroupsViewModel(character, character.HasMasterAccess(currentUserIdOrDefault)); - HidePlayer = character.HidePlayerForCharacter; Navigation = CharacterNavigationViewModel.FromCharacter(character, CharacterNavigationPage.Character, currentUserIdOrDefault); diff --git a/src/JoinRpg.WebPortal.Models/Characters/CharacterGroupListViewModel.cs b/src/JoinRpg.WebPortal.Models/Characters/CharacterGroupListViewModel.cs index 15230cc35..0817d1451 100644 --- a/src/JoinRpg.WebPortal.Models/Characters/CharacterGroupListViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Characters/CharacterGroupListViewModel.cs @@ -4,7 +4,6 @@ using JoinRpg.Helpers; using JoinRpg.Markdown; using JoinRpg.Web.Models.CommonTypes; -using JoinRpg.Web.Models.UserProfile; namespace JoinRpg.Web.Models.Characters; @@ -129,10 +128,8 @@ private CharacterViewModel GenerateCharacter(Character arg, CharacterGroup group Description = arg.Description.ToHtmlString(), IsPublic = arg.IsPublic, IsActive = arg.IsActive, - HidePlayer = arg.HidePlayerForCharacter && !arg.Project.Details.PublishPlot, ActiveClaimsCount = arg.Claims.Count(claim => claim.ClaimStatus.IsActive()), - PlayerLink = UserLinks.Create(arg.ApprovedClaim?.Player), - HasMasterAccess = HasMasterAccess, + PlayerLink = arg.GetCharacterPlayerLinkViewModel(CurrentUserId), HasEditRolesAccess = HasEditRolesAccess, ProjectId = arg.ProjectId, FirstInGroup = siblings[0] == arg, diff --git a/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModeExtensions.cs b/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModeExtensions.cs new file mode 100644 index 000000000..b11d476c1 --- /dev/null +++ b/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModeExtensions.cs @@ -0,0 +1,27 @@ +using JoinRpg.DataModel; +using JoinRpg.Domain; +using JoinRpg.Web.Models.UserProfile; +using JoinRpg.WebComponents; + + +namespace JoinRpg.Web.Models.Characters; +public static class CharacterViewModeExtensions +{ + public static ViewMode GetViewModeForCharacter(this Character character, int? currentUserIdOrDefault) + { + var hasAccess = character.HasAnyAccess(currentUserIdOrDefault); + return (character.HidePlayerForCharacter, hasAccess, character.Project.Details.PublishPlot) + switch + { + (false, _, _) => ViewMode.Show, + (true, false, false) => ViewMode.Hide, + (true, _, true) => ViewMode.ShowAsPrivate, + (true, true, _) => ViewMode.ShowAsPrivate, + }; + } + + public static UserLinkViewModel? GetCharacterPlayerLinkViewModel(this Character character, int? currentUserIdOrDefault) + { + return UserLinks.Create(character.ApprovedClaim?.Player, character.GetViewModeForCharacter(currentUserIdOrDefault)); + } +} diff --git a/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModel.cs b/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModel.cs index 5973a8739..96edf2b38 100644 --- a/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Characters/CharacterViewModel.cs @@ -5,7 +5,6 @@ namespace JoinRpg.Web.Models.Characters; public class CharacterViewModel : - ICharacterWithPlayerViewModel, IEquatable, ILinkable { @@ -26,12 +25,8 @@ public class CharacterViewModel : public bool IsActive { get; set; } public UserLinkViewModel? PlayerLink { get; set; } - public bool HidePlayer { get; set; } - public bool HasAccess => HasMasterAccess; public int ActiveClaimsCount { get; set; } - public bool HasMasterAccess { get; set; } - public bool FirstInGroup { get; set; } public bool LastInGroup { get; set; } diff --git a/src/JoinRpg.WebPortal.Models/Claims/ClaimViewModel.cs b/src/JoinRpg.WebPortal.Models/Claims/ClaimViewModel.cs index 60a7e8365..ddf071c73 100644 --- a/src/JoinRpg.WebPortal.Models/Claims/ClaimViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Claims/ClaimViewModel.cs @@ -16,7 +16,7 @@ namespace JoinRpg.Web.Models; -public class ClaimViewModel : ICharacterWithPlayerViewModel, IEntityWithCommentsViewModel +public class ClaimViewModel : IEntityWithCommentsViewModel { public int ClaimId { get; set; } public int ProjectId { get; set; } @@ -66,10 +66,6 @@ public class ClaimViewModel : ICharacterWithPlayerViewModel, IEntityWithComments [ReadOnly(true)] public IList PotentialCharactersToMove { get; } - public bool HidePlayer => false; - - public bool HasAccess => true; - public CustomFieldsViewModel Fields { get; } public CharacterNavigationViewModel Navigation { get; } @@ -138,7 +134,7 @@ public ClaimViewModel(User currentUser, ExtraAccessReason.PlayerOrResponsible); IsMyClaim = claim.PlayerUserId == currentUser.UserId; Player = claim.Player; - PlayerLink = UserLinks.Create(claim.Player); + PlayerLink = UserLinks.Create(claim.Player, ViewMode.Show); ProjectId = claim.ProjectId; ProjectName = claim.Project.ProjectName; Status = new ClaimFullStatusView(claim, AccessArgumentsFactory.Create(claim, currentUser.UserId)); diff --git a/src/JoinRpg.WebPortal.Models/Schedules/AppointmentViewModel.cs b/src/JoinRpg.WebPortal.Models/Schedules/AppointmentViewModel.cs index ae349b220..a88b1db93 100644 --- a/src/JoinRpg.WebPortal.Models/Schedules/AppointmentViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Schedules/AppointmentViewModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using JoinRpg.DataModel; using JoinRpg.Helpers.Web; +using JoinRpg.WebComponents; namespace JoinRpg.Web.Models.Schedules; @@ -25,7 +25,7 @@ public class AppointmentBaseViewModel public string DisplayName { get; set; } public int ProjectId { get; set; } public int CharacterId { get; set; } - public IReadOnlyCollection Users { get; set; } + public required IReadOnlyCollection Users { get; set; } public JoinHtmlString Description { get; set; } } diff --git a/src/JoinRpg.WebPortal.Models/Schedules/ProgramItemViewModel.cs b/src/JoinRpg.WebPortal.Models/Schedules/ProgramItemViewModel.cs index 1086e687a..6e83c6336 100644 --- a/src/JoinRpg.WebPortal.Models/Schedules/ProgramItemViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Schedules/ProgramItemViewModel.cs @@ -1,4 +1,5 @@ using JoinRpg.DataModel; +using JoinRpg.WebComponents; namespace JoinRpg.Web.Models.Schedules; @@ -10,14 +11,15 @@ public class ProgramItemViewModel Name = "", Description = new MarkdownString(), ProjectId = -1, - Users = Array.Empty(), + Users = [], IsEmpty = true, }; - public int Id { get; set; } - public string Name { get; set; } - public MarkdownString Description { get; set; } - public int ProjectId { get; set; } - public User[] Users { get; set; } + public required int Id { get; set; } + public required string Name { get; set; } + public required MarkdownString Description { get; set; } + public required int ProjectId { get; set; } + public required UserLinkViewModel[] Users { get; set; } + public bool IsEmpty { get; private set; } = false; public int RowSpan { get; set; } = 1; diff --git a/src/JoinRpg.WebPortal.Models/Schedules/TableHeaderViewModel.cs b/src/JoinRpg.WebPortal.Models/Schedules/TableHeaderViewModel.cs index d6f97036b..ca8d19875 100644 --- a/src/JoinRpg.WebPortal.Models/Schedules/TableHeaderViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/Schedules/TableHeaderViewModel.cs @@ -4,7 +4,7 @@ namespace JoinRpg.Web.Models.Schedules; public class TableHeaderViewModel { - public int Id { get; set; } - public string Name { get; set; } - public JoinHtmlString Description { get; set; } + public required int Id { get; set; } + public required string Name { get; set; } + public required JoinHtmlString Description { get; set; } } diff --git a/src/JoinRpg.WebPortal.Models/UserProfile/UserLinks.cs b/src/JoinRpg.WebPortal.Models/UserProfile/UserLinks.cs index 9624f089e..0991c45c3 100644 --- a/src/JoinRpg.WebPortal.Models/UserProfile/UserLinks.cs +++ b/src/JoinRpg.WebPortal.Models/UserProfile/UserLinks.cs @@ -8,9 +8,13 @@ namespace JoinRpg.Web.Models.UserProfile; public static class UserLinks { [return: NotNullIfNotNull("user")] - public static UserLinkViewModel? Create(User? user) + public static UserLinkViewModel? Create(User? user, ViewMode viewMode = ViewMode.Show) { - return user is null ? - null : new UserLinkViewModel(user.UserId, user.GetDisplayName().Trim()); + return (user, viewMode) switch + { + (null, _) => null, + (_, ViewMode.Hide) => UserLinkViewModel.Hidden, + _ => new UserLinkViewModel(user.UserId, user.GetDisplayName().Trim(), viewMode), + }; } } diff --git a/src/JoinRpg.WebPortal.Models/UserProfile/UserProfileViewModel.cs b/src/JoinRpg.WebPortal.Models/UserProfile/UserProfileViewModel.cs index b0d287373..3c608e845 100644 --- a/src/JoinRpg.WebPortal.Models/UserProfile/UserProfileViewModel.cs +++ b/src/JoinRpg.WebPortal.Models/UserProfile/UserProfileViewModel.cs @@ -75,7 +75,7 @@ public UserProfileDetailsViewModel(User user, User currentUser) } public UserProfileDetailsViewModel(User user, AccessReason reason) { - User = UserLinks.Create(user); + User = UserLinks.Create(user, ViewMode.Show); Reason = reason; SocialNetworkAccess = (ContactsAccessTypeView)user.GetSocialNetworkAccess(); Avatar = AvatarIdentification.FromOptional(user.SelectedAvatarId);