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