EditionPN/app/templates/form.html

59 lines
2.2 KiB
HTML

{% macro render_field(field,class) %}
<div class="field">
<label class="label">{{ field.label }}</label>
<div class="control">
{{ field(class=class)}}
</div>
{% for error in field.errors %}
<p class="help is-danger">{{error}}</p>
{% endfor %}
</div>
{% endmacro %}
{% extends "base.html" %}
{% block content %}
<form action="" enctype=multipart/form-data method="post" novalidate>
{{ form.hidden_tag() }}
<div class="content">
<h1 class="title">{% block form_title %}{% endblock %}</h1>
{% block formulaire %}{% endblock %}
<div class="field is-grouped">
<div class="control">
{{ form.sauvegarder(class="button")}}
</div>
<div class="control">
{{ form.charger(class="button is-static")}}
</div>
<div class="control">
{{ form.exporter(class="button")}}
</div>
<div class="control">
<div class="file has-name">
<label class="file-label">
{{ form.fichier(class="file-input") }}
<span class="file-cta">
<span class="file-icon">
<i class="fas fa-file-import"></i>
</span>
<span class="file-label">
{{ form.fichier.label}}
</span>
</span>
{{ form.importer(class="button file-name", accept=".yml")}}
</label>
</div>
{% for error in form.fichier.errors %}
<p class="help is-danger">{{error}}</p>
{% endfor %}
</div>
</div>
<ul>
{% for referentiel in form.referentiel %}
<li>{{ referentiel }} {{ referentiel.data.code }} - {{ referentiel.data.nom }}{{ referentiel.data.titre }}</li>
{% endfor %}
</ul>
</div>
</form>
{% endblock %}