50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
// vim: set tw=80 ts=2 sw=2 sts=2:
|
|
import { Component, Input } from '@angular/core';
|
|
|
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
|
|
import { Schedule } from './schedule';
|
|
|
|
@Component({
|
|
selector: 'schedule-delete-modal',
|
|
template: `
|
|
<div class="modal-header">
|
|
<h3 class="modal-title" id="modal-title">{{ title() }}</h3>
|
|
</div>
|
|
|
|
<div class="modal-body" id="modal-body">
|
|
<p>
|
|
Do you really want to delete schedule #{{ schedule.id }} with label:<br/>
|
|
{{ schedule.label }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button class="btn btn-danger" (click)="submit()">
|
|
Yes
|
|
</button>
|
|
|
|
<button class="btn btn-default" (click)="cancel()">
|
|
No
|
|
</button>
|
|
</div>
|
|
`
|
|
})
|
|
export class ScheduleDeleteModalComponent {
|
|
@Input() schedule: Schedule
|
|
|
|
constructor(public activeModal: NgbActiveModal) {}
|
|
|
|
title(): string {
|
|
return "Delete schedule #" + this.schedule.id;
|
|
}
|
|
|
|
submit(): void {
|
|
this.activeModal.close(this.schedule);
|
|
}
|
|
|
|
cancel(): void {
|
|
this.activeModal.dismiss("closed");
|
|
}
|
|
}
|