roundabout,
created on Thursday, 5 September 2024, 14:07:17 (1725545237),
received on Thursday, 5 September 2024, 14:07:20 (1725545240)
Author identity: vlad <vlad.muntoiu@gmail.com>
bcc8cfa1b1720be208a794b23a08b4a54a9b40f7
app.py
@@ -42,6 +42,10 @@ def median(value):
return sorted(value)[len(value) // 2] @app.template_filter("set") def set_filter(value): return set(value) with app.app_context(): class User(db.Model):
templates/picture.html
@@ -71,35 +71,43 @@
Show objects </label> </x-buttonbox> <div class="icon-explainer"><span>Type:</span><span>{{ resource.nature.id }}</span><span>File format:</span><span>{{ resource.file_format }}</span><span>Size:</span><span>{{ size[0] }}×{{ size[1] }}</span></div>{% set licences = resource.licences | map(attribute="licence") | list %} <x-hbox><small class="picture-licensing-info">Available under:{% for licence in licences %}<a href="{{ licence.url }}" target="_blank">{{ licence.title }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</small><x-vbox class="picture-licence-logos">{% for licence in licences %}{% if licence.logo_url %}<a href="{{ licence.url }}" target="_blank" tabindex="-1">{# An equivalent link already exists, only one is focusable #}<img src="{{ licence.logo_url }}" alt="{{ licence.title }}" class="licence-logo">{% set contains = resource.regions | map(attribute="object_id") | set | sort | select | list %} <x-vbox> <div class="icon-explainer"> <span>Type</span> <span>{{ resource.nature.id }}</span> <span>File format</span> <span>{{ resource.file_format }}</span> <span>Size</span> <span>{{ size[0] }}×{{ size[1] }}</span> <span>Number of regions</span> <span>{{ resource.regions | length }}</span> <span>Number of labelled regions</span> <span>{{ resource.regions | selectattr("object_id") | list | length }}</span> </div> Contains objects: {{ contains | join(", ") }} <x-hbox> <small class="picture-licensing-info"> Available under: {% for licence in licences %} <a href="{{ licence.url }}" target="_blank"> {{ licence.title }}</a> {% endif %}{% endfor %}</x-vbox></x-hbox>{% if not loop.last %}, {% endif %} {% endfor %} </small> <x-vbox class="picture-licence-logos"> {% for licence in licences %} {% if licence.logo_url %} <a href="{{ licence.url }}" target="_blank" tabindex="-1"> {# An equivalent link already exists, only one is focusable #} <img src="{{ licence.logo_url }}" alt="{{ licence.title }}" class="licence-logo"> </a> {% endif %} {% endfor %} </x-vbox> </x-hbox> </x-vbox></x-frame> {% endblock %}