<!--文章管理-->

<div class="admin-content" id="article-manager">
    <div class="admin-content-body">
        <div>
            <div><strong class="part-title">文章管理</strong></div>
        </div>

        <div class="scrollable-horizontal" *ngIf="articleService.currentPage">
            <table class="table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>标题</th>
                    <th>发布日期</th>
                    <th>更新日期</th>
                    <th>阅读量</th>
                    <th title="(可见/不可见)勾选则可见，否则不可见">文章状态</th>
                    <th>管理</th>
                </tr>
                </thead>
                <tbody>
                <tr *ngFor="let article of articleService.currentPage.list">
                    <td>{{article.id}}</td>
                    <td><a [routerLink]="[ '/article']" [queryParams]="{'id':article.id}">{{article.title}}</a>
                    </td>
                    <td>{{article.publishDateFormat}}</td>
                    <td>{{article.updateDateFormat}}</td>
                    <td><span class="badge badge-success">{{article.readingNumber}}</span></td>
                    <td style="text-align: center">
                        <input type="checkbox" class="disabled" disabled [checked]="article.open"
                               [title]="article.open?'可见':'不可见'">
                    </td>
                    <td>
                        <a [href]="'../write?id='+article.id">
                            <i nz-icon nzType="edit" nzTheme="twotone" nzTwotoneColor="#52c41a"></i> 编辑
                        </a>
                        <nz-divider nzType="vertical"></nz-divider>
                        <a nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft" nzTrigger="click">
                            更多 <i nz-icon nzType="down" nzTheme="outline"></i>
                        </a>
                        <nz-dropdown-menu #menu="nzDropdownMenu">


                            <ul nz-menu nzSelectable>
                                <li nz-menu-item>
                                    <a [href]="'../article/'+article.id">
                                        <i nz-icon nzType="file" nzTheme="twotone" nzTwotoneColor="#3F66FF"></i> 查看
                                    </a>
                                </li>
                                <li nz-menu-item>
                                    <a nz-popconfirm [nzTitle]="'是否要删除'+article.title+'?'"
                                       (nzOnConfirm)="doDel(article.id)">
                                        <i nz-icon nzType="delete" nzTheme="twotone" nzTwotoneColor="#eb2f96"></i> 删除
                                    </a>
                                </li>
                            </ul>
                        </nz-dropdown-menu>
                    </td>
                </tr>
                </tbody>
            </table>

            <nz-pagination align="center" [nzHideOnSinglePage]="true" [nzPageIndex]="pageNum" [nzPageSize]="pageSize"
                           [nzTotal]="articleService.currentPage.total"
                           (nzPageIndexChange)="toPage($event)">
            </nz-pagination>

        </div>


    </div>
</div>
