44 lines
1.7 KiB
HTML
44 lines
1.7 KiB
HTML
<form [formGroup]="form" (ngSubmit)="create()" #formDirective="ngForm">
|
|
<mat-card>
|
|
<mat-card-content>
|
|
<p>{{'submission.info' | i18n}}</p>
|
|
|
|
<mat-form-field>
|
|
<mat-select placeholder="{{'submission.entryType' | i18n}}" formControlName="entryType">
|
|
<mat-select-trigger>
|
|
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' + entryType | i18n}}
|
|
</mat-select-trigger>
|
|
<mat-option *ngFor="let entryType of entryTypes" [value]="entryType" >
|
|
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' + entryType | i18n}}
|
|
</mat-option>
|
|
</mat-select>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field>
|
|
<input matInput placeholder="{{'submission.url' | i18n}}" formControlName="url" type="url" [required]="entryType == 'LINK'" matAutofocus>
|
|
<mat-error *ngIf="hasError('url')">
|
|
{{'submission.url.error' | i18n}}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field>
|
|
<input matInput placeholder="{{'submission.title' | i18n}}" formControlName="title" type="text" required>
|
|
<mat-error>
|
|
{{'submission.title.error' | i18n}}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
<mat-form-field>
|
|
<textarea matInput placeholder="{{'submission.text' | i18n}}" formControlName="text"></textarea>
|
|
<mat-error>
|
|
{{'submission.text.error' | i18n}}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
</mat-card-content>
|
|
<mat-card-actions>
|
|
<button *ngIf="!working" mat-raised-button color="primary" [disabled]="form.invalid">
|
|
{{'submission.create' | i18n}}
|
|
</button>
|
|
</mat-card-actions>
|
|
</mat-card>
|
|
|
|
</form> |