]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
90e3a1d2be8b20fdac20adfa0e4564b652728b24
[ceph-ci.git] /
1 <cds-modal size="sm"
2            [open]="open"
3            (overlaySelected)="closeModal()">
4   <cds-modal-header (closeSelect)="closeModal()">
5     <ng-container *ngTemplateOutlet="deletionHeading"></ng-container>
6   </cds-modal-header>
7
8     <section cdsModalContent>
9       <form name="deletionForm"
10             #formDir="ngForm"
11             [formGroup]="deletionForm"
12             novalidate>
13       <cd-alert-panel *ngIf="infoMessage"
14                       type="info"
15                       spacingClass="mb-3"
16                       i18n>
17         <p>{{ infoMessage }}</p>
18       </cd-alert-panel>
19       <ng-container *ngTemplateOutlet="bodyTemplate; context: bodyContext"></ng-container>
20       <div class="question">
21         <span *ngIf="itemNames; else noNames">
22           <p *ngIf="itemNames.length === 1; else manyNames"
23              i18n>Are you sure that you want to {{ actionDescription | lowercase }} <strong>{{ itemNames[0] }}</strong>?</p>
24           <ng-template #manyNames>
25             <p i18n>Are you sure that you want to {{ actionDescription | lowercase }} the selected items?</p>
26             <ul>
27               <li *ngFor="let itemName of itemNames"><strong>{{ itemName }}</strong></li>
28             </ul>
29           </ng-template >
30         </span>
31         <ng-template #noNames>
32           <p i18n>Are you sure that you want to {{ actionDescription | lowercase }} the selected {{ itemDescription }}?</p>
33         </ng-template>
34         <ng-container *ngTemplateOutlet="childFormGroupTemplate; context:{form:deletionForm}"></ng-container>
35         <div class="form-item">
36           <cds-checkbox id="confirmation"
37                         name="confirmation"
38                         formControlName="confirmation"
39                         autofocus
40                         [required]="true"
41                         modal-primary-focus
42                         i18n>Yes, I am sure.</cds-checkbox>
43         </div>
44       </div>
45     </form>
46   </section>
47   <cd-form-button-panel (submitActionEvent)="callSubmitAction()"
48                         (backActionEvent)="backAction ? callBackAction() : hideModal()"
49                         [form]="deletionForm"
50                         [submitText]="(actionDescription | titlecase) + ' ' + itemDescription"
51                         [modalForm]="true"
52                         [submitBtnType]="(actionDescription === 'delete' || actionDescription === 'remove') ? 'danger' : 'primary'"></cd-form-button-panel>
53
54 </cds-modal>
55
56 <ng-template #deletionHeading>
57   <h3 cdsModalHeaderHeading
58       i18n>
59     {{ actionDescription | titlecase }} {{ itemDescription }}
60   </h3>
61 </ng-template>