roundabout,
created on Saturday, 14 September 2024, 10:33:53 (1726310033),
received on Saturday, 14 September 2024, 10:51:14 (1726311074)
Author identity: vlad <vlad.muntoiu@gmail.com>
e7492564fc7da6262346279efc392bc9c3107721
templates/picture.html
@@ -216,50 +216,71 @@
</x-vbox>
</x-hbox>
<h2>Copies</h2>
<ul class="thumbnail-list">
{% for copy in resource.copies %}
<li>
<a href="/picture/{{ copy.id }}">
<div class="annotation-zone">
<img src="/raw/picture/{{ copy.id }}" alt="{{ copy.title }}">
{% if resource.copies %}
<ul class="thumbnail-list">
{% for copy in resource.copies %}
<li>
<a href="/picture/{{ copy.id }}">
<div class="annotation-zone">
<img src="/raw/picture/{{ copy.id }}" alt="{{ copy.title }}">
{% for region in copy.regions %}
{% if region.json.type == "bbox" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<rect x="{{ region.json.shape.x * copy.width }}"
y="{{ region.json.shape.y * copy.height }}"
width="{{ region.json.shape.w * copy.width }}"
height="{{ region.json.shape.h * copy.height }}"
fill="none" class="shape-bbox shape"
></rect>
</svg>
{% elif region.json.type == "polygon" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<polygon points="{% for point in region.json.shape %}{{ point.x * copy.width }},{{ point.y * copy.height }} {% endfor %}" fill="none" class="shape-polygon shape"></polygon>
</svg>
{% elif region.json.type == "polyline" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<polyline points="{% for point in region.json.shape %}{{ point.x * copy.width }},{{ point.y * copy.height }} {% endfor %}" fill="none" class="shape-polyline shape"></polyline>
</svg>
{% elif region.json.type == "point" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<circle cx="{{ region.json.shape.x * copy.width }}" cy="{{ region.json.shape.y * copy.height }}" r="0" fill="none" class="shape-point shape"></circle>
</svg>
{% endif %}
{% endfor %}
</div>
<div class="list-detail">
{{ copy.title }}
{% for region in copy.regions %}
{% if region.json.type == "bbox" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<rect x="{{ region.json.shape.x * copy.width }}"
y="{{ region.json.shape.y * copy.height }}"
width="{{ region.json.shape.w * copy.width }}"
height="{{ region.json.shape.h * copy.height }}"
fill="none" class="shape-bbox shape"
></rect>
</svg>
{% elif region.json.type == "polygon" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<polygon points="{% for point in region.json.shape %}{{ point.x * copy.width }},{{ point.y * copy.height }} {% endfor %}" fill="none" class="shape-polygon shape"></polygon>
</svg>
{% elif region.json.type == "polyline" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<polyline points="{% for point in region.json.shape %}{{ point.x * copy.width }},{{ point.y * copy.height }} {% endfor %}" fill="none" class="shape-polyline shape"></polyline>
</svg>
{% elif region.json.type == "point" %}
<svg class="shape-container" viewBox="0 0 {{ copy.width }} {{ copy.height }}">
<circle cx="{{ region.json.shape.x * copy.width }}" cy="{{ region.json.shape.y * copy.height }}" r="0" fill="none" class="shape-point shape"></circle>
</svg>
{% endif %}
{% endfor %}
</div>
<div class="list-detail">
{{ copy.title }}
</div>
</a>
<div class="list-more">
<form method="POST" action="/picture/{{ copy.id }}/mark-replacement">
<button type="submit">Designate replacement</button>
</form>
</div>
</a>
<div class="list-more">
<form method="POST" action="/picture/{{ copy.id }}/mark-replacement">
<button type="submit">Designate replacement</button>
</form>
</div>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% else %}
<p>This picture hasn't got any copies.</p>
{% endif %}
<h2>Galleries</h2>
{% if resource.galleries %}
<ul class="thumbnail-list">
{% for gallery in resource.galleries %}
<li>
<a href="/gallery/{{ gallery.gallery.id }}">
<div class="list-detail">
{{ gallery.gallery.title }}
</div>
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>This picture isn't in any galleries.</p>
{% endif %}
</x-vbox>
</x-frame>
</div>