update dependencies, improve views

This commit is contained in:
2022-12-07 18:25:03 +01:00
parent b602564781
commit 94b8792de8
25 changed files with 6563 additions and 5548 deletions
+1 -1
View File
@@ -5,6 +5,6 @@
<ui-commentform [target]="entry.id" (replyCommentEvent)="replyCallback($event)"></ui-commentform>
<ui-comments #comments [target]="entry.id" [subcomments]="true"></ui-comments>
<ui-comments #comments [target]="entry.id" [subcomments]="true" class="scroll-container"></ui-comments>
</ng-container>
</div>
+3 -3
View File
@@ -1,4 +1,4 @@
<div fxLayout="column" fxFlexFill>
<div class="flex column fill">
<div class="container">
<mat-card *ngIf="externals && externals.length > 0" class="box">
<mat-card-content>
@@ -7,7 +7,7 @@
{{'login.external.invalid' | i18n}}
</mat-error>
</mat-card-content>
<mat-card-actions>
<mat-card-actions class="flex wrap">
<a class="external-login" (click)="externalLogin(client)" *ngFor="let client of externals"
mat-raised-button color="accent">{{'login.external.client' | i18n:client.id}}</a>
<mat-slide-toggle [(ngModel)]="autologin">
@@ -50,7 +50,7 @@
</mat-card>
</form>
</div>
<span fxFlexOffset="auto"></span>
<span class="spacer"></span>
<div class="container" *ngIf="!internalLogin">
<small>
<a href="javascript:" (click)="internalLogin = true;">{{'login.local' | i18n}}</a>
+2 -1
View File
@@ -4,7 +4,8 @@ mat-form-field {
a.external-login {
margin: 15px 0;
display: block;
flex-basis: 100%;
flex-shrink: 0;
}
.box {
@@ -1,7 +1,7 @@
<div class="container">
<mat-progress-bar *ngIf="!comments || !comments.content" mode="indeterminate"></mat-progress-bar>
<div *ngIf="comments && comments.content" fxLayout="column" fxFlexFill class="comments">
<div *ngIf="comments && comments.content" class="comments flex column fill">
<ng-container *ngFor="let comment of comments.content; let i = index">
<mat-divider class="divider" *ngIf="i > 0"></mat-divider>
<ui-comment class="comment" [comment]="comment" [subcomments]="false" [parentLink]="true" [change]="boundRefresh">
+10 -10
View File
@@ -1,6 +1,6 @@
<div fxLayout="column" fxFlexFill>
<div class="container">
<mat-form-field appearance="fill">
<div class="flex column fill">
<div class="container flex wrap">
<mat-form-field appearance="fill">
<mat-label>{{'search.query' | i18n}}</mat-label>
<input matInput [formControl]="searchFormControl">
</mat-form-field>
@@ -24,7 +24,8 @@
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="{{'search.byDate' | i18n}}" [value]="byDate" (selectionChange)="byDate = $event.value; refresh()">
<mat-select placeholder="{{'search.byDate' | i18n}}" [value]="byDate"
(selectionChange)="byDate = $event.value; refresh()">
<mat-select-trigger>
<mat-icon>{{'search.byDate.' + byDate + '.icon' | i18n}}</mat-icon> {{'search.byDate.' +
byDate | i18n}}
@@ -59,7 +60,7 @@
<mat-progress-bar *ngIf="!results || !results.content && !results.error" mode="indeterminate"></mat-progress-bar>
<div *ngIf="results && results.error" fxLayout="column" fxFlexFill>
<div *ngIf="results && results.error" class="flex column fill">
<mat-card class="accent box">
<mat-card-header>
<mat-card-title>{{ 'search.error.' + results.error.status | i18n}}</mat-card-title>
@@ -73,8 +74,8 @@
</mat-card>
</div>
<div class="results" *ngIf="results" fxLayout="column">
<mat-list *ngIf="results.content">
<ng-container *ngIf="results">
<mat-list *ngIf="results.content" class="scroll-container">
<ng-container *ngFor="let result of results.content; let i = index">
<mat-divider *ngIf="i > 0"></mat-divider>
<mat-list-item>
@@ -94,10 +95,9 @@
</mat-list-item>
</mat-list>
<span fxFlexOffset="auto" fxFlexOffset.xs="none"></span>
<span class="spacer"></span>
<mat-paginator [pageSizeOptions]="pageSizeOptions" [pageIndex]="results.number" [length]="results.totalElements"
[pageSize]="results.size" (page)="update && update($event)" showFirstLastButtons>
</mat-paginator>
</div>
</ng-container>
</div>
+4 -5
View File
@@ -1,13 +1,12 @@
.results {
height: 100%;
}
mat-list mat-list-item {
height: auto;
}
mat-form-field {
margin-right: 15px;
flex-basis: 0;
flex-grow: 1;
min-width: 100px;
}
.container {
@@ -58,4 +57,4 @@ ui-tagspicker {
@media screen and (min-width: 992px) {
max-width: 50%;
}
}
}
+14 -8
View File
@@ -10,20 +10,20 @@ import { SettingsService } from 'src/app/services/settings.service';
@Component({
selector: 'page-search',
templateUrl: './search.page.html',
styleUrls: [ './search.page.scss' ]
styleUrls: ['./search.page.scss']
})
export class PageSearch implements OnInit {
searchFormControl = new FormControl();
pageSizeOptions: number[] = [ 1, 2, 3, 4, 5, 10, 15, 30, 50, 100 ];
pageSizeOptions: number[] = [1, 2, 3, 4, 5, 10, 15, 30, 50, 100];
results: any;
asc: boolean = false;
byDate: boolean = false;
settings: any;
settingsSubscription: Subscription;
boundRefresh: Function;
types: string[] = [ 'all', 'entry', 'comment' ];
searchType: string = this.types[ 1 ];
types: string[] = ['all', 'entry', 'comment'];
searchType: string = this.types[1];
constructor(
private searchService: SearchService,
@@ -33,10 +33,16 @@ export class PageSearch implements OnInit {
ngOnInit(): void {
this.boundRefresh = this.refresh.bind(this);
this.asc = this.route.snapshot.queryParamMap.get('asc') == 'true';
this.byDate = this.route.snapshot.queryParamMap.get('byDate') == 'true';
this.searchType = this.route.snapshot.queryParamMap.get('type') || this.types[ 1 ];
this.searchFormControl.setValue(this.route.snapshot.queryParamMap.get('q'));
this.route.queryParams.subscribe({
next: (params) => {
this.asc = params['asc'] == 'true';
this.byDate = params['byDate'] == 'true';
this.searchType = params['type'] || this.types[1];
this.searchFormControl.setValue(params['q']);
}
})
this.searchFormControl.valueChanges.pipe(
debounceTime(300)).subscribe((value: string) => {
this.refresh();
@@ -2,7 +2,7 @@
<mat-progress-bar *ngIf="!comments || !comments.content" mode="indeterminate"></mat-progress-bar>
<div *ngIf="comments && comments.content" fxLayout="column" fxFlexFill class="comments">
<div *ngIf="comments && comments.content" class="comments flex column fill">
<p>{{'user.commentsBy' | i18n}}<a routerLink="/u/{{username}}">{{username}}</a></p>
<ng-container *ngFor="let comment of comments.content; let i = index">
<mat-divider class="divider" *ngIf="i > 0"></mat-divider>
@@ -1,6 +1,6 @@
<div fxLayout="column" fxFlexFill>
<div class="flex column fill">
<div class="container">
<p>{{'user.entriesBy' | i18n}}<a routerLink="/u/{{username}}">{{username}}</a></p>
</div>
<page-entries [fetch]="boundFetch" fxFlex="grow"></page-entries>
<page-entries [fetch]="boundFetch" class="grow"></page-entries>
</div>
+2 -2
View File
@@ -65,13 +65,13 @@
</section>
</mat-card-content>
<mat-card-actions fxLayout="row wrap" fxFlexFill>
<mat-card-actions class="flex wrap fill">
<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="/v/{{view.name}}" *ngIf="view.id">{{ 'views.goTo' |
i18n}}</a>
<span fxFlexOffset="auto" fxFlexOffset.xs="none"></span>
<span class="spacer"></span>
<a mat-raised-button color="warn" *ngIf="!working && view.id" (click)="deleteView()">
<mat-icon>delete</mat-icon> {{
'views.delete' |