fix bottom bar, migrate placeholder

This commit is contained in:
2022-12-11 10:29:49 +01:00
parent 159d19e939
commit 3d7dc4d03c
16 changed files with 167 additions and 170 deletions
+11 -8
View File
@@ -1,11 +1,13 @@
<div class="container">
<mat-progress-bar *ngIf="!entry" mode="indeterminate"></mat-progress-bar>
<form [formGroup]="form" (ngSubmit)="entry.id ? update() : create()" #formDirective="ngForm" *ngIf="entry && settings">
<form [formGroup]="form" (ngSubmit)="entry.id ? update() : create()" #formDirective="ngForm"
*ngIf="entry && settings">
<mat-card>
<mat-card-content>
<p>{{ (entry.id ? 'submission.edit' : 'submission.info') | i18n}}</p>
<mat-form-field>
<mat-select placeholder="{{'submission.entryType' | i18n}}" formControlName="entryType">
<mat-label>{{'submission.entryType' | i18n}}</mat-label>
<mat-select formControlName="entryType">
<mat-select-trigger>
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' + entryType | i18n}}
</mat-select-trigger>
@@ -16,23 +18,24 @@
</mat-form-field>
<mat-form-field>
<input matInput placeholder="{{'submission.url' | i18n}}" formControlName="url" type="url"
[required]="entryType == 'LINK'" matAutofocus>
<mat-label>{{'submission.url' | i18n}}</mat-label>
<input matInput 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
(focus)="onTitleFocus($event)">
<mat-label>{{'submission.title' | i18n}}</mat-label>
<input matInput formControlName="title" type="text" required (focus)="onTitleFocus($event)">
<mat-error>
{{'submission.title.error' | i18n}}
</mat-error>
</mat-form-field>
<mat-form-field>
<textarea matAutosize matAutosizeMinRows="3" matInput placeholder="{{'submission.text' | i18n}}"
[required]="entryType != 'LINK'" formControlName="text"></textarea>
<mat-label>{{'submission.text' | i18n}}</mat-label>
<textarea matAutosize matAutosizeMinRows="3" matInput [required]="entryType != 'LINK'"
formControlName="text"></textarea>
<mat-error>
{{'submission.text.error' | i18n}}
</mat-error>
+4 -4
View File
@@ -24,15 +24,15 @@
{{'login.invalid' | i18n}}
</mat-error>
<mat-form-field>
<input id="username" name="username" matInput placeholder="{{'username' | i18n}}" required
matAutofocus>
<mat-label>{{'username' | i18n}}</mat-label>
<input id="username" name="username" matInput required matAutofocus>
<mat-error>
{{'username.missing' | i18n}}
</mat-error>
</mat-form-field>
<mat-form-field>
<input id="password" name="password" matInput type="password"
placeholder="{{'password' | i18n}}" required>
<mat-label>{{'password' | i18n}}</mat-label>
<input id="password" name="password" matInput type="password" required>
<mat-error>
{{'password.invalid.hint' | i18n}}
</mat-error>
+6 -5
View File
@@ -5,8 +5,8 @@
<input matInput [formControl]="searchFormControl">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="{{'search.types' | i18n}}" [value]="searchType"
(selectionChange)="searchType = $event.value; refresh()">
<mat-label>{{'search.types' | i18n}}</mat-label>
<mat-select [value]="searchType" (selectionChange)="searchType = $event.value; refresh()">
<mat-select-trigger>
<span *ngIf="searchType">
<mat-icon>{{'search.types.' + searchType + '.icon' | i18n}}</mat-icon> {{'search.types.' +
@@ -24,8 +24,8 @@
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="{{'search.byDate' | i18n}}" [value]="byDate"
(selectionChange)="byDate = $event.value; refresh()">
<mat-label>{{'search.byDate' | i18n}}</mat-label>
<mat-select [value]="byDate" (selectionChange)="byDate = $event.value; refresh()">
<mat-select-trigger>
<mat-icon>{{'search.byDate.' + byDate + '.icon' | i18n}}</mat-icon> {{'search.byDate.' +
byDate | i18n}}
@@ -41,7 +41,8 @@
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="{{'search.asc' | i18n}}" [value]="asc" (selectionChange)="asc = $event.value; refresh()">
<mat-label>{{'search.asc' | i18n}}</mat-label>
<mat-select [value]="asc" (selectionChange)="asc = $event.value; refresh()">
<mat-select-trigger>
<mat-icon>{{'search.asc.' + asc + '.icon' | i18n}}</mat-icon> {{'search.asc.' +
asc | i18n}}
+12 -11
View File
@@ -4,14 +4,15 @@
<mat-card-content>
<mat-card-title><a routerLink="/u/{{user.username}}">{{user.username}}</a></mat-card-title>
<mat-form-field>
<input matInput placeholder="{{'settings.email' | i18n}}" formControlName="email" type="email">
<mat-label>{{'settings.email' | i18n}}</mat-label>
<input matInput formControlName="email" type="email">
<mat-error *ngIf="hasError('email')">
{{'settings.email.error' | i18n}}
</mat-error>
</mat-form-field>
<mat-form-field>
<textarea matAutosize matAutosizeMinRows="3" matInput placeholder="{{'settings.about' | i18n}}"
formControlName="about"></textarea>
<mat-label>{{'settings.about' | i18n}}</mat-label>
<textarea matAutosize matAutosizeMinRows="3" matInput formControlName="about"></textarea>
<mat-error>
{{'settings.about.error' | i18n}}
</mat-error>
@@ -24,8 +25,8 @@
mat-icon-button (click)="resetGravity()">
<mat-icon>cancel</mat-icon>
</button>
<input type="number" min="0" max="2" step="0.1" matInput placeholder="{{'settings.gravity' | i18n}}"
formControlName="gravity">
<mat-label>{{'settings.gravity' | i18n}}</mat-label>
<input type="number" min="0" max="2" step="0.1" matInput formControlName="gravity">
<mat-hint *ngIf="form.get('gravity').value != 0">
{{'settings.gravity.hint' | i18n}}
</mat-hint>
@@ -39,8 +40,8 @@
mat-icon-button (click)="resetEntryDelay()">
<mat-icon>cancel</mat-icon>
</button>
<input type="number" min="0" max="15" step="1" matInput placeholder="{{'settings.entryDelay' | i18n}}"
formControlName="entryDelay">
<mat-label>{{'settings.entryDelay' | i18n}}</mat-label>
<input type="number" min="0" max="15" step="1" matInput formControlName="entryDelay">
<mat-hint *ngIf="form.get('entryDelay').value != 0">
{{'settings.entryDelay.hint' | i18n}}
</mat-hint>
@@ -54,8 +55,8 @@
matPrefix mat-icon-button (click)="resetCommentDelay()">
<mat-icon>cancel</mat-icon>
</button>
<input type="number" min="0" max="15" step="1" matInput placeholder="{{'settings.commentDelay' | i18n}}"
formControlName="commentDelay">
<mat-label>{{'settings.commentDelay' | i18n}}</mat-label>
<input type="number" min="0" max="15" step="1" matInput formControlName="commentDelay">
<mat-hint *ngIf="form.get('commentDelay').value != 0">
{{'settings.commentDelay.hint' | i18n}}
</mat-hint>
@@ -70,8 +71,8 @@
mat-icon-button (click)="resetPageSize()">
<mat-icon>cancel</mat-icon>
</button>
<input type="number" min="1" max="100" step="1" matInput placeholder="{{'settings.pageSize' | i18n}}"
formControlName="pageSize">
<mat-label>{{'settings.pageSize' | i18n}}</mat-label>
<input type="number" min="1" max="100" step="1" matInput formControlName="pageSize">
<mat-hint *ngIf="form.get('pageSize').value != 0">
{{'settings.pageSize.hint' | i18n}}
</mat-hint>
+8 -4
View File
@@ -6,7 +6,8 @@
<p>{{ (view.id ? 'views.edit' : 'views.create') | i18n}}</p>
<mat-form-field>
<input matInput placeholder="{{'views.name' | i18n}}" formControlName="name" matAutofocus>
<mat-label>{{'views.name' | i18n}}</mat-label>
<input matInput formControlName="name" matAutofocus>
<mat-error *ngIf="hasError('name')">
<div *ngFor="let error of form.get('name').errors | keyvalue">
{{'views.name.error.' + error.key | i18n}}<br>
@@ -15,7 +16,8 @@
</mat-form-field>
<mat-form-field>
<mat-select placeholder="{{'views.sorting' | i18n}}" formControlName="sorting">
<mat-label>{{'views.sorting' | i18n}}</mat-label>
<mat-select formControlName="sorting">
<mat-select-trigger>
<mat-icon>{{'sorting.' + sorting + '.icon' | i18n}}</mat-icon> {{'sorting.' + sorting | i18n}}
</mat-select-trigger>
@@ -32,7 +34,8 @@
</ui-tagspicker>
<mat-form-field>
<mat-select placeholder="{{'views.entryType' | i18n}}" formControlName="entryType">
<mat-label>{{'views.entryType' | i18n}}</mat-label>
<mat-select formControlName="entryType">
<mat-select-trigger>
<span *ngIf="entryType">
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' +
@@ -51,7 +54,8 @@
</mat-form-field>
<mat-form-field>
<input matInput placeholder="{{'views.index' | i18n}}" formControlName="index" type="number" min="0">
<mat-label>{{'views.index' | i18n}}</mat-label>
<input matInput formControlName="index" type="number" min="0">
<mat-error *ngIf="hasError('index')">
<div *ngFor="let error of form.get('index').errors | keyvalue">
{{'views.index.error.' + error.key | i18n}}<br>