2017-12-18 11:01:22 +01:00
|
|
|
<div class="project-editor">
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-card-title *ngIf="isNew">{{'PROJECT-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
|
|
|
<mat-card-title *ngIf="!isNew">{{formGroup?.get('label')?.value}}</mat-card-title>
|
2018-05-28 11:50:42 +02:00
|
|
|
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
|
|
|
<mat-card>
|
|
|
|
<mat-card-header>
|
|
|
|
<div class="fill-space"></div>
|
2018-06-05 10:18:01 +02:00
|
|
|
<div *ngIf="!isNew">
|
|
|
|
<button *ngIf="!editMode && !isExternalProject()" mat-icon-button (click)="enableForm()">
|
|
|
|
<mat-icon class="mat-24">edit</mat-icon>
|
|
|
|
</button>
|
|
|
|
<button *ngIf="editMode && !isExternalProject()" mat-icon-button (click)="disableForm()">
|
|
|
|
<mat-icon class="mat-24">lock</mat-icon>
|
|
|
|
</button>
|
|
|
|
<button mat-button (click)="goToProjectDmps()">
|
|
|
|
<mat-icon class="mat-24">arrow_forward</mat-icon>
|
|
|
|
<span>{{'PROJECT-EDITOR.ACTIONS.GO-TO-DMPS' | translate}}</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2018-05-28 11:50:42 +02:00
|
|
|
</mat-card-header>
|
|
|
|
<mat-card-content>
|
2018-07-23 17:56:09 +02:00
|
|
|
<div class="row">
|
|
|
|
<mat-form-field class="col-md-12">
|
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.LABEL' | 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
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
2018-07-24 13:19:52 +02:00
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.ABBREVIATION' | translate}}" type="text" name="abbreviation" formControlName="abbreviation">
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-error *ngIf="formGroup.get('abbreviation').errors?.backendError">{{baseErrorModel.abbreviation}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
|
|
|
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
|
|
|
<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
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
|
|
|
<input matInput (focus)="startDate.open()" (click)="startDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.START' | translate}}"
|
|
|
|
class="table-input" [matDatepicker]="startDate" formControlName="startDate">
|
|
|
|
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #startDate></mat-datepicker>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').errors?.backendError">{{this.project.errorModel.startDate}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
|
|
|
<input matInput (focus)="endDate.open()" (click)="endDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.END' | translate}}"
|
|
|
|
class="table-input" [matDatepicker]="endDate" formControlName="endDate">
|
|
|
|
<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>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<mat-form-field class="col-md-12">
|
|
|
|
<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>
|
|
|
|
<p>{{this.languageResolverService.getBy('editorLogo') | translate}}</p>
|
2017-12-18 11:01:22 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
<table class="logo-table col-md-12">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<img mat-card-avatar *ngIf="!formGroup.get('files') || !formGroup.get('files').value" [src]="host+'files/any?type=jpg'">
|
|
|
|
<img mat-card-avatar *ngIf="formGroup.get('files') && formGroup.get('files').value" [src]="host+'files/'+formGroup.get('files').value[0].id+'?location='+formGroup.get('files').value[0].location+'&type='+formGroup.get('files').value[0].type">
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<app-fileuploader-component [form]="formGroup.get('files')" [label]="'FILE-UPLOADER.PROJECT'" [fileUploader]="uploaderService"></app-fileuploader-component>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2018-07-24 09:58:55 +02:00
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-auto">
|
|
|
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'PROJECT-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
|
|
<button *ngIf="isNew || editMode" mat-raised-button color="primary" type="submit">{{'PROJECT-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
|
|
<button *ngIf="!isNew && editMode" mat-raised-button color="primary" type="button" (click)="delete()">{{'PROJECT-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-23 17:56:09 +02:00
|
|
|
</div>
|
2018-05-28 11:50:42 +02:00
|
|
|
</div>
|
|
|
|
</mat-card-content>
|
|
|
|
</mat-card>
|
|
|
|
</form>
|
|
|
|
</div>
|