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 %} {% 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="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="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 /> <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> <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="draft"> Brouillon
<input type="radio" name="status" value="private"> Privé <input type="radio" name="status" value="private"> Privé
<input type="radio" name="status" value="public" checked> Publique <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="draft"> Brouillon
<input type="radio" name="status" value="private" checked> Privé <input type="radio" name="status" value="private" checked> Privé
<input type="radio" name="status" value="public"> Publique <input type="radio" name="status" value="public"> Publique
@ -36,16 +36,16 @@
{% endif %} {% endif %}
</div> </div>
<fieldset> <fieldset>
<label> <label>
{% if blog_unified == "True" %} {% if oldpost['status'] == "private_unified" or oldpost['status'] == "public_unified" %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" checked /> <input id="blog-unified" name="blog-unified" type="checkbox" role="switch" checked />
{% else %} {% else %}
<input id="blog-unified" name="blog-unified" type="checkbox" role="switch" /> <input id="blog-unified" name="blog-unified" type="checkbox" role="switch" />
{% endif %} {% endif %}
Publier cet article dans le blog général Publier cet article dans le blog général
</label> </label>
</fieldset> </fieldset>
<button type="submit"> Mettre à jour </button> <button type="submit"> Mettre à jour </button>
</form> </form>

View File

@ -35,11 +35,8 @@
<fieldset> <fieldset>
<label> <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" /> <input id="blog-unified" name="blog-unified" type="checkbox" role="switch" />
{% endif %}
Publier cet article dans le blog général Publier cet article dans le blog général
</label> </label>
</fieldset> </fieldset>