2019-04-24 11:26:53 +02:00
|
|
|
<div class="main-content">
|
|
|
|
<div class="container-fluid">
|
2019-08-01 09:54:40 +02:00
|
|
|
<div class="grant-editor">
|
|
|
|
<mat-card-title *ngIf="isNew">{{'GRANT-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-card-title *ngIf="!isNew">{{formGroup?.get('label')?.value}}</mat-card-title>
|
|
|
|
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
|
|
|
<mat-card>
|
|
|
|
<mat-card-header>
|
|
|
|
<div class="col-12 row">
|
|
|
|
<table class="logo-table col-auto">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<img mat-card-avatar (click)='imgEnable() && imgFileInput.click()' *ngIf="!formGroup.get('files') || !formGroup.get('files').value" [src]="host+'files/any?type=jpg'">
|
|
|
|
<img mat-card-avatar (click)='editMode && imgFileInput.click()' *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>
|
|
|
|
<input class="hidden" type="file" #imgFileInput (change)="previewImage($event)" accept="image/*"/>
|
|
|
|
<div>
|
|
|
|
<mat-error *ngIf="sizeError">File is too big!</mat-error>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<div class="col"></div>
|
2019-08-01 09:54:40 +02:00
|
|
|
<div *ngIf="!isNew" class="grant-editor-header-actions col-auto">
|
2019-04-24 11:26:53 +02:00
|
|
|
<div class="row actions-row">
|
2019-08-01 09:54:40 +02:00
|
|
|
<div class="col-auto" *ngIf="!editMode && !isExternalGrant()">
|
2019-04-24 11:26:53 +02:00
|
|
|
<button mat-icon-button (click)="enableForm()">
|
|
|
|
<mat-icon class="mat-24">edit</mat-icon>
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-08-01 09:54:40 +02:00
|
|
|
<div class="col-auto" *ngIf="editMode && !isExternalGrant()">
|
2019-04-24 11:26:53 +02:00
|
|
|
<button mat-icon-button (click)="disableForm()">
|
|
|
|
<mat-icon class="mat-24">lock</mat-icon>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-auto">
|
2019-08-01 09:54:40 +02:00
|
|
|
<button mat-button (click)="goToGrantDmps()">
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-icon class="mat-24">arrow_right_alt</mat-icon>
|
2019-08-01 09:54:40 +02:00
|
|
|
<span>{{'GRANT-EDITOR.ACTIONS.GO-TO-DMPS' | translate}}</span>
|
2019-04-24 11:26:53 +02:00
|
|
|
</button>
|
2019-02-12 12:48:24 +01:00
|
|
|
</div>
|
2018-11-27 18:33:17 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-04-24 11:26:53 +02:00
|
|
|
</mat-card-header>
|
|
|
|
<mat-card-content>
|
|
|
|
<div class="row">
|
|
|
|
<mat-form-field class="col-md-12">
|
2019-08-01 09:54:40 +02:00
|
|
|
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.LABEL' | translate}}" type="text" name="label" formControlName="label" required>
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
2019-08-01 09:54:40 +02:00
|
|
|
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.ABBREVIATION' | translate}}" type="text" name="abbreviation" formControlName="abbreviation">
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-error *ngIf="formGroup.get('abbreviation').hasError('backendError')">{{formGroup.get('abbreviation').getError('backendError').message}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
2019-08-01 09:54:40 +02:00
|
|
|
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-error *ngIf="formGroup.get('uri').hasError('backendError')">{{formGroup.get('uri').getError('backendError').message}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('uri').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
2019-08-01 09:54:40 +02:00
|
|
|
<input matInput (focus)="startDate.open()" (click)="startDate.open()" placeholder="{{'GRANT-EDITOR.FIELDS.START' | translate}}" class="table-input" [matDatepicker]="startDate" formControlName="startDate">
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #startDate></mat-datepicker>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').hasError('backendError')">{{formGroup.get('startDate').getError('backendError').message}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('startDate').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-form-field class="col-md-6">
|
2019-08-01 09:54:40 +02:00
|
|
|
<input matInput (focus)="endDate.open()" (click)="endDate.open()" placeholder="{{'GRANT-EDITOR.FIELDS.END' | translate}}" class="table-input" [matDatepicker]="endDate" formControlName="endDate">
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-datepicker-toggle matSuffix [for]="endDate"></mat-datepicker-toggle>
|
|
|
|
<mat-datepicker #endDate></mat-datepicker>
|
|
|
|
<mat-error *ngIf="formGroup.get('endDate').hasError('backendError')">{{formGroup.get('endDate').getError('backendError').message}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('endDate').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2019-08-01 09:54:40 +02:00
|
|
|
<mat-error *ngIf="formGroup.hasError('startAfterEndError')"class="col-md-12">{{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}}</mat-error>
|
2018-10-05 17:00:54 +02:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-form-field class="col-md-12">
|
2019-08-01 09:54:40 +02:00
|
|
|
<textarea matInput class="description-area" placeholder="{{'GRANT-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description" required></textarea>
|
2019-04-24 11:26:53 +02:00
|
|
|
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">{{formGroup.get('description').getError('backendError').message}}</mat-error>
|
|
|
|
<mat-error *ngIf="formGroup.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
|
|
</mat-form-field>
|
2018-10-05 17:00:54 +02:00
|
|
|
|
2019-04-24 11:26:53 +02:00
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-auto right-button">
|
2019-08-01 09:54:40 +02:00
|
|
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'GRANT-EDITOR.ACTIONS.CANCEL' |
|
2019-04-24 11:26:53 +02:00
|
|
|
translate}}</button>
|
|
|
|
</div>
|
|
|
|
<div class="col"></div>
|
|
|
|
<div class="col-auto right-button" *ngIf="!isNew && editMode">
|
2019-08-01 09:54:40 +02:00
|
|
|
<button mat-raised-button color="primary" type="button" (click)="delete()">{{'GRANT-EDITOR.ACTIONS.DELETE'
|
2019-04-24 11:26:53 +02:00
|
|
|
| translate}}</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-auto right-button" *ngIf="isNew || editMode">
|
2019-08-01 09:54:40 +02:00
|
|
|
<button mat-raised-button color="primary" type="submit">{{'GRANT-EDITOR.ACTIONS.SAVE'
|
2019-04-24 11:26:53 +02:00
|
|
|
| translate}}</button>
|
|
|
|
</div>
|
2018-10-05 17:00:54 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-04-24 11:26:53 +02:00
|
|
|
</mat-card-content>
|
|
|
|
</mat-card>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-28 11:50:42 +02:00
|
|
|
</div>
|