image feature + refactor

This commit is contained in:
JMARyA 2024-12-06 12:10:30 +01:00
parent 73e019de9a
commit d64efb663a
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
13 changed files with 221 additions and 37 deletions
core/templates

View file

@ -12,7 +12,7 @@
</p>
</div>
<form method="post" class="space-y-4">
<form method="post" class="space-y-4" enctype="multipart/form-data">
{% load access set_content %}
@ -24,7 +24,11 @@
{% if field.id_for_label == "id_department" %}
{% if draft is not None %}
{{ field|set_content:draft.department }}
{% else %}
{{ field }}
{% endif %}
{% else %}
{% with content=draft.content|access:field.id_for_label %}