mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 11:32:47 +00:00
Use icons to show type of items in service
This commit is contained in:
parent
e57b65418e
commit
ff8d8a5a9b
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<a mat-list-item *ngFor="let item of items;let counter = index;" (click)="onItemSelected(counter)" [class.selected]="item.selected">
|
<a mat-list-item *ngFor="let item of items;let counter = index;" (click)="onItemSelected(counter)" [class.selected]="item.selected">
|
||||||
<mat-icon mat-list-icon>queue_music</mat-icon>
|
<mat-icon mat-list-icon>{{ getIcon(item) }}</mat-icon>
|
||||||
<p mat-line>{{item.title}}<p>
|
<p mat-line>{{item.title}}<p>
|
||||||
</a>
|
</a>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
|
@ -2,16 +2,17 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Router } from '@angular/router'
|
import { Router } from '@angular/router'
|
||||||
|
|
||||||
import { OpenLPService } from '../../openlp.service';
|
import { OpenLPService } from '../../openlp.service';
|
||||||
|
import { ServiceItem } from '../../responses';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'openlp-remote-service',
|
selector: 'openlp-remote-service',
|
||||||
templateUrl: './service.component.html',
|
templateUrl: './service.component.html',
|
||||||
styleUrls: ['./service.component.scss'],
|
styleUrls: ['./service.component.scss'],
|
||||||
providers: [OpenLPService]
|
providers: [OpenLPService]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class OpenLPServiceComponent implements OnInit {
|
export class OpenLPServiceComponent implements OnInit {
|
||||||
items = [];
|
items: ServiceItem[] = [];
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getServiceItems();
|
this.getServiceItems();
|
||||||
}
|
}
|
||||||
@ -29,4 +30,21 @@ export class OpenLPServiceComponent implements OnInit {
|
|||||||
openlpService.stateChanged$.subscribe(item => this.getServiceItems());
|
openlpService.stateChanged$.subscribe(item => this.getServiceItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIcon(item: ServiceItem): string {
|
||||||
|
if (item.plugin == 'songs') {
|
||||||
|
return 'queue_music';
|
||||||
|
} else if (item.plugin == 'images') {
|
||||||
|
return 'image';
|
||||||
|
} else if (item.plugin == 'bibles') {
|
||||||
|
return 'book';
|
||||||
|
} else if (item.plugin == 'media') {
|
||||||
|
return 'movie';
|
||||||
|
} else if (item.plugin == 'custom') {
|
||||||
|
return 'description';
|
||||||
|
} else if (item.plugin == 'presentations') {
|
||||||
|
return 'slideshow';
|
||||||
|
}
|
||||||
|
return 'crop_square';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,5 +30,4 @@ export interface ServiceItem {
|
|||||||
plugin: string;
|
plugin: string;
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user