grav/themes/materialize/templates/forms/fields/datetime/datetime.html.twig

26 lines
1.2 KiB
Twig
Raw Normal View History

{% set value = (value is null ? field.default : value) %}
<div class="form-field">
<label class="control-label col-sm-2">
{% if field.help %}
<span class="tooltip" data-asTooltip-position="w" title="{{ field.help|e }}">{{ field.label }}</span>
{% else %}
{{ field.label }}
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</label>
<div class="col-sm-10">
<input class="form-control"
type="date"
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ value }}"
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.validate.min %}min="{{ field.validate.min }}"{% endif %}
{% if field.validate.max %}max="{{ field.validate.max }}"{% endif %}
/>
</div>
</div>