Commit fef6f14f authored by Thibault Ehrhart's avatar Thibault Ehrhart

Display article photo in details page

parent 26a4f9ea
......@@ -43,6 +43,7 @@
<li class="infobox-item" *ngIf="selectedItem.p3090"><b>Flight number:</b> {{ selectedItem.p3090 }}</li>
</ul>
</div>
<div class="image" *ngIf="selectedItem.associatedMedias && selectedItem.associatedMedias.length > 0" [ngStyle]="{ 'background-image': 'url(' + selectedItem.associatedMedias[0] + ')' }"></div>
<div class="text" *ngIf="selectedItem.description" [innerHTML]="selectedItem.description | underline : selectedItem.sources | colorize : (selectedItem.annotations || [])"></div>
</div>
</div>
......
......@@ -14,6 +14,14 @@
padding-right: 1em;
}
.image {
background-repeat: no-repeat;
background-color: transparent;
background-size: cover;
width: 100%;
height: 200px;
}
.infobox {
float: right;
max-width: 40%;
......
......@@ -114,7 +114,7 @@ export class NewsService {
// Generate query
let query = `
${this.getPrefixes()}
SELECT DISTINCT ?s ?dateCreated ?dateModified ?datePublished ?description ?genre ?genreLabel (GROUP_CONCAT(?subject; separator="|") AS ?subjects) (GROUP_CONCAT(?subjectLabel; separator="|") AS ?subjectsLabels) ?dateline ?headline ?identifier ?language ?slug ?country ?locality ?annotations ?p1561 ?p1339 ?p1120 ?p137 ?p426 ?p3090
SELECT DISTINCT ?s ?dateCreated ?dateModified ?datePublished ?description ?genre ?genreLabel (GROUP_CONCAT(?subject; separator="|") AS ?subjects) (GROUP_CONCAT(?subjectLabel; separator="|") AS ?subjectsLabels) ?dateline ?headline ?identifier ?language ?slug (GROUP_CONCAT(?associatedMedia; separator="|") AS ?associatedMedias) ?country ?locality ?annotations
FROM <http://asrael.eurecom.fr/agencefrancepresse/news>
WHERE {
?s a rnews:NewsItem .
......@@ -144,13 +144,7 @@ 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 rnews:associatedMedia ?associatedMedia . }
OPTIONAL {
?s schema:contentLocation ?location .
......@@ -191,7 +185,7 @@ export class NewsService {
binding[k] = binding[k].value;
}
// Split subjects
// Subjects
if (binding.subjects) {
binding.subjects = binding.subjects.split('|');
}
......@@ -199,6 +193,11 @@ export class NewsService {
binding.subjectsLabels = binding.subjectsLabels.split('|');
}
// Associated medias
if (binding.associatedMedias) {
binding.associatedMedias = binding.associatedMedias.split('|');
}
// Annotations
if (binding.annotations) {
// Split and decode the values
......
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