removed wtform

This commit is contained in:
2024-12-16 18:43:06 +01:00
parent 3b41520da9
commit 1c24b993bb
13 changed files with 222 additions and 223 deletions

View File

@@ -2,32 +2,23 @@
{% block content %}
<form action="{{ url }}" method="post" class="form">
{% for error in form.topic.errors %}
<div class="error">{{ error }}</div>
{% endfor %}
<form action="{{ url }}" method="post" role="form">
<div class="form-group">
<label class="required-field" for="topic">{{form.topic.label}}</label>
{{form.topic(class_='form-control')}}
<label class="required-field" for="topic">Topic</label>
<input class="form-control" name="topic" type="text" value="{{entry.topic}}" required>
</div>
{% for error in form.topic_name.errors %}
<div class="error">{{error}}</div>
{% endfor %}
<div class="form-group">
<label class="required-field" for="topic_name">{{form.topic_name.label}}</label>
{{form.topic_name(class_='form-control')}}
<label class="required-field" for="topic_name">Intitulé</label>
<input class="form-control" name="topic_name" type="text" value="{{entry.topic_name}}" required>
</div>
{% for error in form.topic_quote.errors %}
<div class="error">{{ error }}</div>
{% endfor %}
<div class="form-group">
<label class="required-field" for="topic_quote">{{ form.topic_quote.label }}</label>
{{ form.topic_quote(class_='form-control monospace-font', cols="35", rows="5") }}
<label class="required-field" for="topic_quote">Citation</label>
<textarea class="form-control monospace-font" id="topic_quote" name="topic_quote" required rows="10" cols="35">
{{ entry.topic_quote }}
</textarea>
</div>
<div class="form-group">
@@ -35,17 +26,16 @@
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
<button class="btn btn-primary" type="submit" name="form.submitted">
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
{% if form.topic.data %}
{% if entry.topic != '0' %}
<button class="btn btn-danger" type="button" data-toggle="modal" data-target="#confirmDelete">
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
{% endif %}
</div>
</form>
<h3>Liste des Tags</h3>
<p><a href="{{ request.route_url('tag_edit', topic=form.topic.data, id='0') }}" class="btn btn-success" role="button">
<p><a href="{{ request.route_url('tag_edit', topic=entry.topic, id='0') }}" class="btn btn-success" role="button">
<span class="glyphicon glyphicon-plus"></span> Nouveau</a>
</p>
@@ -60,7 +50,7 @@
<tr>
<td>{{ entry.tag }}</td>
<td>
<a href="{{ request.route_url('tag_edit', topic=form.topic.data, id=entry.id) }}">
<a href="{{ request.route_url('tag_edit', topic=entry.topic, id=entry.id) }}">
{{ entry.tag_name }}
</a>
</td>
@@ -78,7 +68,7 @@
</div>
<div class="modal-body">
<!-- The form is placed inside the body of modal -->
<p>Etes-vous certain(e) de vouloir supprimer le Topic <b>{{ form.topic_name.data }}</b> ?</p>
<p>Etes-vous certain(e) de vouloir supprimer le Topic <b>{{ entry.topic_name }}</b> ?</p>
</div>
<div class="modal-footer">
<div class="form-group">