bstlboard-front/src/app/ui/entries/entries.ui.html

95 lines
4.1 KiB
HTML

<mat-progress-bar *ngIf="!entries || !entries.content && !entries.error" mode="indeterminate"></mat-progress-bar>
<div *ngIf="entries && entries.error" class="flex column fill">
<mat-card class="accent box">
<mat-card-header>
<mat-card-title>{{ 'entries.error.' + entries.error.status | i18n}}</mat-card-title>
<mat-card-subtitle>{{'entries.error' | i18n}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p>
{{ 'entries.error.' + entries.error.status + '.text' | i18n}}
</p>
</mat-card-content>
</mat-card>
</div>
<div *ngIf="entries" class="flex column fill">
<mat-list *ngIf="entries.content" class="scroll-container">
<ng-container *ngFor="let entry of entries.content; let i = index">
<mat-divider *ngIf="i > 0"></mat-divider>
<mat-list-item class="entry-item">
<ui-entry class="entry" [entry]="entry" [index]="i+1 + entries.number*entries.size" [change]="refresh"
[text]="text">
</ui-entry>
</mat-list-item>
</ng-container>
</mat-list>
<mat-list *ngIf="entries.totalElements == 0">
<mat-list-item>
<p>{{'entries.nothing' | i18n}}</p>
</mat-list-item>
</mat-list>
<span class="spacer"></span>
<div class="mat-mdc-paginator flex" [ngClass]="{'wrap' : filterOpen}">
<div *ngIf="filter" class="mat-mdc-paginator flex wrap filter-container">
<a mat-icon-button (click)="filterOpen=!filterOpen" title="{{'entries.filter' | i18n}}"
[color]="filterOpen ? 'accent' : 'primary'">
<mat-icon>filter_alt</mat-icon>
</a>
<form class="flex wrap filter" *ngIf="filterOpen">
<ui-tagspicker [(model)]="tags" placeholder="{{'entries.filter.tags' | i18n}}" [change]="boundTagsPickerChange"
appearance="outline">
</ui-tagspicker>
<mat-form-field appearance="outline">
<mat-label>{{'entries.filter.date' | i18n}}</mat-label>
<input matInput [matDatepicker]="picker" [value]="entries && entries.filter && entries.filter.date"
(dateChange)="setFilter('date', $event.value && $event.value.toISOString() || undefined)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker touchUi></mat-datepicker>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>{{'entries.filter.entryType' | i18n}}</mat-label>
<mat-select [value]="entries && entries.filter && entries.filter.type"
(selectionChange)="setFilter('type', $event.value || undefined)">
<mat-select-trigger>
<span *ngIf="entries.filter.type">
<mat-icon>{{'entryType.' + entries.filter.type + '.icon' | i18n}}</mat-icon> {{'entryType.' +
entries.filter.type | 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>
<ui-tagspicker [(model)]="excludedTags" placeholder="{{'entries.filter.excludedTags' | i18n}}"
[change]="boundExcludedTagsPickerChange" appearance="outline">
</ui-tagspicker>
<mat-form-field *ngIf="gravityFilter" appearance="outline">
<mat-label>{{'entries.filter.gravity' | i18n}}</mat-label>
<input matInput type="number" step="0.01" min="0" max="2.0"
[value]="entries && entries.filter && entries.filter.gravity"
(change)="setFilter('gravity', $event.target && $event.target.value || undefined)">
</mat-form-field>
</form>
</div>
<span class="spacer"></span>
<mat-paginator [pageSizeOptions]="pageSizeOptions" [pageIndex]="entries.number" [length]="entries.totalElements"
[pageSize]="entries.size" (page)="update && update($event)" showFirstLastButtons>
</mat-paginator>
</div>
</div>