depicts/templates/find_more.html

112 lines
3 KiB
HTML
Raw Normal View History

2019-09-29 20:19:40 +01:00
{% from "macro.html" import render_pagination %}
2019-09-13 17:16:37 +01:00
{% extends "base.html" %}
{% block title %}{{ label }}{% endblock %}
{% block style %}
<style>
.card-columns { column-count: 6; }
</style>
{% endblock %}
{% block content %}
<div class="m-3">
<h1>{{ self.title() }}</h1>
{#
{% for key, label in property_labels.items() %}
<h4>{{ label }} ({{ key }})</h4>
<pre>{{ item_entity['claims'][key] | pprint }}</pre>
{% endfor %}
#}
<p>
Current filter &ndash;
{% for pid, qid in params %}
<span>{{ prop_labels[pid] }}: {{ linked_labels[qid] }}
<a href="{{ set_url_args(page=None, **{pid: None}) }}">[remove filter]</a></span>
{% endfor %}
</p>
<p>
<a href="{{ url_for('browse_page') }}">browse index</a>
{% for pid, qid in params %}
| <a href="{{ url_for('property_query_page', property_id=pid[1:]) }}">browse {{ labels[pid] }} list</a>
{% endfor %}
</p>
<p>{{ '{:,d}'.format(total) }} artworks found</p>
2019-09-13 17:16:37 +01:00
2019-10-14 14:33:29 +01:00
<p class="mb-3">
<a href="#" id="toggle-filters" class="btn btn-primary">toggle filters</a>
{#
2019-10-14 14:33:29 +01:00
<a href="{{ catalog_url }}" class="btn btn-primary">catalog artwork</a>
#}
2019-10-14 14:33:29 +01:00
</p>
2019-09-27 15:38:36 +01:00
<div id="filters">
2019-09-13 17:16:37 +01:00
{% for key, values in facets.items() %}
<p>{{ prop_labels[key] }}:
{% for v in values %}
<a href="{{ set_url_args(page=None, **{key: v.qid}) }}">{{ v.label }}</a>
({{ '{:,d}'.format(v.count) }})
2019-09-13 17:16:37 +01:00
{% if not loop.last %}|{% endif %}
{% endfor %}
</p>
{% endfor %}
2019-09-27 15:38:36 +01:00
</div>
2019-09-13 17:16:37 +01:00
{{ render_pagination(pager) }}
<div class="row" data-masonry='{"percentPosition": true }'>
2019-09-13 17:16:37 +01:00
{% for item in items %}
{% set image = item.image %}
<div class="col-sm-6 col-lg-4 mb-4">
2019-09-13 17:16:37 +01:00
<div class="card">
<a href="{{ url_for('item_page', item_id=item.item_id) }}">
2019-09-13 17:16:37 +01:00
{# <img src="{{ image.thumburl }}" height="{{ image.thumbheight }}" width="{{ image.thumbwidth }}" class="card-img-top"></a> #}
<img src="{{ image.thumburl }}" class="card-img-top"></a>
<div class="card-body">
2019-12-18 18:48:14 +00:00
<h5 class="card-title">{{ item.label or '[no title]' }}</h5>
<p class="card-text">
<div>
{% for qid in item.instance_of %}
{% if not loop.first %} / {% endif %}
<span>{{ linked_labels[qid] }}</span>
{% endfor %}
</div>
{% if item.artist %}
by {{ linked_labels[item.artist] }}
{% endif %}
2019-09-13 17:16:37 +01:00
{% if item.date %}({{ item.date }}){% endif %}
2019-11-25 15:46:05 +00:00
<div>
{% for depicts_qid in item.depicts %}
<span class="badge badge-primary">{{ linked_labels[depicts_qid] }}</span>
2019-11-25 15:46:05 +00:00
{% endfor %}
</div>
2019-09-13 17:16:37 +01:00
</p>
</div>
</div>
</div>
2019-09-13 17:16:37 +01:00
{% endfor %}
</div>
2019-09-29 20:19:40 +01:00
{{ render_pagination(pager) }}
2019-09-13 17:16:37 +01:00
</div>
{% endblock %}
2019-09-27 15:38:36 +01:00
{% block script %}
<script src="https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous" async></script>
2019-09-27 15:38:36 +01:00
<script>
$('#filters').hide();
$('#toggle-filters').click((event) => {
event.preventDefault();
$('#filters').toggle()
});
</script>
{% endblock %}