Initial commit
This commit is contained in:
33
src/app/admin-view/admin-view.component.ts
Normal file
33
src/app/admin-view/admin-view.component.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { LocalStorageService } from '../services/local-storage.service';
|
||||
import { Link } from '../types/link';
|
||||
import { ToolbarService } from './toolbar.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-admin-view',
|
||||
templateUrl: './admin-view.component.html',
|
||||
styleUrls: ['./admin-view.component.scss']
|
||||
})
|
||||
export class AdminViewComponent {
|
||||
private readonly _LINKS: Link[] = [
|
||||
{ title: "Wiadomości", icon: "newspaper", href: "news", enabled: this.ls.permChecker(1) && this.ls.capCheck(1) },
|
||||
{ title: "Jadłospis", icon: "restaurant_menu", href: "menu", enabled: this.ls.permChecker(2) && this.ls.capCheck(2) },
|
||||
{ title: "Wysyłanie powiadomień", icon: "notifications", href: "notifications", enabled: this.ls.permChecker(4) && this.ls.capCheck(4) },
|
||||
{ title: "Grupy", icon: "groups", href: "groups", enabled: this.ls.permChecker(8) && this.ls.capCheck(8) },
|
||||
{ title: "Zarządzanie kontami", icon: "manage_accounts", href: "accounts", enabled: this.ls.permChecker(16) },
|
||||
{ title: "Klucze", icon: "key", href: "keys", enabled: this.ls.permChecker(64) && this.ls.capCheck(32) },
|
||||
{ title: "Czystość", icon: "cleaning_services", href: "grades", enabled: this.ls.permChecker(128) && this.ls.capCheck(16) },
|
||||
{ title: "Frekwencja", icon: "checklist", href: "attendence", enabled: false },
|
||||
{ title: "Ustawienia", icon: "settings_applications", href: "settings", enabled: this.ls.permChecker(32) },
|
||||
{ title: "Instrukcje", icon: "description", href: "guide", enabled: true }
|
||||
];
|
||||
public get LINKS(): Link[] {
|
||||
return this._LINKS.filter(v => v.enabled);
|
||||
}
|
||||
constructor(readonly title: Title, readonly router: Router, readonly ls: LocalStorageService, protected toolbar: ToolbarService) { }
|
||||
goNormal() {
|
||||
this.router.navigateByUrl('app')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user