112 lines
3.9 KiB
HTML
112 lines
3.9 KiB
HTML
<div class="request-promotion-container">
|
|
<form #form="ngForm">
|
|
<h3>{{'request.promotion.headline' | translate}}</h3>
|
|
|
|
<div class="form-group">
|
|
<label for="user">{{'request.promotion.field.participant' | translate}}</label>
|
|
<select class="form-control"
|
|
name="user"
|
|
id="user"
|
|
[(ngModel)]="user"
|
|
[compareWith]="equals"
|
|
required
|
|
(change)="toggleUser()">
|
|
<option [ngValue]="{_id: '0'}">{{'request.promotion.field.participant.placeholder' | translate}}</option>
|
|
<option *ngFor="let user of users" [ngValue]="user">
|
|
{{user.username}}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div *ngIf="showForm">
|
|
|
|
<div class="form-group">
|
|
<label for="user">{{'request.promotion.field.rank.before' | translate}}</label>
|
|
<input class="form-control"
|
|
[(ngModel)]="selectedUserRank"
|
|
[ngModelOptions]="{standalone: true}"
|
|
readonly>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="decoration">{{'request.promotion.field.rank.after' | translate}}</label>
|
|
<select class="form-control"
|
|
name="decoration"
|
|
id="decoration"
|
|
#decorationField
|
|
[(ngModel)]="newLevel"
|
|
required>
|
|
<option *ngFor="let rank of ranks" [ngValue]="rank.level">
|
|
{{rank.name}}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button id="cancel"
|
|
(click)="cancel()"
|
|
class="btn btn-default">
|
|
{{'request.promotion.button.cancel' | translate}}
|
|
</button>
|
|
|
|
<button id="save"
|
|
*ngIf="showForm"
|
|
(click)="addPromotion()"
|
|
class="btn btn-default"
|
|
[disabled]="newLevel === user.rankLvl">
|
|
{{'request.promotion.button.submit' | translate}}
|
|
</button>
|
|
</form>
|
|
|
|
<div class="table-container">
|
|
<label>Beförderungsanträge</label>
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th class="col-sm-1">{{'request.promotion.table.head.participant' | translate}}</th>
|
|
<th class="col-sm-1">{{'request.promotion.table.head.rank.before' | translate}}</th>
|
|
<th class="col-sm-1">{{'request.promotion.table.head.rank.after' | translate}}</th>
|
|
<th class="col-sm-1 ">{{'request.promotion.table.head.requester' | translate}}</th>
|
|
<th class="col-sm-1 text-center">{{'request.promotion.table.head.date' | translate}}</th>
|
|
<th class="col-sm-1 text-center">{{'request.promotion.table.head.status' | translate}}</th>
|
|
<th class="col-sm-2 text-right">{{'request.promotion.table.head.reject.reason' | translate}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody *ngFor="let promotion of uncheckedPromotions">
|
|
<tr>
|
|
<td class="table-cell-id">
|
|
{{promotion.userId.username}}
|
|
</td>
|
|
<td *ngFor="let rank of (ranks | rankfilter: promotion.oldRankLvl)">
|
|
{{rank.name}}
|
|
</td>
|
|
<td *ngFor="let rank of (ranks | rankfilter: promotion.newRankLvl)">
|
|
{{rank.name}}
|
|
</td>
|
|
<td>
|
|
{{promotion.proposer.username}}
|
|
</td>
|
|
<td class="text-center">
|
|
{{promotion.timestamp | date: 'dd.MM.yyyy'}}
|
|
</td>
|
|
<td class="text-center">
|
|
<span *ngIf="promotion.confirmed === 0">
|
|
{{'request.confirm.promotion.table.status.progressing' | translate}}
|
|
</span>
|
|
<span *ngIf="promotion.confirmed === 1">
|
|
{{'request.confirm.promotion.table.status.accepted' | translate}}
|
|
</span>
|
|
<span *ngIf="promotion.confirmed !== 0 && promotion.confirmed !== 1">
|
|
{{'request.confirm.promotion.table.status.rejected' | translate}}
|
|
</span>
|
|
</td>
|
|
<td class="text-right">
|
|
<span *ngIf="promotion.rejectReason">{{promotion.rejectReason}}</span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|