indicators-and-curriculum.component.html 5.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<ng-container *ngIf="!editTab">
    <div class="w-full min-height-50px mb-10px justify-between items-center">
        <div class="flex justify-end">
            <div class="px-1">
                <div class="relative shadow-md">
                    <input type="text" id="hs-leading-icon" name="hs-leading-icon"
                        class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
                        [(ngModel)]="search" (ngModelChange)="searchChange()">
                    <div
                        class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
                        <i class="ri-search-line text-gray"></i>
                    </div>
                </div>
            </div>
            <div class="px-1">
16
                <button type="button" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
17 18 19 20 21 22 23 24 25 26 27 28
                    <i class="ti ti-book fs-l"></i>
                    Help
                </button>
            </div>
        </div>
    </div>
    <div class="page px-rem">
        <div class="overflow-auto rounded-top-0.65rem">
            <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
                <thead class="height-50px">
                    <tr class="font-size-12px">
                        <ng-container
29
                            *ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเมิน','การจัดการ']; let f = first; let l = last">
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
                            <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
                                [class.!text-center]="f||l">
                                <span class="font-size-12px font-weight-700">{{ item }}</span>
                                <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
                                    <i class="ti ti-dots-vertical fs-l"></i>
                                </div>
                            </th>
                        </ng-container>
                    </tr>
                </thead>
                <tbody *ngIf="!dataListFilter().length">
                    <tr>
                        <td class="text-center" colspan="100%">
                            ไม่พบข้อมูล
                        </td>
                    </tr>
                </tbody>
                <tbody *ngIf="dataListFilter().length">
                    <tr
                        *ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
                        <td class="flex justify-center">
                            {{item.code}}
                        </td>
                        <td>{{item.name}}</td>
                        <td>{{item.type}}</td>
                        <td class="flex justify-center">
56 57
                            <i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
                                (click)="editTab=true;pathTitleChange()"></i>
58 59 60 61 62 63 64 65 66
                            <i class="ti ti-file-download cursor-pointer i-gray fs-l px-1"></i>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
            <ul class="ti-pagination">
                <li>
67
                    <a aria-label="anchor" class="page-link !pl-0" href="javascript:void(0);"
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
                        (click)="currentPage = (currentPage-1 || 1)">
                        <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
                <li *ngFor="let item of page;let f = first;let l = last">
                    <ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
                        <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                        </a>
                    </ng-container>
                    <ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
                        <a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
                            (click)="currentPage=item">{{item}}
                        </a>
                    </ng-container>
                    <ng-container
                        *ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
                        <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                        </a>
                    </ng-container>
                </li>
                <li>
                    <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                        (click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
                        <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
            </ul>
95 96 97 98 99
            <ul class="nav-tabs mt-3">
                <span>Show {{((currentPage-1) * 10)+1}} to {{dataListFilter().length<10 ?dataListFilter().length:
                        (currentPage==page.length ? ((currentPage * 10) - ((currentPage * 10) - dataListFilter().length)
                        ) :(currentPage * 10) ) }} of {{dataListFilter().length}} items</span>
            </ul>
100 101 102 103 104 105 106
        </nav>
    </div>
</ng-container>


<ng-container *ngIf="editTab">
    <app-edit-group-indicators (sendEdit)="editTab=$event;pathTitleChange()"></app-edit-group-indicators>
107
</ng-container>