Show SPARQL query on details page with link to WDQS

Closes: #23
This commit is contained in:
Edward Betts 2024-01-10 16:24:54 +00:00
parent b631476844
commit 1625f3d5d1
3 changed files with 31 additions and 4 deletions

View file

@ -54,6 +54,8 @@ L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
width: 48%
}
{{ css | safe }}
</style>
{% endblock %}
@ -96,6 +98,13 @@ L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
<p>No elements found</p>
{% endif %}
{% if query %}
<p>Searching for Wikimedia Commons categories using this SPARQL query. <a href="https://query.wikidata.org/#{{ query | urlencode }}">Wikidata Query service</a></p>
<div>
{{ query | highlight_sparql | safe }}
</div>
{% endif %}
{% for element in elements %}
{% set tags = element.tags %}
<div class="rounded border border-4 p-1 my-2{% if element_id == element.osm_id %} bg-primary-subtle{% endif %}">