2019-11-26 14:01:14 +00:00
{% extends "base.html" %}
{% block content %}
< div class = "p-2" >
< div class = "container" >
2019-11-26 16:07:57 +00:00
< div class = "row" >
< div class = "col" >
< h1 > Wikidata Query Service report< / h1 >
< p > This report lists every query sent to the < a href = "https://query.wikidata.org/" > Wikidata Query Service< / a > (WQDS) by WADE. Failed queries are in red.< / p >
< / div >
< / div >
2019-11-26 14:01:14 +00:00
< div class = "row" >
< div class = "col-2" > when< / div >
< div class = "col-3" > page< / div >
< div class = "col-2" > query time< / div >
< div class = "col" > options< / div >
< / div >
{% for obj in q %}
{% if obj.status_code != 200 %}{% set class=" text-light bg-danger"%}{% endif %}
< div class = "row" >
< div class = "col-2{{ class }}" >
{{ obj.start_time.strftime('%Y %b %d %H:%M') }}
< / div >
< div class = "col-3" > < a href = "{{ obj.path }}" > {{ obj.path }}< / a > < / div >
< div class = "col-2{{ class }}" >
{{ obj.display_seconds }} seconds
< / div >
< div class = "col" >
[< a href = "#" class = "toggle" data-id = "{{ obj.id }}" > show/hide query< / a > ]
[< a href = "https://query.wikidata.org/#{{ obj.sparql_query | urlencode }}" > Wikidata Query Service< / a > ]
< / div >
< / div >
< div id = "query_{{ obj.id }}" class = "row sparql" >
< div class = "col" >
< pre > {{ obj.sparql_query }}< / pre >
< / div >
< / div >
< div class = "row error" >
< div class = "col" >
{% if obj.status_code != 200 %}
< div > status code: {{ obj.status_code }}< / div >
< pre > {{ obj.error_text }}< / pre >
{% endif %}
< / div >
< / div >
{% endfor %}
< / div >
< / div >
{% endblock %}
{% block script %}
< script >
$('.sparql').hide();
$('.error').hide();
$('.toggle').click(function() {
var query_id = $(this).data('id');
$('#query_' + query_id).toggle();
});
< / script >
{% endblock %}