claro-8.x-1.x-dev/templates/content-edit/file-managed-file.html.twig
templates/content-edit/file-managed-file.html.twig
{#
/**
* @file
* Theme override to display a file form widget.
*
* Available variables:
* - element: Form element for the file upload.
* - attributes: HTML attributes for the containing element.
* - multiple: Whether this widget is the part of a multi-value file widget or
* not.
* - upload: Whether the file upload input is displayed or not.
* - has_value: true if the widget already contains a file.
* - has_meta: true when the display checkbox or the description input are
* enabled and and are visible.
*
* @see template_preprocess_file_managed_file()
* @see claro_preprocess_file_managed_file()
*/
#}
{%
set classes = [
'js-form-managed-file',
'form-managed-file',
multiple ? 'is-multiple' : 'is-single',
upload ? 'has-upload' : 'no-upload',
has_value ? 'has-value' : 'no-value',
has_meta ? 'has-meta' : 'no-meta',
]
%}
<div{{ attributes.addClass(classes) }}>
<div class="form-managed-file__main">
{{ element|without('display', 'description')}}
</div>
{% if has_meta %}
<div class="form-managed-file__meta-wrapper">
<div class="form-managed-file__meta">
<div class="form-managed-file__meta-items">
{{ element.description }}
{% if display %}
{{ element.display }}
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
