mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 18:18:39 +00:00
Proper ordering, change trending levels to newest levels
This commit is contained in:
parent
d2b5eaa612
commit
75254ad6eb
2 changed files with 9 additions and 12 deletions
|
@ -45,10 +45,12 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
<div class="@(isMobile ? "" : "ui center aligned grid")">
|
<div class="@(isMobile ? "" : "ui center aligned grid")">
|
||||||
<div class="eight wide column">
|
<div class="eight wide column">
|
||||||
<div class="ui pink segment">
|
<div class="ui pink segment">
|
||||||
<h1>Latest Team Picks</h1>
|
<h1><i class="ribbon icon"></i>Latest Team Picks</h1>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<div class="ui left aligned segment">
|
<div class="ui left aligned segment">
|
||||||
@foreach (Slot slot in Model.LatestTeamPicks)
|
@foreach (Slot slot in Model.LatestTeamPicks)
|
||||||
|
@ -64,11 +66,11 @@ else
|
||||||
<br>
|
<br>
|
||||||
}
|
}
|
||||||
<div class="eight wide column">
|
<div class="eight wide column">
|
||||||
<div class="ui orange segment">
|
<div class="ui blue segment">
|
||||||
<h1>Trending Levels</h1>
|
<h1><i class="certificate icon"></i>Newest Levels</h1>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<div class="ui left aligned segment">
|
<div class="ui left aligned segment">
|
||||||
@foreach (Slot slot in Model.TrendingLevels)
|
@foreach (Slot slot in Model.NewestLevels)
|
||||||
{
|
{
|
||||||
@await Html.PartialAsync("Partials/SlotCardPartial", slot, Model.GetSlotViewData(slot.SlotId, isMobile))
|
@await Html.PartialAsync("Partials/SlotCardPartial", slot, Model.GetSlotViewData(slot.SlotId, isMobile))
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class LandingPage : BaseLayout
|
||||||
public int PlayersOnlineCount;
|
public int PlayersOnlineCount;
|
||||||
|
|
||||||
public List<Slot> LatestTeamPicks;
|
public List<Slot> LatestTeamPicks;
|
||||||
public List<Slot> TrendingLevels;
|
public List<Slot> NewestLevels;
|
||||||
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public async Task<IActionResult> OnGet()
|
public async Task<IActionResult> OnGet()
|
||||||
|
@ -47,17 +47,12 @@ public class LandingPage : BaseLayout
|
||||||
|
|
||||||
this.LatestTeamPicks = await this.Database.Slots.Where
|
this.LatestTeamPicks = await this.Database.Slots.Where
|
||||||
(s => s.TeamPick)
|
(s => s.TeamPick)
|
||||||
.OrderBy(s => s.FirstUploaded)
|
.OrderByDescending(s => s.FirstUploaded)
|
||||||
.Take(maxShownLevels)
|
.Take(maxShownLevels)
|
||||||
.Include(s => s.Creator)
|
.Include(s => s.Creator)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
this.TrendingLevels = await this.Database.Slots.OrderByDescending
|
this.NewestLevels = await this.Database.Slots.OrderByDescending(s => s.FirstUploaded).Take(maxShownLevels).Include(s => s.Creator).ToListAsync();
|
||||||
(s => s.PlaysLBP1Unique + s.PlaysLBP2Unique + s.PlaysLBP3Unique + s.PlaysLBPVitaUnique)
|
|
||||||
.ThenBy(s => s.FirstUploaded)
|
|
||||||
.Take(maxShownLevels)
|
|
||||||
.Include(s => s.Creator)
|
|
||||||
.ToListAsync();
|
|
||||||
|
|
||||||
return this.Page();
|
return this.Page();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue