srumboard_frontend/src/app/task-table/task-table.component.html

114 lines
4.7 KiB
HTML

<div class="mx-5 my-3">
<h3 class="my-1">
<a *ngIf="filterUserstoryId" [routerLink]="['/userstories', {id: filterUserstoryId}]">
Userstory #{{filterUserstoryId}}
&gt;
</a>
Tasks
</h3>
<div *ngIf="filterUserstoryId">
<a [routerLink]="'/tasks'">Alle Tasks anzeigen</a>
</div>
<button class="btn btn-secondary my-3" (click)="openTaskForm()">Neuer Task</button>
<table class="table">
<thead>
<tr>
<th (click)="sortById()" class="sortable">
<span>ID</span>
<span *ngIf="sortBy === 'id'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByTitle()" class="sortable">
<span>Titel</span>
<span *ngIf="sortBy === 'title'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByTasks()" class="sortable">
<span>Userstory</span>
<span *ngIf="sortBy === 'userstory'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByStatus()" class="sortable">
<span>Status</span>
<span *ngIf="sortBy === 'statusid'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByPrio()" class="sortable">
<span>Priorität</span>
<label class="pl-3" (click)="$event.stopPropagation()">
<select [(ngModel)]="filterPriority">
<option [ngValue]="null" selected="selected"></option>
<option *ngFor="let p of getAllPriorities()" [ngValue]="p">{{p}}</option>
</select>
</label>
<span *ngIf="sortBy === 'priority'" (click)="sortByPrio()" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByAssigned()" class="sortable">
<span>Assigned To</span>
<span *ngIf="sortBy === 'assignedtoid'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th (click)="sortByCategory()" class="sortable">
<span>Category</span>
<span *ngIf="sortBy === 'categoryid'" class="pl-3">
<span *ngIf="sortDescending"></span>
<span *ngIf="sortDescending === false"></span>
</span>
</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let task of filteredItems" [class.table-info]="task.id === highlightId">
<td>{{task.id}}</td>
<td>{{task.title}}</td>
<td>
<a [routerLink]="['/userstories', {id: task.userstoryid}]">
US #{{task.userstoryid}}
</a>
</td>
<td>
<a [routerLink]="['/status', {id: task.statusid}]">
{{getStatusTitleById(task.statusid)}}
</a>
</td>
<td>{{task.priority}}</td>
<td>
<a [routerLink]="['/users', {id: task.assignedtoid}]">
{{getUserNameById(task.assignedtoid)}}
</a>
</td>
<td>
<a [routerLink]="['/categories', {id: task.categoryid}]">
{{getCategoryTitleById(task.categoryid)}}
</a>
</td>
<td>
<button class="btn btn-secondary m-2" (click)="openTaskForm(task)">Bearbeiten</button>
<button class="btn btn-secondary m-2" (click)="deleteTask(task)">Löschen</button>
</td>
</tr>
</tbody>
</table>
</div>