2018-11-29 17:36:22 +01:00
|
|
|
<os-head-bar plusButton="true" (plusButtonClicked)="onPlusButton()" [multiSelectMode]="isMultiSelect">
|
2018-10-05 16:34:08 +02:00
|
|
|
<!-- Title -->
|
2018-11-29 17:36:22 +01:00
|
|
|
<div class="title-slot"><h2 translate>Elections</h2></div>
|
2018-10-05 16:34:08 +02:00
|
|
|
<!-- Menu -->
|
|
|
|
<div class="menu-slot">
|
|
|
|
<button type="button" mat-icon-button [matMenuTriggerFor]="assignmentMenu">
|
|
|
|
<mat-icon>more_vert</mat-icon>
|
|
|
|
</button>
|
|
|
|
</div>
|
2018-11-05 17:40:32 +01:00
|
|
|
|
|
|
|
<!-- Multiselect info -->
|
|
|
|
<div class="central-info-slot">
|
2018-11-29 17:36:22 +01:00
|
|
|
<button mat-icon-button (click)="toggleMultiSelect()"><mat-icon>arrow_back</mat-icon></button>
|
2018-11-05 17:40:32 +01:00
|
|
|
<span>{{ selectedRows.length }} </span><span translate>selected</span>
|
|
|
|
</div>
|
2018-09-11 16:38:23 +02:00
|
|
|
</os-head-bar>
|
2018-07-31 15:46:55 +02:00
|
|
|
|
2018-10-22 16:44:18 +02:00
|
|
|
<mat-drawer-container class="on-transition-fade">
|
2019-01-29 12:11:11 +01:00
|
|
|
<os-sort-filter-bar [filterCount]="filteredCount" [filterService]="filterService" [sortService]="sortService"
|
2018-10-22 16:44:18 +02:00
|
|
|
(searchFieldChange)="searchFilter($event)">
|
|
|
|
</os-sort-filter-bar>
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-table class="os-listview-table on-transition-fade" [dataSource]="dataSource" matSort>
|
2018-12-12 16:14:21 +01:00
|
|
|
<!-- slector column -->
|
2018-11-05 17:40:32 +01:00
|
|
|
<ng-container matColumnDef="selector">
|
2019-01-10 15:06:10 +01:00
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header class="icon-cell"></mat-header-cell>
|
|
|
|
<mat-cell *matCellDef="let assignment" class="icon-cell">
|
2018-11-05 17:40:32 +01:00
|
|
|
<mat-icon>{{ isSelected(assignment) ? 'check_circle' : '' }}</mat-icon>
|
|
|
|
</mat-cell>
|
|
|
|
</ng-container>
|
2018-09-11 16:38:23 +02:00
|
|
|
<!-- name column -->
|
|
|
|
<ng-container matColumnDef="title">
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Title</mat-header-cell>
|
|
|
|
<mat-cell *matCellDef="let assignment">{{ assignment.getTitle() }}</mat-cell>
|
2018-09-11 16:38:23 +02:00
|
|
|
</ng-container>
|
2018-12-12 16:14:21 +01:00
|
|
|
<!-- pahse column-->
|
2018-09-11 16:38:23 +02:00
|
|
|
<ng-container matColumnDef="phase">
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Phase</mat-header-cell>
|
2018-09-11 16:38:23 +02:00
|
|
|
<mat-cell *matCellDef="let assignment">
|
|
|
|
<mat-chip-list>
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-chip color="primary" selected>{{ assignment.phase }}</mat-chip>
|
2018-09-11 16:38:23 +02:00
|
|
|
</mat-chip-list>
|
|
|
|
</mat-cell>
|
2018-12-12 16:14:21 +01:00
|
|
|
<button mat-menu-item (click)="selectAll()">
|
|
|
|
<mat-icon>done_all</mat-icon>
|
|
|
|
<span translate>Select all</span>
|
|
|
|
</button>
|
|
|
|
<button mat-menu-item (click)="deselectAll()">
|
|
|
|
<mat-icon>clear</mat-icon>
|
|
|
|
<span translate>Deselect all</span>
|
|
|
|
</button>
|
2018-09-11 16:38:23 +02:00
|
|
|
</ng-container>
|
2018-12-12 16:14:21 +01:00
|
|
|
<!-- candidates column -->
|
2018-09-11 16:38:23 +02:00
|
|
|
<ng-container matColumnDef="candidates">
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Candidates</mat-header-cell>
|
2018-09-11 16:38:23 +02:00
|
|
|
<mat-cell *matCellDef="let assignment">
|
|
|
|
<mat-chip-list>
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-chip color="accent" selected>{{ assignment.candidateAmount }}</mat-chip>
|
2018-09-11 16:38:23 +02:00
|
|
|
</mat-chip-list>
|
|
|
|
</mat-cell>
|
|
|
|
</ng-container>
|
2018-08-28 13:54:25 +02:00
|
|
|
|
2018-11-05 17:40:32 +01:00
|
|
|
<mat-header-row *matHeaderRowDef="getColumnDefintion()"></mat-header-row>
|
2018-11-29 17:36:22 +01:00
|
|
|
<mat-row
|
|
|
|
[ngClass]="selectedRows.indexOf(row) >= 0 ? 'selected' : ''"
|
|
|
|
(click)="selectItem(row, $event)"
|
|
|
|
*matRowDef="let row; columns: getColumnDefintion()"
|
|
|
|
>
|
2018-11-05 17:40:32 +01:00
|
|
|
</mat-row>
|
2018-09-11 16:38:23 +02:00
|
|
|
</mat-table>
|
2018-07-31 15:46:55 +02:00
|
|
|
|
2018-09-11 16:38:23 +02:00
|
|
|
<mat-paginator class="on-transition-fade" [pageSizeOptions]="[25, 50, 75, 100, 125]"></mat-paginator>
|
2018-10-05 16:34:08 +02:00
|
|
|
|
|
|
|
<mat-menu #assignmentMenu="matMenu">
|
2018-11-05 17:40:32 +01:00
|
|
|
<div *ngIf="!isMultiSelect">
|
|
|
|
<button mat-menu-item *osPerms="'assignment.can_manage'" (click)="toggleMultiSelect()">
|
|
|
|
<mat-icon>library_add</mat-icon>
|
2018-11-27 22:44:37 +01:00
|
|
|
<span translate>Multiselect</span>
|
2018-11-05 17:40:32 +01:00
|
|
|
</button>
|
|
|
|
<button mat-menu-item (click)="downloadAssignmentButton()">
|
|
|
|
<mat-icon>archive</mat-icon>
|
|
|
|
<span translate>Export ...</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div *ngIf="isMultiSelect">
|
2018-12-12 16:14:21 +01:00
|
|
|
<button mat-menu-item (click)="selectAll()">
|
|
|
|
<mat-icon>done_all</mat-icon>
|
|
|
|
<span translate>Select all</span>
|
|
|
|
</button>
|
2018-11-27 22:44:37 +01:00
|
|
|
<mat-divider></mat-divider>
|
|
|
|
<button mat-menu-item class="red-warning-text" *osPerms="'assignment.can_manage'" (click)="deleteSelected()">
|
2018-11-05 17:40:32 +01:00
|
|
|
<mat-icon>delete</mat-icon>
|
2018-11-30 10:23:09 +01:00
|
|
|
<span translate>Delete</span>
|
2018-11-05 17:40:32 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
2018-10-05 16:34:08 +02:00
|
|
|
</mat-menu>
|
2018-10-22 16:44:18 +02:00
|
|
|
</mat-drawer-container>
|