]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
00c3f926598942ca16e6eed6bb4ce30a3560dab6
[ceph-ci.git] /
1 <cd-modal [modalRef]="activeModal">
2   <ng-container i18n
3                 class="modal-title">Move an image to trash</ng-container>
4
5   <ng-container class="modal-content">
6     <form name="moveForm"
7           class="form"
8           #formDir="ngForm"
9           [formGroup]="moveForm"
10           novalidate>
11       <div class="modal-body">
12         <div class="alert alert-warning"
13              *ngIf="hasSnapshots"
14              role="alert">
15           <span i18n>This image contains snapshot(s), which will prevent it
16             from being removed after moved to trash.</span>
17         </div>
18
19         <p i18n>To move <kbd>{{ imageSpecStr }}</kbd> to trash,
20           click <kbd>Move</kbd>. Optionally, you can pick an expiration date.</p>
21
22         <div class="form-group">
23           <label class="col-form-label"
24                  for="expiresAt"
25                  i18n>Protection expires at</label>
26           <input type="text"
27                  placeholder="NOT PROTECTED"
28                  i18n-placeholder
29                  class="form-control"
30                  formControlName="expiresAt"
31                  [ngbPopover]="popContent"
32                  triggers="manual"
33                  #p="ngbPopover"
34                  (click)="p.open()"
35                  (keypress)="p.close()">
36
37           <span class="invalid-feedback"
38                 *ngIf="moveForm.showError('expiresAt', formDir, 'format')"
39                 i18n>Wrong date format. Please use "YYYY-MM-DD HH:mm:ss".</span>
40           <span class="invalid-feedback"
41                 *ngIf="moveForm.showError('expiresAt', formDir, 'expired')"
42                 i18n>Protection has already expired. Please pick a future date or leave it empty.</span>
43         </div>
44       </div>
45
46       <div class="modal-footer">
47         <cd-form-button-panel (submitActionEvent)="moveImage()"
48                               [form]="moveForm"
49                               [submitText]="actionLabels.MOVE"></cd-form-button-panel>
50       </div>
51     </form>
52   </ng-container>
53 </cd-modal>
54
55 <ng-template #popContent>
56   <cd-date-time-picker [control]="moveForm.get('expiresAt')"></cd-date-time-picker>
57 </ng-template>