mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 09:48:37 +00:00
Use ASP.NET Partials for photo rendering
This commit is contained in:
parent
de4fab3a35
commit
db6d0aab31
3 changed files with 26 additions and 31 deletions
22
ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml
Normal file
22
ProjectLighthouse/Pages/Partials/PhotoPartial.cshtml
Normal file
|
@ -0,0 +1,22 @@
|
|||
@using LBPUnion.ProjectLighthouse.Types
|
||||
@model LBPUnion.ProjectLighthouse.Types.Photo
|
||||
|
||||
<img src="/gameAssets/@Model.LargeHash" style="width: 100%; height: auto; border-radius: .28571429rem;">
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<i>
|
||||
Taken by
|
||||
<b>
|
||||
<a href="/user/@Model.Creator?.UserId">@Model.Creator?.Username</a>
|
||||
</b>
|
||||
</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Photo contains @Model.Subjects.Count @(Model.Subjects.Count == 1 ? "person" : "people"):</b>
|
||||
</p>
|
||||
@foreach (PhotoSubject subject in Model.Subjects)
|
||||
{
|
||||
<a href="/user/@subject.UserId">@subject.User.Username</a>
|
||||
}
|
|
@ -12,25 +12,7 @@
|
|||
@foreach (Photo photo in Model.Photos)
|
||||
{
|
||||
<div class="ui segment">
|
||||
<img src="/gameAssets/@photo.LargeHash" style="width: 100%; height: auto; border-radius: .28571429rem;">
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<i>
|
||||
Taken by
|
||||
<b>
|
||||
<a href="/user/@photo.Creator!.UserId">@photo.Creator.Username</a>
|
||||
</b>
|
||||
</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Photo contains @photo.Subjects.Count @(photo.Subjects.Count == 1 ? "person" : "people"):</b>
|
||||
</p>
|
||||
@foreach (PhotoSubject subject in photo.Subjects)
|
||||
{
|
||||
<a href="/user/@subject.UserId">@subject.User.Username</a>
|
||||
}
|
||||
@await Html.PartialAsync("Partials/PhotoPartial", photo)
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = "Model.ProfileUser!.Username's user page";
|
||||
Model.Title = Model.ProfileUser!.Username + "'s user page";
|
||||
Model.ShowTitleInPage = false;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
<div class="eight wide column">
|
||||
<h1>@Model.Title</h1>
|
||||
<p>
|
||||
<i>@Model.ProfileUser.Status</i>
|
||||
<i>@Model.ProfileUser!.Status</i>
|
||||
</p>
|
||||
<div class="statsUnderTitle">
|
||||
<i class="pink heart icon" title="Hearts"></i> <span>@Model.ProfileUser.Hearts</span>
|
||||
|
@ -74,16 +74,7 @@
|
|||
@foreach (Photo photo in Model.Photos)
|
||||
{
|
||||
<div class="eight wide column">
|
||||
<img src="/gameAssets/@photo.LargeHash" style="width: 100%; height: auto; border-radius: .28571429rem;">
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<b>Photo contains @photo.Subjects.Count @(photo.Subjects.Count == 1 ? "person" : "people"):</b>
|
||||
</p>
|
||||
@foreach (PhotoSubject subject in photo.Subjects)
|
||||
{
|
||||
<a href="/user/@subject.UserId">@subject.User.Username</a>
|
||||
}
|
||||
@await Html.PartialAsync("Partials/PhotoPartial", photo);
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue