Set correct option in edit article

This commit is contained in:
kitoy 2025-12-22 12:44:29 +01:00
parent af5c93a1df
commit 385fe8110e
2 changed files with 15 additions and 18 deletions

View File

@ -3,7 +3,7 @@
{% block main %}
<form action="" method="POST" id="postform" style="height: 15vw;">
<form action="" method="POST" id="postform" >
<input type="text" name="title" id="title" placeholder="titre" class="form-control" value="{{ oldpost['title'] }}"><br />
<input type="text" name="subtitle" id="subtitle" placeholder="sous-titre" class="form-control" value="{{ oldpost['subtitle'] }}"><br />
<input type="text" name="category" id="category" placeholder="Catégorie" class="form-control" value="{{ oldpost['category'] }}"><br />
@ -19,12 +19,12 @@
<p> Les articles public sont visibles par tout le monde </p>
{% if oldpost['status'] == 'public' %}
{% if oldpost['status'] == 'public' or oldpost['status'] == "public_unified" %}
<input type="radio" name="status" value="draft"> Brouillon
<input type="radio" name="status" value="private"> Privé
<input type="radio" name="status" value="public" checked> Publique
{% elif oldpost['status'] == 'private' %}
{% elif oldpost['status'] == 'private' or oldpost['status'] == "private_unified" %}
<input type="radio" name="status" value="draft"> Brouillon
<input type="radio" name="status" value="private" checked> Privé
<input type="radio" name="status" value="public"> Publique
@ -36,17 +36,17 @@
{% endif %}
</div>
<fieldset>
<label>
{% if blog_unified == "True" %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" checked />
{% else %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" />
{% endif %}
Publier cet article dans le blog général
</label>
</fieldset>
<fieldset>
<label>
{% if oldpost['status'] == "private_unified" or oldpost['status'] == "public_unified" %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" checked />
{% else %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" />
{% endif %}
Publier cet article dans le blog général
</label>
</fieldset>
<button type="submit"> Mettre à jour </button>
</form>

View File

@ -35,11 +35,8 @@
<fieldset>
<label>
{% if blog_unified == "True" %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" checked />
{% else %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" />
{% endif %}
Publier cet article dans le blog général
</label>
</fieldset>