From e9193be3cce949df99dc72d664937c14b3405b4a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 10 Jan 2024 16:26:24 +0000 Subject: [PATCH] Add missing templates --- templates/map.html | 84 +++++++++++++++++++++++++++++++++++++++ templates/pin_detail.html | 34 ++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 templates/map.html create mode 100644 templates/pin_detail.html diff --git a/templates/map.html b/templates/map.html new file mode 100644 index 0000000..8dc9533 --- /dev/null +++ b/templates/map.html @@ -0,0 +1,84 @@ +{% extends "base.html" %} + +{% block title %}Geocode to Commons{% endblock %} + +{% block link %} + +{% endblock %} + +{% block script %} + + + + +{% endblock %} + +{% block style %} + +{% endblock %} + +{% block content %} +
+
+

Geocode coordinates to Commons Category

+ +
Click on the map
+ +
+ +{% endblock %} diff --git a/templates/pin_detail.html b/templates/pin_detail.html new file mode 100644 index 0000000..feca33c --- /dev/null +++ b/templates/pin_detail.html @@ -0,0 +1,34 @@ +

API returns

+
{{ result | tojson(indent=2) }}
+ +{% if result.wikidata %} +

Wikidata item: {{ result.wikidata }}

+{% endif %} + +{% if result.commons_cat %} +

Commons category: {{result.commons_cat.title }}

+{% endif %} + +{% if elements %} +

{{ elements.count() }} surrounding elements found

+{% else %} +

No elements found

+{% endif %} + +{% if query %} +

Searching for Wikimedia Commons categories using this SPARQL query. Wikidata Query service

+
+{{ query | highlight_sparql | safe }} +
+{% endif %} + +{% for element in elements %} +{% set tags = element.tags %} +
+ {% for key, value in element.tags.items() if not (key == "way_area" or "name:" in key or key.startswith("source")) %} +
{{ key }}: {{ value }}
+ {% endfor %} +
+{% endfor %} + +