<!--标签-->
<div class="admin-content" id="tag-manager">
    <div class="admin-content-body">
        <div>
            <div><strong class="part-title">标签管理</strong></div>
        </div>

        <div class="g">
            <div class="scrollable-horizontal" *ngIf="tagService.currentTagPage">
                <table class="table">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>标签名称</th>
                        <th>标签文章</th>
                        <th>文章数目</th>
                        <th>管理</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr *ngFor="let tag of tagService.currentTagPage.list">
                        <td>{{tag.id}}</td>
                        <td class="text-truncate" style="max-width: 150px" [title]="tag.name">{{tag.name}}</td>
                        <td>{{tag.articles}}</td>
                        <td><span class="badge badge-success">{{tag.articles.length}}</span></td>
                        <td>

                            <a [href]="'../tag?name='+tag.name">
                                <i nz-icon nzType="tag" nzTheme="twotone"></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 (click)="edit(tag.id,tag.name)">编辑</a>
                                    </li>
                                    <li nz-menu-item>
                                        <a nz-popconfirm nzTitle="是否要删除这条标签?" (nzOnConfirm)="doDel(tag.id)">删除</a>
                                    </li>
                                </ul>
                            </nz-dropdown-menu>

                        </td>
                    </tr>

                    </tbody>
                </table>
                <nz-pagination align="center" [nzPageIndex]="pageNum" [nzHideOnSinglePage]="true"
                               [nzTotal]="tagService.currentTagPage.total" [nzPageSize]="pageSize"
                               (nzPageIndexChange)="toPage($event)"></nz-pagination>
            </div>
        </div>


    </div>

</div>


<!-- 带输入框的弹出层 -->

<nz-modal [(nzVisible)]="showPupup" nzTitle="编辑" (nzOnCancel)="showPupup=!showPupup" (nzOnOk)="update()">
    <input class="select" style="width: 80%;margin-left: 10%" [(ngModel)]="updateReqBody.name">
</nz-modal>
