mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-22 22:10:34 +00:00
Add placeholder to indicate required file types in forms
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
{% macro render_field(field) %}
|
||||
{% if field.flags.required %}
|
||||
{% if field.flags.required and field.type not in ['FileField', 'MultipleFileField'] %}
|
||||
{% if 'class_' in kwargs and 'validate' not in kwargs['class_'] %}
|
||||
{% set tmp = kwargs.update({'class_': kwargs['class_'] + ' validate'}) %}
|
||||
{% else %}
|
||||
@ -35,7 +35,7 @@
|
||||
{% endif %}
|
||||
<label>
|
||||
{{ field.label.text }}
|
||||
{{ field() }}
|
||||
{{ field(*args, **kwargs) }}
|
||||
<span class="lever"></span>
|
||||
</label>
|
||||
{% for error in field.errors %}
|
||||
@ -46,18 +46,19 @@
|
||||
|
||||
{% macro render_decimal_range_field(field) %}
|
||||
<p class="range-field">
|
||||
{{ field(**kwargs) }}
|
||||
{{ field(*args, **kwargs) }}
|
||||
</p>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_file_field(field) %}
|
||||
{% set placeholder = kwargs.pop('placeholder', '') %}
|
||||
<div class="file-field input-field">
|
||||
<div class="btn">
|
||||
<span>{{ field.label.text }}</span>
|
||||
{{ field(**kwargs) }}
|
||||
{{ field(*args, **kwargs) }}
|
||||
</div>
|
||||
<div class="file-path-wrapper">
|
||||
<input class="file-path validate" type="text">
|
||||
<input class="file-path validate" type="text" placeholder="{{ placeholder }}">
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
@ -67,7 +68,7 @@
|
||||
{% if 'material_icon' in kwargs %}
|
||||
<i class="material-icons prefix">{{ kwargs.pop('material_icon') }}</i>
|
||||
{% endif %}
|
||||
{{ field(**kwargs) }}
|
||||
{{ field(*args, **kwargs) }}
|
||||
{{ field.label }}
|
||||
{% for error in field.errors %}
|
||||
<span class="helper-text red-text">{{ error }}</span>
|
||||
|
Reference in New Issue
Block a user