<div class="iz-panel__body iz-tabpane {% if S_SHOW_DRAFTS %}is-active{% endif %}" id="posting-attach-body-html">
	<div class="iz-prose">
		<p>
			{{ L_ADD_ATTACHMENT_EXPLAIN }}
			<span class="iz-visually-hidden" id="drag-n-drop-message">{{ L_PLUPLOAD_DRAG_TEXTAREA }}</span>
		</p>

		{% if MAX_ATTACHMENT_FILESIZE is not empty %}
			<p class="iz-hint">{{ MAX_ATTACHMENT_FILESIZE }}</p>
		{% endif %}
	</div>

	<div id="attach-panel" class="iz-attach">

		<fieldset id="attach-panel-basic" class="iz-fieldset">
			<legend class="iz-legend iz-visually-hidden">{{ L_ADD_ATTACHMENT }}</legend>

			<div class="iz-field">
				<label class="iz-label" for="fileupload">{{ L_FILENAME }}{{ L_COLON }}</label>
				<input
					type="file"
					accept="{{ ALLOWED_ATTACHMENTS }}"
					name="fileupload"
					id="fileupload"
					class="iz-input"
				/>
			</div>

			<div class="iz-field iz-field--actions">
				<input
					type="submit"
					name="add_file"
					value="{{ L_ADD_FILE }}"
					class="iz-btn iz-btn--primary"
					onclick="upload = true;"
				/>
			</div>

			<div class="iz-field">
				<label class="iz-label" for="filecomment">{{ L_FILE_COMMENT }}{{ L_COLON }}</label>
				<textarea
					name="filecomment"
					id="filecomment"
					rows="2"
					cols="40"
					class="iz-textarea"
				>{{ FILE_COMMENT }}</textarea>
			</div>
		</fieldset>

		<div id="attach-panel-multi" class="iz-attach__multi">
			<button
				type="button"
				class="iz-btn iz-btn--ghost"
				id="add_files"
				value="{{ L_PLUPLOAD_ADD_FILES }}"
			>
				{{ L_PLUPLOAD_ADD_FILES }}
			</button>

			{% EVENT posting_attach_options_prepend %}
		</div>

		<div
			id="file-list-container"
			class="iz-attach__list {% if not .attach_row %}is-hidden{% endif %}"
		>
			<div id="file-list" class="iz-attach__items" aria-live="polite" aria-relevant="additions removals">
				<div class="attach-row iz-attach__item" id="attach-row-tpl">
					<div class="iz-attach__row">
						<button type="button" value="{{ L_DELETE_FILE }}" class="iz-btn iz-btn--danger iz-btn--sm file-delete">
							{{ L_DELETE_FILE }}
						</button>

						<div class="attach-name iz-attach__meta">
							<div class="iz-attach__titleline">
								<span class="file-name iz-attach__filename"></span>
								<span class="file-size iz-attach__size"></span>
								<span class="file-status iz-attach__status" aria-live="polite"></span>

								{% if S_BBCODE_ALLOWED %}
									<button type="button" value="{{ L_PLACE_INLINE }}" class="iz-btn iz-btn--link iz-btn--sm is-hidden file-inline-bbcode">
										{{ L_PLACE_INLINE }}
									</button>
								{% endif %}
							</div>

							<div class="attach-comment iz-attach__comment">
								<label class="iz-label iz-visually-hidden">{{ L_ADD_DESCRIPTION }}</label>
								<textarea
									rows="1"
									maxlength="45"
									class="inputbox iz-textarea form-plupload"
									placeholder="{{ L_ADD_DESCRIPTION }}"
								></textarea>
							</div>
						</div>
					</div>

					<div class="file-progress iz-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-label="{{ L_PLUPLOAD_STATUS }}">
						<span class="file-progress-bar iz-progress__bar"></span>
					</div>
				</div>

				{% for attach_row in attach_row %}
				<div class="attach-row iz-attach__item" data-attach-id="{{ attach_row.ATTACH_ID }}">
					{% EVENT posting_attach_body_attach_row_controls_prepend %}
					<div class="iz-attach__row">
						<button type="button" value="{{ L_DELETE_FILE }}" class="iz-btn iz-btn--danger iz-btn--sm file-delete">
							{{ L_DELETE_FILE }}
						</button>
						{% EVENT posting_attach_body_attach_row_controls_append %}

						<div class="attach-name iz-attach__meta">
							<div class="iz-attach__titleline">
								<span class="file-name iz-attach__filename">
									<a class="iz-link" href="{{ attach_row.U_VIEW_ATTACHMENT }}">{{ attach_row.FILENAME }}</a>
								</span>

								<span class="file-size iz-attach__size">{{ attach_row.FILESIZE }}</span>
								<span class="file-status iz-attach__status file-uploaded" aria-live="polite"></span>

								{% if S_BBCODE_ALLOWED and S_INLINE_ATTACHMENT_OPTIONS %}
									<button type="button" value="{{ L_PLACE_INLINE }}" class="iz-btn iz-btn--link iz-btn--sm file-inline-bbcode">
										{{ L_PLUPLOAD_PLACE_INLINE }}
									</button>
								{% endif %}
							</div>

							<div class="attach-comment iz-attach__comment">
								<label class="iz-label iz-visually-hidden" for="comment_list_{{ attach_row.ASSOC_INDEX }}">{{ L_ADD_DESCRIPTION }}</label>
								<textarea
									id="comment_list_{{ attach_row.ASSOC_INDEX }}"
									name="comment_list[{{ attach_row.ASSOC_INDEX }}]"
									rows="1"
									class="inputbox iz-textarea form-plupload"
									placeholder="{{ L_ADD_DESCRIPTION }}"
								>{{ attach_row.FILE_COMMENT }}</textarea>

								{{ attach_row.S_HIDDEN }}
							</div>
						</div>
					</div>
				</div>
				{% endfor %}
			</div>
		</div>

	</div>
</div>
