Skip to content

Commit

Permalink
Use SQL query API in zone index view, redesign to include signage, ma…
Browse files Browse the repository at this point in the history
…ke better use of available space
  • Loading branch information
lcdr authored and Xiphoseer committed Apr 6, 2024
1 parent c6d52f1 commit 5d360f3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
21 changes: 21 additions & 0 deletions src/app/zones/zone-index/zone-index.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.zones {
display: flex;
flex-wrap: wrap;
gap: 0 20px;
justify-content: center;
padding: 0;
text-align: center;
}

.zones a {
display: block;
text-decoration: none;
transition: transform 0.1s, filter 0.1s;
width: 204px;
}

.zones a:hover {
color: var(--lu-yellow);
transform: scale(105%);
filter: brightness(115%);
}
30 changes: 24 additions & 6 deletions src/app/zones/zone-index/zone-index.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
<ul class="breadcrumbs">
<li>Zones</li>
</ul>
<h2>Zone Index</h2>
<ul class="zones">
<li *ngFor="let item of ($zones | async | keyvalue)">
<a routerLink="/zones/{{item.key}}">{{item.value.DisplayDescription}}</a>&nbsp;<span class="badge">{{item.key}}</span>
</li>
</ul>
<h2>Zones</h2>
<ng-container *ngIf="'
select
zoneID in (1001, 1100, 1149, 1150, 1151, 1200, 1201, 1250, 1251, 1260, 1300, 1350, 1351, 1400, 1450, 1451, 1600, 1800, 1900, 2000) as hasSignage,
zoneID,
DisplayDescription_en_US as DisplayDescription
from ZoneTable
where DisplayDescription_en_US is not null and zoneName not like \'%removed%\'
order by hasSignage desc, ((zoneID-1) % 100 / -49)
' | query | group:'hasSignage'; let zones">
<h3>Key Zones</h3>
<section class="zones">
<a *ngFor="let zone of zones[1]" routerLink="/zones/{{zone.zoneID}}">
<lux-signage [id]="zone.zoneID | num"></lux-signage>
<p>{{zone.DisplayDescription}}</p>
</a>
</section>
<h3>Other Zones</h3>
<section class="zones">
<a *ngFor="let zone of zones[0]" routerLink="/zones/{{zone.zoneID}}">
<p>{{zone.DisplayDescription}}</p>
</a>
</section>
</ng-container>
18 changes: 2 additions & 16 deletions src/app/zones/zone-index/zone-index.component.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Locale_ZoneTable } from '../../../defs/locale';
import { LuCoreDataService } from '../../util/services/lu-core-data.service';
import { Component } from '@angular/core';

@Component({
selector: 'app-zone-index',
templateUrl: './zone-index.component.html',
styleUrls: ['./zone-index.component.css']
})
export class ZoneIndexComponent implements OnInit {

$zones: Observable<{ [key: string]: Locale_ZoneTable }>;

constructor(
private luCoreData: LuCoreDataService,
) { }

ngOnInit() {
this.$zones = this.luCoreData.getLocaleSubtree<Locale_ZoneTable>('ZoneTable');
}
}
export class ZoneIndexComponent {}

0 comments on commit 5d360f3

Please sign in to comment.