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