update navigation + profile

This commit is contained in:
_Bastler
2021-09-23 13:53:08 +02:00
parent 53ac145165
commit 1c0be5e1ea
25 changed files with 469 additions and 204 deletions
@@ -0,0 +1 @@
<app-divider [dividerModel]="dividerModel"></app-divider>
@@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-dividertest',
templateUrl: './dividertest.component.html',
styleUrls: [ './dividertest.component.scss' ]
})
export class DividertestComponent implements OnInit {
dividerModel = {
free: 0,
items: [ { name: "mail", value: 5 }, { name: "nextcloud", value: 15 } ],
unit: 'M',
units: [
{ name: "G", value: 1, steps: 0.5 },
{ name: "M", value: 1024, steps: 1 },
{ name: "K", value: 1024 * 1024, steps: 10 },
{ name: "B", value: 1024 * 1024 * 1024, steps: 100 }
]
};
constructor() { }
ngOnInit(): void {
}
}
@@ -1,43 +0,0 @@
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-imprint',
templateUrl: './general.imprint.html'
})
export class ImprintComponent implements OnInit {
constructor() {
}
ngOnInit(): void {
}
}
@Component({
selector: 'app-privacy-policy',
templateUrl: './general.privacy-policy.html'
})
export class PrivacyPolicyComponent implements OnInit {
constructor() {
}
ngOnInit(): void {
}
}
@Component({
selector: 'app-terms-of-service',
templateUrl: './general.terms-of-service.html'
})
export class TermsOfServiceComponent implements OnInit {
constructor() {
}
ngOnInit(): void {
}
}
@@ -1 +0,0 @@
<app-html [template]="'imprint'"></app-html>
@@ -1 +0,0 @@
<app-html [template]="'privacy-policy'"></app-html>
@@ -1 +0,0 @@
<app-html [template]="'terms-of-service'"></app-html>
@@ -0,0 +1,10 @@
<h3>{{'partey.tags' | i18n}}</h3>
<p *ngIf="!tags || tags.length == 0">{{'partey.tags.none' | i18n}}</p>
<mat-chip-list>
<mat-chip *ngFor="let tag of tags">{{tag.tag}}</mat-chip>
</mat-chip-list>
<app-partey-timeslots></app-partey-timeslots>
+24
View File
@@ -0,0 +1,24 @@
import { Component, OnInit } from '@angular/core';
import { ParteyTagsService } from '../../services/partey.service';
@Component({
selector: 'app-partey',
templateUrl: './partey.component.html',
styleUrls: [ './partey.component.scss' ]
})
export class ParteyComponent implements OnInit {
tags;
constructor(private parteyTagsService: ParteyTagsService) {
}
ngOnInit(): void {
this.parteyTagsService.get().subscribe((data: any[]) => {
this.tags = data;
})
}
}
@@ -8,7 +8,7 @@ import { FormControl } from '@angular/forms';
import { debounceTime } from 'rxjs/operators';
import { PageEvent } from '@angular/material/paginator';
import { ParteyTimeslotsService } from '../../../services/partey.timeslots.service';
import { ParteyTimeslotsService } from '../../../services/partey.service';
import { ConfirmDialog } from '../../../ui/confirm/confirm.component';
import { I18nService } from './../../../services/i18n.service';
import { AuthService } from './../../../services/auth.service';
+5 -1
View File
@@ -2,7 +2,11 @@
<mat-progress-bar *ngIf="!success && !error" mode="indeterminate"></mat-progress-bar>
<div *ngIf="success">
<h3>{{model.username}} <small *ngIf="isMe">{{'user.isMe' | i18n}}</small></h3>
<h3>{{model.username}}
<button *ngIf="isMe" mat-icon-button color="accent">
<mat-icon>star</mat-icon>
</button>
</h3>
<app-profilefields [username]="model.username"></app-profilefields>
<div *ngIf="model.aliases && model.aliases.length > 0">
<h4>{{'user.aliases' | i18n}}</h4>
+5 -4
View File
@@ -27,14 +27,15 @@ export class UserComponent implements OnInit {
this.profileService.getForUser(this.username).subscribe((data: any) => {
this.success = true;
this.model = data;
this.authService.auth.subscribe((auth: any) => {
this.isMe = auth && auth.principal && auth.principal.username == this.model.username;
});
}, error => {
this.error = error;
})
this.authService.auth.subscribe((auth: any) => {
this.isMe = auth && auth.principal && auth.principal.username == this.username;
console.log(this.isMe, auth);
});
}