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/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]