{{define "Next/article-list"}}
{{if eq (len .Articles) 0}}
{{.I18n.NoData}}
{{end}}
{{range .Articles}}
<article class="article__item">
    <header class="article__header">
        <h2>
            <a class="article__title" rel="bookmark" href="{{.URL}}">
                {{if .Topped}}
                <svg>
                    <use xlink:href="#icon-focus"></use>
                </svg>
                {{end}}
                {{.Title}}
            </a>
        </h2>
        <div class="article__meta">
            {{if gt $.UserCount 1}}
            <a rel="nofollow"
               class="avatar pipe-tooltipped pipe-tooltipped--n"
               aria-label="{{.Author.Name}}"
               data-src="{{.Author.AvatarURLWithSize 116}}"
               href="{{.Author.URL}}">
            </a>
            {{end}}
            <time>{{.CreatedAt}}</time> &nbsp;
            |  &nbsp;
            <a href="{{.URL}}">{{.ViewCount}}</a> {{$.I18n.View}}
            {{if gt .CommentCount 0}}
            &nbsp; |  &nbsp;
            <a href="{{.URL}}#pipeComments">{{.CommentCount}}</a> {{$.I18n.Comment}}
            {{end}}
        </div>
    </header>
    {{if .ThumbnailURL}}
    <a class="article__thumb"
       href="{{.URL}}"
       data-src="{{.ThumbnailURL}}"></a>
    {{end}}
    {{if .Abstract}}
    <section
            data-link="{{.URL}}"
            class="pipe-content__reset"
            data-author="{{.Author.Name}}">
        {{.Abstract}}
    </section>
    {{end}}
    <div class="fn-clear article__footer">
        <a href="{{.URL}}" class="fn-left article__read">
            {{$.I18n.ReadMore}}  »
        </a>
        {{if .Editable}}
        <a href="{{$.Conf.Server}}/admin/articles/post?id={{.ID}}"
           aria-label="{{$.I18n.Edit}}"
           class="pipe-tooltipped pipe-tooltipped--n fn-right article__edit">
            <svg>
                <use xlink:href="#icon-edit"></use>
            </svg>
        </a>
        {{end}}
    </div>
</article>
{{end}}

{{if gt (len $.Pagination.PageNums) 1}}
<nav class="pagination fn-clear">
    {{if gt $.Pagination.PreviousPageNum 0}}
    <a class="pagination__item" href="?p={{$.Pagination.PreviousPageNum}}">«</a>
    {{end}}
    {{if gt $.Pagination.FirstPageNum 1}}
    <a class="pagination__item" href="?p=1">1</a>{{if ne $.Pagination.FirstPageNum 2}}<span
        class="pagination__item pagination__omit">...</span>{{end}}
    {{end}}
    {{range $.Pagination.PageNums}}
    {{if eq . $.Pagination.CurrentPageNum}}
    <span class="pagination__item pagination__item--active">{{.}}</span>
    {{else}}
    <a href="?p={{.}}" class="pagination__item {{if eq . $.Pagination.CurrentPageNum}}pagination__item--active{{end}}">{{.}}</a>
    {{end}}
    {{end}}
    {{if lt $.Pagination.LastPageNum $.Pagination.PageCount}}
    {{if ne $.Pagination.LastPageNum (minus $.Pagination.PageCount 1)}}<span class="pagination__item pagination__omit">...</span>{{end}}
    <a class="pagination__item" href="?p={{$.Pagination.PageCount}}">{{$.Pagination.PageCount}}</a>
    {{end}}
    {{if lt $.Pagination.CurrentPageNum $.Pagination.PageCount}}
    <a class="pagination__item" href="?p={{$.Pagination.NextPageNum}}">»</a>
    {{end}}
</nav>
{{end}}

{{end}}