From 3215333caf2f8eaafa96247940acc5112038ef53 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 13 Sep 2019 17:16:37 +0100 Subject: [PATCH] Add templates. --- templates/base.html | 24 +++++++++++++++++ templates/find_more.html | 58 ++++++++++++++++++++++++++++++++++++++++ templates/index.html | 16 +++++++++++ templates/next.html | 32 ++++++++++++++++++++++ templates/property.html | 30 +++++++++++++++++++++ 5 files changed, 160 insertions(+) create mode 100644 templates/base.html create mode 100644 templates/find_more.html create mode 100644 templates/index.html create mode 100644 templates/next.html create mode 100644 templates/property.html diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..820407a --- /dev/null +++ b/templates/base.html @@ -0,0 +1,24 @@ + + + + + + + + + {% block title %}{% endblock %} + + + {% block style %}{% endblock %} + + + + {% block content %}{% endblock %} + + + + + + {% block script %}{% endblock %} + + diff --git a/templates/find_more.html b/templates/find_more.html new file mode 100644 index 0000000..163a7af --- /dev/null +++ b/templates/find_more.html @@ -0,0 +1,58 @@ +{% extends "base.html" %} + +{% block title %}{{ label }}{% endblock %} + +{% block style %} + +{% endblock %} + +{% block content %} +
+

{{ self.title() }}

+ + {# + {% for key, label in property_labels.items() %} +

{{ label }} ({{ key }})

+
{{ item_entity['claims'][key] | pprint }}
+ {% endfor %} + #} + +

{{ '{:,d}'.format(total) }} paintings found

+ + {% for key, values in facets.items() %} +

{{ prop_labels[key] }}: + {% for v in values %} + {{ v.label }} ({{ v.count }}) + {% if not loop.last %}|{% endif %} + {% endfor %} +

+ + {% endfor %} + +
+ {% for item in items %} + {% set image = item.image %} +
+ + {# #} + +
+
{{ item.label }}
+

by {{ item.artist_name }} + {% if item.date %}({{ item.date }}){% endif %} +

+
+
+ {% endfor %} +
+ +{# + {% for item in items %} +
{{ item | pprint }}
+ {% endfor %} +#} + +
+{% endblock %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..010671c --- /dev/null +++ b/templates/index.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}Wikidata painting depicts{% endblock %} + +{% block content %} +
+ +
+ +{% endblock %} diff --git a/templates/next.html b/templates/next.html new file mode 100644 index 0000000..0c45f85 --- /dev/null +++ b/templates/next.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{% block title %}{{ label }} ({{qid }}){% endblock %} + +{% block content %} +
+

{{ self.title() }}

+ {#
{{ other | pprint }}
#} + + {# #} +
+
+ +
+ +
+

view on Wikidata

+ {% for key, prop_label in labels.items() %} + {% set claims = entity['claims'][key] %} + {% if claims %} +

{{ prop_label }} ({{ key }})

+ {% for claim in claims %} + {% set claim_qid = claim.mainsnak.datavalue.value.id %} + {{ other[claim_qid] }} ({{ claim_qid }}) + {% endfor %} + {% endif %} + {% endfor %} +
+
+ +
+{% endblock %} diff --git a/templates/property.html b/templates/property.html new file mode 100644 index 0000000..8fee4ee --- /dev/null +++ b/templates/property.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{% block title %}{{ label }}{% endblock %} + +{% block content %} +
+

{{ self.title() }}

+ +

back to index

+ + +
+ +{% endblock %}