Commit 35ebbb9c authored by Thibault Ehrhart's avatar Thibault Ehrhart

Update infobox UI

parent 38139033
......@@ -22,9 +22,11 @@
<div class="infobox">
<span class="infobox-title">Infobox</span>
<ul class="infobox-content">
<li class="infobox-item">Location: {{ selectedItem.locality }} - {{ getCountryName(selectedItem.country) }}</li>
<li class="infobox-item">Date: {{ selectedItem.dateCreated | date: 'dd/MM/yyyy' }}</li>
<li *ngIf="selectedItem.annotations.length > 0">
<li class="infobox-item" *ngIf="selectedItem.locality || selectedItem.country"><b>Location:</b> {{ selectedItem.locality }} - {{ getCountryName(selectedItem.country) }}</li>
<li class="infobox-item" *ngIf="selectedItem.dateCreated"><b>Date:</b> {{ selectedItem.dateCreated | date: 'dd/MM/yyyy' }}</li>
<li class="infobox-item" *ngIf="selectedItem.subject"><b>Subject:</b> <a [href]="selectedItem.subject" target="_blank">{{ selectedItem.subjectLabel }}</a></li>
<li class="infobox-item" *ngIf="selectedItem.genre"><b>Genre:</b> <a [href]="selectedItem.genre" target="_blank">{{ selectedItem.genreLabel }}</a></li>
<li *ngIf="selectedItem.annotations && selectedItem.annotations.length > 0">
<div class="infobox-item" *ngFor="let annotation of selectedItem.annotations">
<span [ngClass]="['colorize', 'color-' + getAnnotationColor(annotation.type)]">{{ getAnnotationName(annotation.type) }}:</span>
<span *ngFor="let value of annotation.values; let last = last">
......@@ -32,6 +34,12 @@
</span>
</div>
</li>
<li class="infobox-item" *ngIf="selectedItem.p1561"><b>Number of survivors:</b> {{ selectedItem.p1561 }}</li>
<li class="infobox-item" *ngIf="selectedItem.p1339"><b>Number of injured:</b> {{ selectedItem.p1339 }}</li>
<li class="infobox-item" *ngIf="selectedItem.p1120"><b>Number of deaths:</b> {{ selectedItem.p1120 }}</li>
<li class="infobox-item" *ngIf="selectedItem.p137"><b>Operator:</b> {{ selectedItem.p137 }}</li>
<li class="infobox-item" *ngIf="selectedItem.p426"><b>Aircraft registration:</b> {{ selectedItem.p426 }}</li>
<li class="infobox-item" *ngIf="selectedItem.p3090"><b>Flight number:</b> {{ selectedItem.p3090 }}</li>
</ul>
</div>
<div class="text" *ngIf="selectedItem.description" [innerHTML]="selectedItem.description | colorize : selectedItem.annotations | highlight : search.searchParams.keywords | underline : selectedItem.sources"></div>
......
......@@ -125,6 +125,14 @@ export class NewsService {
OPTIONAL { ?s rnews:identifier ?identifier . }
OPTIONAL { ?s rnews:inLanguage ?language . }
OPTIONAL { ?s rnews:slug ?slug . }
OPTIONAL { ?s wdt:P1561 ?p1561 . }
OPTIONAL { ?s wdt:P1339 ?p1339 . }
OPTIONAL { ?s wdt:P1120 ?p1120 . }
OPTIONAL { ?s wdt:P137 ?p137 . }
OPTIONAL { ?s wdt:P426 ?p426 . }
OPTIONAL { ?s wdt:P3090 ?p3090 . }
OPTIONAL {
?s schema:contentLocation ?location .
OPTIONAL {
......@@ -223,7 +231,10 @@ export class NewsService {
let locationFilter = context.location ? 'FILTER(IF(BOUND(?country), contains(?country, "' + context.location + '"), true))' : '';
// Keywords filter
let keywordsFilter = context.keywords ? '?description bif:contains "\'' + context.keywords + '*\'" .' : '';
let keywordsFilter = context.keywords ? 'FILTER(CONTAINS(?description, ' + JSON.stringify(context.keywords) + ')) ' : '';
// Schema filter
let schemaFilter = context.schema ? '?s wdt:P1120 ?p1120 .' : '';
// Annotations filter
let annotationsFilter = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment