2017-12-18 11:01:22 +01:00
|
|
|
<div class="project-editor">
|
|
|
|
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
|
|
|
<mat-card>
|
|
|
|
<mat-card-title *ngIf="isNew">{{'PROJECT-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
|
|
|
<mat-card-title *ngIf="!isNew">{{'PROJECT-EDITOR.TITLE.EDIT' | translate}} {{project.label}}</mat-card-title>
|
|
|
|
<mat-card-content>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<mat-form-field>
|
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label"
|
|
|
|
required>
|
|
|
|
<mat-error *ngIf="formGroup.get('label').errors?.backendError">{{baseErrorModel.label}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<!-- <mat-form-field>
|
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.ABBREVIATION' | translate}}" type="text" name="abbreviation" formControlName="abbreviation"
|
|
|
|
required>
|
|
|
|
<mat-error *ngIf="formGroup.get('abbreviation').errors?.backendError">{{baseErrorModel.abbreviation}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('abbreviation').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<mat-form-field>
|
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri" required>
|
|
|
|
<mat-error *ngIf="formGroup.get('uri').errors?.backendError">{{baseErrorModel.uri}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('uri').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field> -->
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<!-- <table class="input-table full-width">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<mat-form-field>
|
|
|
|
<input matInput (focus)="startDate.open()" (click)="startDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.START' | translate}}"
|
|
|
|
class="table-input" [matDatepicker]="startDate" formControlName="startDate" required>
|
|
|
|
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #startDate></mat-datepicker>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').errors?.backendError">{{baseErrorModel.startDate}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<mat-form-field>
|
|
|
|
<input matInput (focus)="endDate.open()" (click)="endDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.END' | translate}}"
|
|
|
|
class="table-input" [matDatepicker]="endDate" formControlName="endDate" required>
|
|
|
|
<mat-datepicker-toggle matSuffix [for]="endDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #endDate></mat-datepicker>
|
|
|
|
<mat-error *ngIf="formGroup.get('endDate').errors?.backendError">{{baseErrorModel.endDate}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('endDate').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table> -->
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<mat-form-field class="full-width">
|
|
|
|
<textarea matInput class="description-area" placeholder="{{'PROJECT-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"
|
|
|
|
required></textarea>
|
|
|
|
<mat-error *ngIf="formGroup.get('description').errors?.backendError">{{errorModel.description}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('description').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<td-chips [items]="filteredOrganisations" [debounce]="500" placeholder="Enter autocomplete strings" (inputChange)="filterOrganisations($event)"
|
|
|
|
requireMatch>
|
|
|
|
<ng-template td-chip let-chip="chip">
|
|
|
|
<!-- <div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.substring(0, 1).toUpperCase()}}</div> -->
|
|
|
|
{{chip.name}}
|
|
|
|
</ng-template>
|
|
|
|
<ng-template td-autocomplete-option let-option="option">
|
|
|
|
<div layout="row" layout-align="start center">
|
|
|
|
{{option.name}}
|
|
|
|
</div>
|
|
|
|
</ng-template>
|
|
|
|
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
|
|
|
|
</td-chips>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
<div layout="row" class="full-width text-right" align="end">
|
|
|
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'PROJECT-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
|
|
|
<button mat-raised-button color="primary" type="submit">{{'PROJECT-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
|
|
|
<button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'PROJECT-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
2017-12-14 18:13:28 +01:00
|
|
|
</div>
|
|
|
|
|
2017-12-18 11:01:22 +01:00
|
|
|
</mat-card-content>
|
|
|
|
</mat-card>
|
|
|
|
</form>
|
|
|
|
</div>
|