<commit_before>﻿@model Blog.ViewModels.PageViewModel

<div class="text-center">
    <ul class="pagination">
        @{
            var currentPage = Model.PostsPerPage.PageIndex;
            var lastPage = Model.PostsPerPage.TotalPage;
            var frameSize = 5; // display 5 pages
            var startPage = currentPage - frameSize; //set start page 
            var endPage = currentPage + frameSize - 1; //set endpage

            if (startPage <= 0) //if we have less then 5 pages
            {
                startPage = 1; //set start page to 1
                endPage = endPage - (startPage - 1); // eval end page

            }

            if (endPage > lastPage) //if end page overcome last page
            {
                endPage = lastPage; // set end page to very last page
                if (endPage > frameSize)
                {
                    startPage = endPage - frameSize;

                }
            }
        }
        @if (currentPage > 1)
        {
            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@(currentPage - 1)">Previous</a></li>
        }
        @for (int i = startPage; i <= endPage; ++i)
        {

            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@i">@i</a></li>

        }
        @if (currentPage < lastPage)
        {
            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@(currentPage + 1)">Next</a></li>
        }
    </ul>
</div><commit_msg>Small changes<commit_after>﻿@model Blog.ViewModels.PageViewModel

@{
            var currentPage = Model.PostsPerPage.PageIndex;
            var lastPage = Model.PostsPerPage.TotalPage;
            var frameSize = 5; // display 5 pages
            var startPage = currentPage - frameSize; //set start page
            var endPage = currentPage + frameSize - 1; //set endpage

            if (startPage <= 0) //if we have less then 5 pages
            {
                startPage = 1; //set start page to 1
                endPage = endPage - (startPage - 1); // eval end page

            }

            if (endPage > lastPage) //if end page overcome last page
            {
                endPage = lastPage; // set end page to the very last page
                if (endPage > frameSize)
                {
                    startPage = endPage - frameSize;

                }
            }
}

<div class="text-center">
    <script src="~/js/pagination.js"></script>
    <ul class="pagination">
        @if (currentPage > 1)
        {
            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@(currentPage - 1)">Previous</a></li>
        }
        @for (int page = startPage; page <= endPage; ++page)
        {

            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@page">@page</a></li>

        }
        @if (currentPage < lastPage)
        {
            <li><a asp-controller="@ViewBag.Controller" asp-route-page="@(currentPage + 1)">Next</a></li>
        }
    </ul>
</div>
{'fraction_non_alphanumeric': 0.12894560107454667, 'fraction_numerical': 0.007387508394895903, 'mean_word_length': 1.5614789337919175, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5550906', 'n_tokens_mistral': 894, 'n_tokens_neox': 820, 'n_words': 215}