{% extends "default.html" %} {% block title %}Picture {{ resource.title }} | gigadata{% endblock %} {% macro shape_label(x, y, text) %} {% if text %} {{ text }} {% endif %} {% endmacro %} {% block content %}

{{ resource.title }}

by {{ resource.author.formatted_name }}

{{ resource.description }}

{% if resource.replaced_by %}

Obsolete

This picture has been replaced by {{ resource.replaced_by.title }}.

{% if have_permission %}
{% endif %} {% endif %}
{{ resource.title }} {% for region in resource.regions %} {% if region.json.type == "bbox" %} {% set centre_x = region.json.shape.x + region.json.shape.w / 2 %} {% set centre_y = region.json.shape.y + region.json.shape.h / 2 %} {% elif region.json.type == "polygon" %} {% set top = region.json.shape | sort(attribute='y') | last %} {% set left = region.json.shape | sort(attribute='x') | first %} {% set bottom = region.json.shape | sort(attribute='y') | first %} {% set right = region.json.shape | sort(attribute='x') | last %} {% set centre_x = (left.x + right.x) / 2 %} {% set centre_y = (top.y + bottom.y) / 2 %} {% elif region.json.type == "polyline" %} {# Median point #} {% set centre_x = region.json.shape | map(attribute="x") | median %} {% set centre_y = region.json.shape | map(attribute="y") | median %} {% elif region.json.type == "point" %} {% endif %} {{ shape_label(centre_x, centre_y, region.object_id) }} {% endfor %}
{% set licences = resource.licences | map(attribute="licence") | list %} {% set contains = resource.regions | map(attribute="object_id") | set | select | sort | list %}

Ratings ({{ resource.rating_totals.values() | sum }})

{% if resource.average_rating %}
{% for i in range(1, 6) %}
{% endfor %}

Average rating: {{ resource.average_rating | round(2) }} from {{ resource.rating_totals.values() | sum }} ratings

{% endif %} {% if current_user %}

Your rating

{% endif %}
{% if resource.average_rating %}
    {% for i in range(5, 0, -1) %}
  • {{ i }}: {{ resource.rating_totals[i] }}
  • {% endfor %}
{% else %}

No ratings yet.

{% endif %}

Details

Type {{ resource.nature.id }} File format {{ resource.file_format }} Size {{ size[0] }}×{{ size[1] }} Number of regions {{ resource.regions | length }} Number of labelled regions {{ resource.regions | selectattr("object_id") | list | length }} Date uploaded {{ resource.timestamp }}
{% if contains %}

Contains objects: {% for object_id in contains %} {{ object_id }}{% if not loop.last %}, {% endif %}{% endfor %}

{% else %}

No labelled regions.

{% endif %}

Licensing

Available under: {% for licence in licences %} {{ licence.title }} {% if not loop.last %}, {% endif %} {% endfor %} {% for licence in licences[:6] %} {% if licence.logo_url %} {% if licence.info_url %} {# An equivalent link already exists, only one is focusable #} {% else %} {% endif %} {% endif %} {% endfor %} {% if licences | length > 6 %}
More {% for licence in licences[6:] %} {% if licence.logo_url %} {% if licence.info_url %} {# An equivalent link already exists, only one is focusable #} {% else %} {% endif %} {% endif %} {% endfor %}
{% endif %}

Copies

{% if resource.copies %} {% else %}

This picture hasn't got any copies.

{% endif %}

Galleries

{% if resource.galleries %} {% else %}

This picture isn't in any galleries.

{% endif %}
{% endblock %}