Add Schedule Delete Modal component.
This commit is contained in:
parent
fd4da93c20
commit
46f5f72bd4
49
src/scheduler/scheduleDeleteModal.component.ts
Normal file
49
src/scheduler/scheduleDeleteModal.component.ts
Normal file
@ -0,0 +1,49 @@
|
||||
// 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");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user