change userpages to views
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<div class="container">
|
||||
<mat-progress-bar *ngIf="!view" mode="indeterminate"></mat-progress-bar>
|
||||
<form [formGroup]="form" (ngSubmit)="save()" #formDirective="ngForm" *ngIf="view && settings">
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<p>{{ (view.id ? 'views.edit' : 'views.create') | i18n}}</p>
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{'views.name' | i18n}}" 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>
|
||||
</div>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="{{'views.sorting' | i18n}}" formControlName="sorting">
|
||||
<mat-select-trigger>
|
||||
<mat-icon>{{'sorting.' + sorting + '.icon' | i18n}}</mat-icon> {{'sorting.' + sorting | i18n}}
|
||||
</mat-select-trigger>
|
||||
<mat-option *ngFor="let sorting of sortings" [value]="sorting">
|
||||
<mat-icon>{{'sorting.' + sorting + '.icon' | i18n}}</mat-icon> {{'sorting.' + sorting | i18n}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<ui-tagspicker [(model)]="view.tags" placeholder="{{'views.tags' | i18n}}">
|
||||
</ui-tagspicker>
|
||||
|
||||
<ui-tagspicker [(model)]="view.excludedTags" placeholder="{{'views.excludedTags' | i18n}}">
|
||||
</ui-tagspicker>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="{{'views.entryType' | i18n}}" formControlName="entryType">
|
||||
<mat-select-trigger>
|
||||
<span *ngIf="entryType">
|
||||
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' +
|
||||
entryType | i18n}}
|
||||
</span>
|
||||
</mat-select-trigger>
|
||||
<mat-option *ngFor="let entryType of entryTypes" [value]="entryType">
|
||||
<span *ngIf="entryType">
|
||||
<mat-icon>{{'entryType.' + entryType + '.icon' | i18n}}</mat-icon> {{'entryType.' + entryType | i18n}}
|
||||
</span>
|
||||
<span *ngIf="!entryType">
|
||||
{{'entryType.empty' | i18n}}
|
||||
</span>
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{'views.index' | i18n}}" 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>
|
||||
</div>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<section>
|
||||
<mat-checkbox [checked]="view.divider" (change)="view.divider = $event.checked">{{'views.divider'
|
||||
| i18n}}</mat-checkbox>
|
||||
</section>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions fxLayout="row wrap" fxFlexFill>
|
||||
<button *ngIf="!working" mat-raised-button color="primary" [disabled]="form.invalid">
|
||||
<mat-icon>save</mat-icon> {{ (view.id ? 'views.update' : 'views.create') | i18n}}
|
||||
</button>
|
||||
<a mat-button color="primary" routerLink="/p/{{view.name}}" *ngIf="view.id">{{ 'views.goTo' |
|
||||
i18n}}</a>
|
||||
<span fxFlexOffset="auto" fxFlexOffset.xs="none"></span>
|
||||
<a mat-raised-button color="warn" *ngIf="!working && view.id" (click)="deleteView()">
|
||||
<mat-icon>delete</mat-icon> {{
|
||||
'views.delete' |
|
||||
i18n}}
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user