edit-picture.html
    
    HTML document, ASCII text
        
            1
            {% extends "default.html" %} 
        
            2
             
        
            3
            {% block nav_title %}Edit '{{ resource.title }}'{% endblock %} 
        
            4
            {% block title %}Edit picture '{{ resource.title }}' | {{ site_name }}{% endblock %} 
        
            5
            {% set back_url = "/picture/" + resource.id|string %} 
        
            6
             
        
            7
            {% block content %} 
        
            8
                <x-frame style="--width: 768px"> 
        
            9
                    <form class="vbox" method="POST"> 
        
            10
                        <label> 
        
            11
                            <span class="required-asterisk">Title</span> 
        
            12
                            <input type="text" name="title" value="{{ resource.title }}" required> 
        
            13
                        </label> 
        
            14
                        <label> 
        
            15
                            Description 
        
            16
                            <textarea name="description">{{ resource.description }}</textarea> 
        
            17
                        </label> 
        
            18
                        <span class="required-asterisk">Picture type</span> 
        
            19
                        <div class="single-select" style="height: clamp(320px, 25vh, 640px)"> 
        
            20
                            {% for type in types %} 
        
            21
                                <div class="image-type-selection"> 
        
            22
                                    <label> 
        
            23
                                        <input name="nature" type="radio" value="{{ type.id }}" {% if type == resource.nature %}checked{% endif %} required> 
        
            24
                                        <span class="image-type-title"> 
        
            25
                                            <span class="image-type-name"> 
        
            26
                                                {{ type.id }} 
        
            27
                                            </span> 
        
            28
                                        </span> 
        
            29
                                    </label> 
        
            30
                                    <div class="image-type-selection-info"> 
        
            31
                                        <p>{{ type.description | safe }}</p> 
        
            32
                                    </div> 
        
            33
                                </div> 
        
            34
                            {% endfor %} 
        
            35
                        </div> 
        
            36
                        <label> 
        
            37
                            Origin URL 
        
            38
                            <input type="url" name="origin_url" value="{{ resource.origin_url }}"> 
        
            39
                            Can be left blank if not applicable. 
        
            40
                        </label> 
        
            41
                        <span class="required-asterisk">Licences</span> 
        
            42
                        <div class="multi-select" style="height: clamp(320px, 50vh, 640px)"> 
        
            43
                            {% for licence in licences %} 
        
            44
                                <div class="licence-selection"> 
        
            45
                                    <label> 
        
            46
                                        <input name="licence" type="checkbox" value="{{ licence.id }}" {% if PictureLicence.query.filter_by(resource_id=resource.id, licence_id=licence.id).first() %}checked{% endif %}> 
        
            47
                                        {% if licence.pinned %} 
        
            48
                                            <iconify-icon icon="mdi:pin" title="Pinned">Pinned</iconify-icon> 
        
            49
                                        {% endif %} 
        
            50
                                        {% if not licence.free %} 
        
            51
                                            <iconify-icon icon="mdi:ban" title="Non-free">Non-free</iconify-icon> 
        
            52
                                        {% endif %} 
        
            53
                                        <span class="licence-title"> 
        
            54
                                            <span class="licence-name"> 
        
            55
                                                [{{ licence.id }}] 
        
            56
                                                {{ licence.title }} 
        
            57
                                            </span> 
        
            58
             
        
            59
                                            {% if licence.url %} 
        
            60
                                                <a href="{{ licence.url }}" target="_blank">More information</a> 
        
            61
                                            {% endif %} 
        
            62
                                        </span> 
        
            63
                                    </label> 
        
            64
                                    <div class="licence-selection-info"> 
        
            65
                                        {% if licence.logo_url %} 
        
            66
                                            {% if licence.info_url %} 
        
            67
                                                <a href="{{ licence.info_url }}" target="_blank" tabindex="-1">     {# An equivalent link already exists, only one is focusable #} 
        
            68
                                                    <img src="{{ licence.logo_url }}" alt="{{ licence.title }}" class="licence-logo"> 
        
            69
                                                </a> 
        
            70
                                            {% else %} 
        
            71
                                                <img src="{{ licence.logo_url }}" alt="{{ licence.title }}" class="licence-logo"> 
        
            72
                                            {% endif %} 
        
            73
                                        {% endif %} 
        
            74
                                        <p>{{ licence.description | safe }}</p> 
        
            75
                                    </div> 
        
            76
                                </div> 
        
            77
                            {% endfor %} 
        
            78
                        </div> 
        
            79
                        <button type="submit">Save</button> 
        
            80
                    </form> 
        
            81
                </x-frame> 
        
            82
            {% endblock %}