/
textarea.twig
38 lines (36 loc) · 1.8 KB
/
textarea.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% extends "@bazar/layouts/input.twig" %}
{% block label %}
{% if field.required %}<span class="symbole_obligatoire"></span>{% endif %}
{% if field.hint %}
<img class="tooltip_aide" title="{{ field.hint|raw('html') }}" src="tools/bazar/presentation/images/aide.png" width="16" height="16" alt="image aide" />
{% endif %}
{{ field.label|raw }}
{% if field.maxChars and field.syntax == 'nohtml' %}(<span class="charsRemaining">{{ field.maxChars }}</span> caractères restants){% endif %}
{% endblock %}
{% block input %}
<div id="{{ field.name ~ 'Container' }}">
<textarea
id="{{ field.name }}"
name="{{ field.name }}"
class="form-control {% if field.syntax == 'html' %}summernote{% else %}{{ field.syntax }}{% endif %}"
rows="{{ field.numRows }}"
{% if field.size %}cols="{{ field.size }}"{% endif %}
{% if field.maxChars %}maxlength="{{ field.maxChars }}"{% endif %}
placeholder="{{ field.label|raw('html')|striptags }}"
{% if field.required %}required{% endif %}
>
{{- value -}}
</textarea>
</div>
{% if field.syntax == 'wiki-textarea' %}
{# do not display button before moving in aceditor bar#}
<div style="display:none;">{{ include('@attach/attach-file-uploader-button.twig',
{fileUploaderAnchor:'#' ~ field.name ~ 'Container .aceditor-toolbar',
fileUploaderSelector:'#' ~ field.name }) }}</div>
<script>
var fileUploaderConfig = {attach_config:{ext_images:{{ attachConfigExtImages|json_encode()|raw }}}};
</script>
{{ include_javascript('tools/attach/libs/fileuploader.js') }}
<!-- include_javascript('tools/attach/libs/fileuploader.js') -->
{% endif %}
{% endblock %}