2020-05-22 12:52:17 +02:00
|
|
|
<div class="header-addnew">
|
|
|
|
<h2>Samples</h2>
|
2020-06-19 08:43:22 +02:00
|
|
|
<a routerLink="/samples/new">
|
|
|
|
<button class="rb-btn rb-primary"><span class="rb-ic rb-ic-add"></span> New sample</button>
|
|
|
|
</a>
|
2020-05-22 12:52:17 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<rb-accordion>
|
2020-06-26 11:09:59 +02:00
|
|
|
<rb-accordion-title [open]="true"><span class="rb-ic rb-ic-filter"></span> Filter</rb-accordion-title>
|
2020-05-22 12:52:17 +02:00
|
|
|
<rb-accordion-body>
|
2020-06-26 11:09:59 +02:00
|
|
|
<form (change)="loadSamples({event: $event})">
|
|
|
|
<div class="status-selection">
|
|
|
|
<label class="label">Status</label>
|
|
|
|
<rb-form-checkbox name="status-validated" [(ngModel)]="filters.status.validated" [disabled]="!filters.status.new">
|
|
|
|
validated
|
|
|
|
</rb-form-checkbox>
|
|
|
|
<rb-form-checkbox name="status-new" [(ngModel)]="filters.status.new" [disabled]="!filters.status.validated">
|
|
|
|
new
|
|
|
|
</rb-form-checkbox>
|
|
|
|
</div>
|
|
|
|
<rb-form-select name="pageSizeSelection" label="page size" [(ngModel)]="filters.pageSize" class="page-size-selection" #pageSizeSelection>
|
|
|
|
<option value="10">10</option>
|
|
|
|
<option value="25">25</option>
|
|
|
|
<option value="50">50</option>
|
|
|
|
<option value="100">100</option>
|
|
|
|
<option value="250">250</option>
|
|
|
|
<option value="500">500</option>
|
2020-06-19 08:43:22 +02:00
|
|
|
</rb-form-select>
|
|
|
|
|
2020-06-26 11:09:59 +02:00
|
|
|
<!-- <button class="rb-btn rb-secondary" (click)="loadSamples()">Apply filters</button>-->
|
2020-06-19 08:43:22 +02:00
|
|
|
</form>
|
2020-05-22 12:52:17 +02:00
|
|
|
</rb-accordion-body>
|
|
|
|
</rb-accordion>
|
|
|
|
|
2020-06-26 11:09:59 +02:00
|
|
|
<ng-container *ngTemplateOutlet="paging"></ng-container>
|
|
|
|
|
2020-05-22 12:52:17 +02:00
|
|
|
<rb-table>
|
|
|
|
<tr>
|
2020-06-26 11:09:59 +02:00
|
|
|
<th *ngFor="let key of activeKeys">
|
|
|
|
<div class="sort-header">
|
|
|
|
<span>{{key.name}}</span>
|
|
|
|
<span class="rb-ic rb-ic-up" [ngClass]="{'sort-active-desc': filters.sort === key.key + '-' + 'desc'}" (click)="setSort(key.key + '-' + 'desc')"></span>
|
|
|
|
<span class="rb-ic rb-ic-down" [ngClass]="{'sort-active-asc': filters.sort === key.key + '-' + 'asc'}" (click)="setSort(key.key + '-' + 'asc')"></span>
|
|
|
|
</div>
|
|
|
|
</th>
|
2020-06-19 08:43:22 +02:00
|
|
|
<th></th>
|
2020-05-22 12:52:17 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr *ngFor="let sample of samples">
|
|
|
|
<td>{{sample.number}}</td>
|
2020-06-26 11:09:59 +02:00
|
|
|
<!-- <td>{{sample.material_number}}</td>-->
|
2020-05-22 12:52:17 +02:00
|
|
|
<td>{{materials[sample.material_id].name}}</td>
|
|
|
|
<td>{{materials[sample.material_id].supplier}}</td>
|
2020-06-26 11:09:59 +02:00
|
|
|
<!-- <td>{{materials[sample.material_id].group}}</td>-->
|
|
|
|
<!-- <td>{{materials[sample.material_id].glass_fiber}}</td>-->
|
|
|
|
<!-- <td>{{materials[sample.material_id].carbon_fiber}}</td>-->
|
|
|
|
<!-- <td>{{materials[sample.material_id].mineral}}</td>-->
|
2020-05-22 12:52:17 +02:00
|
|
|
<td>{{sample.type}}</td>
|
|
|
|
<td>{{sample.color}}</td>
|
|
|
|
<td>{{sample.batch}}</td>
|
2020-06-26 11:09:59 +02:00
|
|
|
<td>{{sample.added | date}}</td>
|
2020-06-19 08:43:22 +02:00
|
|
|
<td><a [routerLink]="'/samples/edit/' + sample._id"><span class="rb-ic rb-ic-edit"></span></a></td>
|
2020-05-22 12:52:17 +02:00
|
|
|
</tr>
|
|
|
|
</rb-table>
|
2020-06-26 11:09:59 +02:00
|
|
|
|
|
|
|
<ng-container *ngTemplateOutlet="paging"></ng-container>
|
|
|
|
|
|
|
|
<ng-template #paging>
|
|
|
|
<div class="paging">
|
|
|
|
<button class="rb-btn rb-link" type="button" (click)="loadPage(-1)" [disabled]="page === 1">
|
|
|
|
<span class="rb-ic rb-ic-back-left"></span>
|
|
|
|
</button>
|
|
|
|
<rb-form-input label="page" (change)="loadPage({toPage: $event.target.value - page})" [ngModel]="page"></rb-form-input>
|
|
|
|
<span>
|
|
|
|
of {{pages()}}
|
|
|
|
</span>
|
|
|
|
<button class="rb-btn rb-link" type="button" (click)="loadPage(1)" [disabled]="page >= pages()">
|
|
|
|
<span class="rb-ic rb-ic-forward-right"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</ng-template>
|
|
|
|
|