Compare commits
2 Commits
07a6822920
...
162453c894
Author | SHA1 | Date |
---|---|---|
HardiReady | 162453c894 | |
HardiReady | a29a39d8e0 |
|
@ -73,7 +73,9 @@
|
||||||
<th class="col-sm-2">Begründung</th>
|
<th class="col-sm-2">Begründung</th>
|
||||||
<th class="col-sm-1 text-right">Datum</th>
|
<th class="col-sm-1 text-right">Datum</th>
|
||||||
<th class="col-sm-1 text-center">Status</th>
|
<th class="col-sm-1 text-center">Status</th>
|
||||||
<th class="col-sm-1 text-center"></th>
|
<th class="col-sm-1 text-center">
|
||||||
|
<span class="btn btn-default" (click)="deleteAwarding()">Löschen</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody *ngFor="let award of awards">
|
<tbody *ngFor="let award of awards">
|
||||||
|
@ -94,10 +96,15 @@
|
||||||
<a class="small text-nowrap">{{award.date | date: 'dd.MM.yyyy'}}</a>
|
<a class="small text-nowrap">{{award.date | date: 'dd.MM.yyyy'}}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{{award.confirmed === 0? 'In Bearbeitung' : (award.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}}
|
{{award.confirmed === 0 ? 'In Bearbeitung' : (award.confirmed === 1 ? 'Genehmigt' : 'Abgelehnt')}}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<span class="glyphicon glyphicon-trash trash" title="Löschen" (click)="deleteAwarding(award._id)"></span>
|
<label>
|
||||||
|
<input name="deleteAward"
|
||||||
|
type="checkbox"
|
||||||
|
value="{{award._id}}"
|
||||||
|
[(ngModel)]="award.checked">
|
||||||
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -93,22 +93,28 @@ export class AwardUserComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAwarding(awardingId) {
|
deleteAwarding() {
|
||||||
this.awardingService.deleteAwarding(awardingId).subscribe((res) => {
|
const checkedAwardings = this.awards.filter(award => award['checked'] === true);
|
||||||
|
|
||||||
|
if (checkedAwardings.length > 0) {
|
||||||
|
checkedAwardings.forEach(awarding => {
|
||||||
|
this.awardingService.deleteAwarding(awarding._id).subscribe((res) => {
|
||||||
this.awardingService.getUserAwardings(this.userId)
|
this.awardingService.getUserAwardings(this.userId)
|
||||||
.subscribe((awards) => {
|
.subscribe((awards) => {
|
||||||
this.awards = awards;
|
this.awards = awards;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.showSuccessLabel = true;
|
this.showSuccessLabel = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showSuccessLabel = false;
|
this.showSuccessLabel = false;
|
||||||
}, 2000);
|
}, 4000);
|
||||||
});
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.router.navigate(['../..'], {relativeTo: this.route});
|
this.router.navigate(['../..'], {relativeTo: this.route});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue