{% EVENT attachment_file_before %}
{% for _file in _file %}
	{% if _file.S_DENIED %}
		<p class="iz-attach iz-attach--denied">[{_file.DENIED_MESSAGE}]</p>
	{% else %}
		{% EVENT attachment_file_prepend %}

		{% if _file.S_THUMBNAIL %}
			<figure class="iz-attach iz-attach--thumb">
				<a class="iz-attach__media" href="{_file.U_DOWNLOAD_LINK}">
					<img class="iz-attach__img"
						 src="{_file.THUMB_IMAGE}"
						 data-src="{_file.U_DOWNLOAD_LINK}"
						 alt="{% if _file.COMMENT %}{{ _file.COMMENT|e('html') }}{% else %}{{ _file.DOWNLOAD_NAME }}{% endif %}" />
				</a>

				<figcaption class="iz-attach__meta">
					{% if _file.COMMENT %}
						<div class="iz-attach__comment">{_file.COMMENT}</div>
					{% endif %}

					<div class="iz-attach__details">
						<span class="iz-attach__name">{_file.DOWNLOAD_NAME}</span>
						<span class="iz-attach__sep" aria-hidden="true">•</span>
						<span class="iz-attach__size">{_file.FILESIZE} {_file.SIZE_LANG}</span>
						<span class="iz-attach__sep" aria-hidden="true">•</span>
						<span class="iz-attach__count">{_file.L_DOWNLOAD_COUNT}</span>
					</div>
				</figcaption>
			</figure>
		{% endif %}

		{% if _file.S_IMAGE %}
			<figure class="iz-attach iz-attach--image">
				<a class="iz-attach__media" href="{_file.U_DOWNLOAD_LINK}">
					<img class="iz-attach__img"
						 src="{_file.U_INLINE_LINK}"
						 alt="{% if _file.COMMENT %}{{ _file.COMMENT|e('html') }}{% else %}{{ _file.DOWNLOAD_NAME }}{% endif %}" />
				</a>

				<figcaption class="iz-attach__meta">
					{% if _file.COMMENT %}
						<div class="iz-attach__comment">{_file.COMMENT}</div>
					{% endif %}

					<div class="iz-attach__details">
						<span class="iz-attach__name">{_file.DOWNLOAD_NAME}</span>
						<span class="iz-attach__sep" aria-hidden="true">•</span>
						<span class="iz-attach__size">{_file.FILESIZE} {_file.SIZE_LANG}</span>
						<span class="iz-attach__sep" aria-hidden="true">•</span>
						<span class="iz-attach__count">{_file.L_DOWNLOAD_COUNT}</span>
					</div>
				</figcaption>
			</figure>
		{% endif %}

		{% if _file.S_FILE %}
			<div class="iz-attach iz-attach--file">
				<div class="iz-attach__fileline">
					{% if _file.UPLOAD_ICON %}
						<span class="iz-attach__icon" aria-hidden="true"></span>
					{% endif %}
					<a class="iz-attach__link postlink" href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a>
				</div>

				{% if _file.COMMENT %}
					<div class="iz-attach__comment">{_file.COMMENT}</div>
				{% endif %}

				<div class="iz-attach__details">
					<span class="iz-attach__size">{_file.FILESIZE} {_file.SIZE_LANG}</span>
					<span class="iz-attach__sep" aria-hidden="true">•</span>
					<span class="iz-attach__count">{_file.L_DOWNLOAD_COUNT}</span>
				</div>
			</div>
		{% endif %}

		{% EVENT attachment_file_append %}
	{% endif %}
{% endfor %}
{% EVENT attachment_file_after %}
