]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
45a3ebf2b853d0f07488ee6e0270eb0c8cba7d07
[ceph-ci.git] /
1 <ng-template #popTemplate>
2   <form name="form"
3         #formDir="ngForm"
4         [formGroup]="form"
5         novalidate>
6     <div [ngClass]="{'has-error': form.showError('filter', formDir)}">
7       <input type="text"
8              formControlName="filter"
9              i18n-placeholder
10              [placeholder]="messages.filter"
11              (keyup)="$event.keyCode == 13 ? selectOption() : updateFilter()"
12              class="form-control text-center" />
13       <ng-container *ngFor="let error of Object.keys(messages.customValidations)">
14         <span class="help-block text-center"
15               *ngIf="form.showError('filter', formDir) && filter.hasError(error)">
16           {{ messages.customValidations[error] }}
17         </span>
18       </ng-container>
19     </div>
20   </form>
21   <div *ngFor="let option of filteredOptions"
22        class="select-menu-item"
23        [class.disabled]="data.length === selectionLimit && !option.selected"
24        (click)="triggerSelection(option)">
25     <div class="select-menu-item-icon">
26       <i class="fa fa-check"
27          aria-hidden="true"
28          *ngIf="option.selected"></i>
29       &nbsp;
30     </div>
31     <div class="select-menu-item-content">
32       {{ option.name }}
33       <ng-container *ngIf="option.description">
34         <br>
35         <small class="text-muted">
36           {{ option.description }}&nbsp;
37         </small>
38       </ng-container>
39     </div>
40   </div>
41   <div *ngIf="isCreatable()"
42        class="select-menu-item"
43        (click)="addCustomOption(filter.value)">
44     <div class="select-menu-item-icon">
45       <i class="fa fa-tag"
46          aria-hidden="true"></i>
47       &nbsp;
48     </div>
49     <div class="select-menu-item-content">
50       {{ messages.add }} '{{ filter.value }}'
51     </div>
52   </div>
53   <div class="has-warning"
54        *ngIf="data.length === selectionLimit">
55     <span class="help-block text-center text-warning"
56           [tooltip]="messages.selectionLimit.tooltip"
57           *ngIf="data.length === selectionLimit">
58       {{ messages.selectionLimit.text }}
59     </span>
60   </div>
61 </ng-template>
62
63 <a class="margin-right-sm select-menu-edit"
64    [popover]="popTemplate"
65    placement="bottom"
66    container="body"
67    outsideClick="true">
68   <i class="fa fa-fw fa-pencil"></i>
69 </a>
70 <span class="text-muted"
71       *ngIf="data.length === 0">
72   {{ messages.empty }}
73 </span>
74 <span *ngFor="let dataItem of data">
75   <span class="badge badge-pill badge-primary margin-right-sm">
76     <span class="margin-right-sm">{{ dataItem }}</span>
77     <a class="badge-remove"
78        (click)="removeItem(dataItem)">
79       <i class="fa fa-times"
80          aria-hidden="true"></i>
81     </a>
82   </span>
83 </span>