Skip to content

Commit

Permalink
PROBE-219: Add status
Browse files Browse the repository at this point in the history
  • Loading branch information
MPParsley committed Sep 3, 2024
1 parent c904b6b commit 72c8707
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion webcomponents/reglementen-detail/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ <h1>Reglementen detail</h1>
datum="2022-10-06"
url="https://ebesluitvorming.gent.be/zittingen/22.0117.2331.2297/agendapunten/22.0823.8239.1746"
type="Aanvullende reglementen op het wegverkeer"
status="Goedgekeurd"
>
</reglementen-detail>

<reglementen-detail
sparql-endpoint="https://probe.stad.gent/sparql"
uri="https://data.gent.be/id/besluiten/22.0823.8239.1746"
uri="https://data.gent.be/id/besluiten/23.0420.7900.7897"
>
</reglementen-detail>

Expand Down
10 changes: 8 additions & 2 deletions webcomponents/reglementen-detail/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class ReglementenDetail extends HTMLElement {
this.url = this.getAttribute('url');
this.type = this.getAttribute('type');
this.innerHTML += this.createDetail();
this.status = this.getAttribute('status');
this.status_green = ['Aanvaard tot de zitting als hoogdringend agendapunt', 'Goedgekeurd', 'Behandeld'].includes(this.getAttribute('status'));;
this.status_red = ['Afgekeurd', 'Afgevoerd', 'Geweigerd', 'Ingetrokken'].includes(this.getAttribute('status'));;
this.status_na = ['Gedeeltelijke ingetrokken', 'Verdaagd'].includes(this.getAttribute('status'));;
}
}

Expand All @@ -36,7 +40,7 @@ class ReglementenDetail extends HTMLElement {
<dt>Type:</dt>
<dd>${this.type}</dd>
</dl>
<span class="resolutions-detail__status">&nbsp;</span>
<span class="resolutions-detail__status resolutions-detail__status--${this.status_green ? 'true' : this.status_red ? 'false' : 'void'}" >${this.status}</span>
<a href="${this.url}" class="teaser-overlay-link" tabindex="-1" aria-hidden="true">${this.titel}</a>
</div>
`);
Expand All @@ -48,6 +52,7 @@ class ReglementenDetail extends HTMLElement {
this.datum = this.formatDate(reglement.date.value)
this.url = reglement.url.value;
this.type = '@todo';
this.status = reglement.status.value || '';
this.innerHTML += this.createDetail();
}

Expand Down Expand Up @@ -88,10 +93,11 @@ class ReglementenDetail extends HTMLElement {
PREFIX eli: <http://data.europa.eu/eli/ontology#>
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
SELECT ?title ?date ?url WHERE {
SELECT ?title ?date ?url ?status WHERE {
<${uri}> a besluit:Besluit ;
eli:date_publication ?date ;
eli:title_short ?title ;
prov:wasGeneratedBy/besluit:heeftStemming/besluit:gevolg ?status ;
prov:wasDerivedFrom ?url .
} LIMIT 1`
}
Expand Down

0 comments on commit 72c8707

Please sign in to comment.