object.html
HTML document, ASCII text
1
{% extends "default.html" %}
2
{% block title %}Object {{ object.id }} | {{ site_name }}{% endblock %}
3
4
{% block content %}
5
<x-frame style="--width: 768px">
6
<h1>{{ object.id }}</h1>
7
<p>{{ object.description }}</p>
8
<h2>Supersets</h2>
9
{% if object.parent_links %}
10
<ul>
11
{% for parent in object.parent_links %}
12
{% set superset = parent.parent %}
13
<li><a href="/object/{{ superset.id }}">{{ superset.id }}</a></li>
14
{% endfor %}
15
</ul>
16
{% else %}
17
<p>This object has no supersets.</p>
18
{% endif %}
19
{% if object.child_links %}
20
<h2>Subsets</h2>
21
<ul>
22
{% for child in object.child_links %}
23
{% set subset = child.child %}
24
<li><a href="/object/{{ subset.id }}">{{ subset.id }}</a></li>
25
{% endfor %}
26
</ul>
27
{% else %}
28
<p>This object has no subsets.</p>
29
{% endif %}
30
<h2>Pictures with this object</h2>
31
<ul class="thumbnail-list">
32
{% for resource in resources %}
33
<li>
34
<a href="/picture/{{ resource.id }}">
35
<div class="annotation-zone">
36
<img src="/raw/picture/{{ resource.id }}" alt="{{ resource.title }}">
37
{% for i in PictureRegion.query.filter_by(resource=resource, object=object) %}
38
{% if i.json.type == "bbox" %}
39
<svg class="shape-container" viewBox="0 0 {{ resource.width }} {{ resource.height }}">
40
<rect x="{{ i.json.shape.x * resource.width }}"
41
y="{{ i.json.shape.y * resource.height }}"
42
width="{{ i.json.shape.w * resource.width }}"
43
height="{{ i.json.shape.h * resource.height }}"
44
fill="none" class="shape-bbox shape"
45
></rect>
46
</svg>
47
{% elif i.json.type == "polygon" %}
48
<svg class="shape-container" viewBox="0 0 {{ resource.width }} {{ resource.height }}">
49
<polygon points="{% for point in i.json.shape %}{{ point.x * resource.width }},{{ point.y * resource.height }} {% endfor %}" fill="none" class="shape-polygon shape"></polygon>
50
</svg>
51
{% elif i.json.type == "polyline" %}
52
<svg class="shape-container" viewBox="0 0 {{ resource.width }} {{ resource.height }}">
53
<polyline points="{% for point in i.json.shape %}{{ point.x * resource.width }},{{ point.y * resource.height }} {% endfor %}" fill="none" class="shape-polyline shape"></polyline>
54
</svg>
55
{% elif i.json.type == "point" %}
56
<svg class="shape-container" viewBox="0 0 {{ resource.width }} {{ resource.height }}">
57
<circle cx="{{ i.json.shape.x * resource.width }}" cy="{{ i.json.shape.y * resource.height }}" r="0" fill="none" class="shape-point shape"></circle>
58
</svg>
59
{% endif %}
60
{% endfor %}
61
</div>
62
<div class="list-detail">
63
{{ resource.title }}
64
</div>
65
</a>
66
</li>
67
{% endfor %}
68
</ul>
69
{% include "pagination.html" %}
70
</x-frame>
71
{% endblock %}