diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index 2295cea3..d4e14ade 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -64,6 +64,17 @@ gtag('config', '@ServerSettings.Instance.GoogleAnalyticsId'); } + +
diff --git a/ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml b/ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml index 33a8fbc1..2b422c5a 100644 --- a/ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml +++ b/ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml @@ -1,7 +1,14 @@ @using LBPUnion.ProjectLighthouse.Types @model LBPUnion.ProjectLighthouse.Types.Photo - + +
+ + + +

@@ -16,7 +23,104 @@

Photo contains @Model.Subjects.Count @(Model.Subjects.Count == 1 ? "person" : "people"):

-@foreach (PhotoSubject subject in Model.Subjects) -{ - @subject.User.Username -} \ No newline at end of file +
+ @foreach (PhotoSubject subject in Model.Subjects) + { + @subject.User.Username + } +
+ +@{ + PhotoSubject[] subjects = Model.Subjects.ToArray(); + foreach (PhotoSubject subject in subjects) subject.Username = subject.User.Username; +} + + \ No newline at end of file diff --git a/ProjectLighthouse/Pages/UserPage.cshtml b/ProjectLighthouse/Pages/UserPage.cshtml index 1b294497..b7843b06 100644 --- a/ProjectLighthouse/Pages/UserPage.cshtml +++ b/ProjectLighthouse/Pages/UserPage.cshtml @@ -1,9 +1,9 @@ @page "/user/{userId:int}" +@using System.IO +@using System.Web @using LBPUnion.ProjectLighthouse.Types @using LBPUnion.ProjectLighthouse.Types.Profiles @using LBPUnion.ProjectLighthouse.Types.Settings -@using System.Web; -@using System.IO; @model LBPUnion.ProjectLighthouse.Pages.UserPage @{ @@ -98,7 +98,7 @@ @foreach (Photo photo in Model.Photos) {
- @await Html.PartialAsync("Partials/PhotoPartial", photo); + @await Html.PartialAsync("Partials/PhotoPartial", photo)
}
diff --git a/ProjectLighthouse/Types/PhotoSubject.cs b/ProjectLighthouse/Types/PhotoSubject.cs index 99be0fb7..05144f33 100644 --- a/ProjectLighthouse/Types/PhotoSubject.cs +++ b/ProjectLighthouse/Types/PhotoSubject.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Serialization; @@ -20,6 +21,7 @@ namespace LBPUnion.ProjectLighthouse.Types [XmlIgnore] [ForeignKey(nameof(UserId))] + [JsonIgnore] public User User { get; set; } [NotMapped]