diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html index 7ebb66e..dbfbca3 100644 --- a/static/src/app/app.component.html +++ b/static/src/app/app.component.html @@ -1,10 +1,14 @@
- + + - + + diff --git a/static/src/app/app.component.ts b/static/src/app/app.component.ts index b96b106..b82c68a 100644 --- a/static/src/app/app.component.ts +++ b/static/src/app/app.component.ts @@ -6,6 +6,8 @@ import {MatIconRegistry} from '@angular/material'; import {SpinnerService} from './services/user-interface/spinner/spinner.service'; import {SnackBarService} from './services/user-interface/snack-bar/snack-bar.service'; import {Observable} from 'rxjs'; +import {LoginService} from './services/app-user-service/login-service'; +import {BaseConfig, RouteConfig} from './app.config'; @Component({ @@ -64,6 +66,7 @@ export class AppComponent implements OnInit { }; constructor(private router: Router, + private loginService: LoginService, private iconRegistry: MatIconRegistry, private sanitizer: DomSanitizer, private spinnerService: SpinnerService, @@ -108,6 +111,14 @@ export class AppComponent implements OnInit { }); } + logout() { + this.loginService.logout(); + setTimeout(() => { + this.router.navigate([RouteConfig.overviewPath]); + }, 500); + } + + scrollToTop() { this.document.body.scrollTop = 0; // For Safari this.document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera diff --git a/static/src/app/app.config.ts b/static/src/app/app.config.ts index 548c0dd..9499120 100644 --- a/static/src/app/app.config.ts +++ b/static/src/app/app.config.ts @@ -1,7 +1,5 @@ export class AppConfig { - public readonly apiUrl = '/api'; - public readonly apiAppUserPath = this.apiUrl + '/account/'; public readonly apiAuthenticationPath = this.apiUrl + '/authenticate'; public readonly apiAwardPath = this.apiUrl + '/awardings'; @@ -44,6 +42,14 @@ export const RouteConfig = { decorationOverviewPath: 'public/decorations', }; -export const ResponsiveConfig = { - breakpointPx: 959, +export const BaseConfig = { + responsive: { + breakpointPx: 959, + }, + i18n: { + availableLanguages: [ + 'de', + 'en' + ] + } }; diff --git a/static/src/app/common/navigation/navigation-header.component.html b/static/src/app/common/navigation/navigation-header.component.html index 34f3515..6097970 100644 --- a/static/src/app/common/navigation/navigation-header.component.html +++ b/static/src/app/common/navigation/navigation-header.component.html @@ -1,5 +1,5 @@ -
+
@@ -11,7 +11,7 @@ v{{version}}
-