OpenSlides/client/src/app/shared/components/extension-field/extension-field.component.html
GabrielMeyer dfa80e9cd0 Separates the attachment field to a custom component
- Refactores also the 'search-value-selector.component'
2019-07-08 10:45:11 +02:00

53 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Chip -->
<div>
<h4 *ngIf="title">{{ title }}</h4>
<mat-menu #triggerMenu="matMenu">
<ng-container
[ngTemplateOutlet]="triggerTemplate">
</ng-container>
</mat-menu>
<os-icon-container
iconTooltip="{{ 'Edit' | translate }}"
icon="create"
[swap]="true"
[showIcon]="!editMode && canBeEdited && hasExtension"
(iconAction)="changeEditMode()">
<mat-basic-chip *ngIf="canBeEdited" [matMenuTriggerFor]="triggerMenu" [ngClass]="classes" class="pointer" disableRipple>
{{ chipValue || '' }}
</mat-basic-chip>
<mat-basic-chip *ngIf="!canBeEdited" [ngClass]="classes" disableRipple>
{{ chipValue }}
</mat-basic-chip>
</os-icon-container>
</div>
<!-- Extension field -->
<div
*ngIf="hasExtension && editMode"
class="spacer-top-10 extension-container"
>
<mat-form-field>
<input
matInput
[(ngModel)]="inputControl"
placeholder="{{ extensionLabel }}"
/>
</mat-form-field>
<os-search-value-selector
*ngIf="searchList"
ngDefaultControl
[formControl]="extensionFieldForm.get('list')"
[fullWidth]="true"
[InputListValues]="searchList"
[listname]="searchListLabel"
></os-search-value-selector>
<button mat-button (click)="changeEditMode(true)">{{ 'Save' | translate }}</button>
<button mat-button (click)="changeEditMode()">{{ 'Cancel' | translate }}</button>
</div>
<!-- Optional template for the menu -->
<ng-template #triggerTemplate>
<ng-content select=".trigger-menu"></ng-content>
</ng-template>