Skip to content

Commit

Permalink
remove always true condition
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Jan 8, 2024
1 parent fbcfaae commit 0914098
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/Moonglade.Web/Pages/Shared/_PostList.cshtml
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
@using Moonglade.Web.PagedList
@model BasePagedList<Moonglade.Core.PostFeature.PostDigest>

@if (Model.Count == 0)
@foreach (var item in Model)
{
<div class="alert alert-info">
@SharedLocalizer["No Posts Found"]
</div>
<div class="mb-4"></div>
<partial name="_PostListEntry" model="item" />
}
else
{
foreach (var item in Model)
{
<partial name="_PostListEntry" model="item" />
}

@Html.PagedListPager(Model, page => ViewData["sortBy"] == null ? $"?p={page}" : $"?p={page}&sortBy={ViewData["sortBy"]}", new()
{
UlElementClasses = new[] { "pagination justify-content-end" },
MaximumPageNumbersToDisplay = 5,
DisplayEllipsesWhenNotShowingAllPageNumbers = false
})
}
@Html.PagedListPager(Model, page => ViewData["sortBy"] == null ? $"?p={page}" : $"?p={page}&sortBy={ViewData["sortBy"]}", new()
{
UlElementClasses = new[] { "pagination justify-content-end" },
MaximumPageNumbersToDisplay = 5,
DisplayEllipsesWhenNotShowingAllPageNumbers = false
})

0 comments on commit 0914098

Please sign in to comment.