PCv5/app/templates/widgets/editor.html

29 lines
2.6 KiB
HTML

{% macro text_editor(field, label=True) %}
<div class="editor">
{{ field.label if label }}
<div class="buttons">
<button type="button" title="Gras" onclick="edit(this, 'bold')"><img src="{{ url_for('static', filename = 'icons/editor/format-bold.svg') }}" alt="Gras" /></button>
<button type="button" title="Italique" onclick="edit(this, 'italic')"><img src="{{ url_for('static', filename = 'icons/editor/format-italic.svg') }}" alt="Italique" /></button>
<button type="button" title="Souligné" onclick="edit(this, 'underline')"><img src="{{ url_for('static', filename = 'icons/editor/format-underline.svg') }}" alt="Souligné" /></button>
<button type="button" title="Barré" onclick="edit(this, 'strikethrough')"><img src="{{ url_for('static', filename = 'icons/editor/format-strikethrough.svg') }}" alt="Barré" /></button>
<button type="button" title="Titre 1" onclick="edit(this, 'h1')"><img src="{{ url_for('static', filename = 'icons/editor/format-header-1.svg') }}" alt="Titre 1" /></button>
<button type="button" title="Titre 2" onclick="edit(this, 'h2')"><img src="{{ url_for('static', filename = 'icons/editor/format-header-2.svg') }}" alt="Titre 2" /></button>
<button type="button" title="Titre 3" onclick="edit(this, 'h3')"><img src="{{ url_for('static', filename = 'icons/editor/format-header-3.svg') }}" alt="Titre 3" /></button>
<button type="button" title="Liste à puces" onclick="edit(this, 'list-bulleted')"><img src="{{ url_for('static', filename = 'icons/editor/format-list-bulleted.svg') }}" alt="Liste à puces" /></button>
<button type="button" title="Liste numérotée" onclick="edit(this, 'list-numbered')"><img src="{{ url_for('static', filename = 'icons/editor/format-list-numbered.svg') }}" alt="Liste numérotée" /></button>
<button type="button" title="Citation" onclick="edit(this, 'quote')"><img src="{{ url_for('static', filename = 'icons/editor/format-quote-close.svg') }}" alt="Citation" /></button>
<button type="button" title="Code" onclick="edit(this, 'code')"><img src="{{ url_for('static', filename = 'icons/editor/code-braces.svg') }}" alt="Code" /></button>
<button type="button" title="Spoiler" onclick="edit(this, 'spoiler')"><img src="{{ url_for('static', filename = 'icons/editor/comment-alert-outline.svg') }}" alt="Spoiler" /></button>
<button type="button" title="Lien" onclick="edit(this, 'link')"><img src="{{ url_for('static', filename = 'icons/editor/link-variant.svg') }}" alt="Lien" /></button>
</div>
{{ field() }}
{% for error in field.errors %}
<span class="msgerror">{{ error }}</span>
{% endfor %}
</div>
{% endmacro %}