2017-06-09 18:30:35 +02:00
|
|
|
<form #form="ngForm" class="overview">
|
2018-10-04 13:06:14 +02:00
|
|
|
<h3>{{'request.award.headline' | translate}}</h3>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
|
|
|
<div class="form-group">
|
2018-10-04 13:06:14 +02:00
|
|
|
<label for="user">{{'request.award.field.user' | translate}}</label>
|
2017-06-09 18:30:35 +02:00
|
|
|
<select class="form-control"
|
|
|
|
name="user"
|
|
|
|
id="user"
|
|
|
|
[(ngModel)]="user"
|
|
|
|
[compareWith]="equals"
|
2017-08-05 00:05:47 +02:00
|
|
|
(change)="toggleUser()"
|
2017-06-10 13:16:15 +02:00
|
|
|
required>
|
2018-10-04 13:06:14 +02:00
|
|
|
<option [ngValue]="{_id: '0'}">{{'request.award.field.user.placeholder' | translate}}</option>
|
2017-06-09 18:30:35 +02:00
|
|
|
<option *ngFor="let user of users" [ngValue]="user">
|
|
|
|
{{user.username}}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
2017-08-05 00:05:47 +02:00
|
|
|
<div class="form-group">
|
2018-10-04 13:06:14 +02:00
|
|
|
<label for="decoration">{{'request.award.field.award' | translate}}</label>
|
2017-06-10 13:16:15 +02:00
|
|
|
<select class="form-control"
|
|
|
|
name="decoration"
|
|
|
|
id="decoration"
|
|
|
|
[(ngModel)]="decoration"
|
2017-08-05 00:05:47 +02:00
|
|
|
[compareWith]="equals"
|
2017-06-10 13:16:15 +02:00
|
|
|
(change)="toggleDecoPreview(decoDescription, decoPreview)"
|
|
|
|
required>
|
2018-10-04 13:06:14 +02:00
|
|
|
<option [ngValue]="{_id: '0'}">{{'request.award.field.award.placeholder' | translate}}</option>
|
2017-06-10 13:16:15 +02:00
|
|
|
<option *ngFor="let deco of decorations" [ngValue]="deco">
|
2017-07-23 08:46:54 +02:00
|
|
|
{{deco.name}}
|
2017-06-10 13:16:15 +02:00
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-06-10 13:16:15 +02:00
|
|
|
<div class="div-table-row" [style.display]="decoPreviewDisplay" style="margin-top: 5px; margin-bottom:10px">
|
|
|
|
<div class="col-sm-1 decoration-preview">
|
|
|
|
<img class="center-block" #decoPreview>
|
2017-06-09 18:30:35 +02:00
|
|
|
</div>
|
2017-06-10 13:16:15 +02:00
|
|
|
<div class="col-sm-2"
|
|
|
|
style="border-radius: 0px 15px 15px 0px; font-style: oblique" #decoDescription>
|
|
|
|
|
2017-06-09 18:30:35 +02:00
|
|
|
</div>
|
2017-06-10 13:16:15 +02:00
|
|
|
</div>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-08-05 00:05:47 +02:00
|
|
|
<div class="form-group">
|
2018-10-04 13:06:14 +02:00
|
|
|
<label for="reason">{{'request.award.field.reason' | translate}}</label>
|
2017-06-10 13:16:15 +02:00
|
|
|
<textarea class="form-control center-block" name="reason" [(ngModel)]="reason" required
|
2018-10-04 13:06:14 +02:00
|
|
|
id="reason" placeholder="{{'request.award.field.reason.placeholder' | translate}}" rows="3"></textarea>
|
2017-06-10 13:16:15 +02:00
|
|
|
</div>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-06-10 13:16:15 +02:00
|
|
|
<button id="cancel"
|
|
|
|
(click)="cancel()"
|
|
|
|
class="btn btn-default">
|
2018-10-04 13:06:14 +02:00
|
|
|
{{'request.award.button.cancel' | translate}}
|
2017-06-10 13:16:15 +02:00
|
|
|
</button>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-06-10 13:16:15 +02:00
|
|
|
<button id="save"
|
|
|
|
(click)="addAwarding(decoPreview, decoDescription)"
|
|
|
|
class="btn btn-default"
|
2017-08-05 00:05:47 +02:00
|
|
|
[disabled]="!form.valid || user._id === '0' || decoration._id === '0'">
|
2018-10-04 13:06:14 +02:00
|
|
|
{{'request.award.button.submit' | translate}}
|
2017-06-10 13:16:15 +02:00
|
|
|
</button>
|
2017-06-09 18:30:35 +02:00
|
|
|
|
2017-06-10 13:16:15 +02:00
|
|
|
<div class="table-container" *ngIf="showForm">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-10-04 13:06:14 +02:00
|
|
|
<th class="col-sm-1">{{'request.award.table.head.image' | translate}}</th>
|
|
|
|
<th class="col-sm-2">{{'request.award.table.head.name' | translate}}</th>
|
|
|
|
<th class="col-sm-2">{{'request.award.table.head.reason' | translate}}</th>
|
|
|
|
<th class="col-sm-1 ">{{'request.award.table.head.requester' | translate}}</th>
|
|
|
|
<th class="col-sm-1 text-right">{{'request.award.table.head.date' | translate}}</th>
|
|
|
|
<th class="col-sm-1 text-center">{{'request.award.table.head.status' | translate}}</th>
|
|
|
|
<th class="col-sm-2 text-right">{{'request.award.table.head.reject.reason' | translate}}</th>
|
2017-06-10 13:16:15 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody *ngFor="let award of awards">
|
|
|
|
<tr>
|
|
|
|
<td class="table-cell-id" *ngIf="award.decorationId.isMedal">
|
|
|
|
<img height="40px" src="resource/decoration/{{award.decorationId._id}}.png">
|
|
|
|
</td>
|
|
|
|
<td class="table-cell-id" *ngIf="!award.decorationId.isMedal">
|
|
|
|
<img width="60px" src="resource/decoration/{{award.decorationId._id}}.png">
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{award.decorationId.name}}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{award.reason}}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{award.proposer?.username}}
|
|
|
|
</td>
|
|
|
|
<td class="text-right">
|
2017-06-10 22:07:32 +02:00
|
|
|
{{award.date | date: 'dd.MM.yyyy'}}
|
2017-06-10 13:16:15 +02:00
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
2018-10-04 13:06:14 +02:00
|
|
|
<span *ngIf="award.confirmed === 0">
|
|
|
|
{{'request.award.table.status.progressing' | translate}}
|
|
|
|
</span>
|
|
|
|
<span *ngIf="award.confirmed === 1">
|
|
|
|
{{'request.award.table.status.accepted' | translate}}
|
|
|
|
</span>
|
|
|
|
<span *ngIf="award.confirmed !== 0 && award.confirmed !== 1">
|
|
|
|
{{'request.award.table.status.rejected' | translate}}
|
|
|
|
</span>
|
2017-06-10 13:16:15 +02:00
|
|
|
</td>
|
2018-03-11 13:59:04 +01:00
|
|
|
<td class="text-right">
|
|
|
|
{{award.rejectReason ? award.rejectReason : ''}}
|
|
|
|
</td>
|
2017-06-10 13:16:15 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-06-09 18:30:35 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|