Merge branch 'release' into 'master'
Release See merge request yescent/yes.blog!40
This commit is contained in:
@@ -70,6 +70,14 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if Model.Comments.HasPreviousPage %}
|
||||||
|
<a class="enabled current" href="?page={{ Model.Comments.PreviousPage }}">上一页</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if Model.Comments.HasNextPage %}
|
||||||
|
<a class="enabled current" href="?page={{ Model.Comments.NextPage }}">下一页</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
public record PagedList<T>(List<T> Items, int PageIndex, int PageSize, int TotalItems)
|
public record PagedList<T>(List<T> Items, int PageIndex, int PageSize, int TotalItems)
|
||||||
{
|
{
|
||||||
public bool HasNextPage => PageIndex * PageSize < TotalItems;
|
public bool HasNextPage => PageIndex * PageSize < TotalItems;
|
||||||
|
public int NextPage => PageIndex + 1;
|
||||||
|
public int PreviousPage => PageIndex - 1;
|
||||||
|
|
||||||
public bool HasPreviousPage => PageIndex > 1;
|
public bool HasPreviousPage => PageIndex > 1;
|
||||||
|
|
||||||
public int TotalPage => (int)Math.Ceiling((double)TotalItems / PageSize);
|
public int TotalPage => (int)Math.Ceiling((double)TotalItems / PageSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user