All files / src/app/components/campaigns campaigns.component.html

100% Statements 40/40
100% Branches 0/0
100% Functions 0/0
100% Lines 19/19

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2610x   364x   364x 116x     9x 9x 9x 9x 9x   9x 196x 406x 406x 406x 14x 14x   9x 232x 9x  
<h1 class="title">Campaigns</h1>
 
<app-loader *ngIf="!campaigns"></app-loader>
 
<div class="container" *ngIf="campaigns">
    <p-table [value]="campaigns" [paginator]="true" [rows]="10" [rowsPerPageOptions]="[10, 20, 50]" [showCurrentPageReport]="true" currentPageReportTemplate="{first} - {last} of {totalRecords} campaigns" [rowHover]="true">
        <ng-template pTemplate="header">
            <tr>
                <th pSortableColumn="campaign_id">id</th>
                <th pSortableColumn="name">Campaign name</th>
                <th >Campaign description</th>
                <th pSortableColumn="phaseCount">Number of phases</th>
            </tr>
        </ng-template>
        <ng-template pTemplate="body" let-campaign let-i="rowIndex">
            <tr [routerLink]="['/campaigns/', campaign.id]">
                <td>{{ campaign.id.substr(campaign.id.length - 4) }}</td>
                <td>{{ campaign.name }}</td>
                <td>{{ campaign.description }}</td>
                <td></td>
            </tr>
        </ng-template>
    </p-table>
    <button class="button is-rounded" [routerLink]="['/campaigns/new']" id="addCampaign">Add new campaign</button>
</div>