{% include 'overall_header.html' %}

{% EVENT viewtopic_topic_title_before %}
<section class="iz-page-head" aria-labelledby="iz-topic-title">
	<div class="iz-page-head__inner">
		<div class="iz-page-head__kicker iz-center">Recent discussions</div>
		<h1 id="iz-topic-title" class="iz-page-head__title iz-center">
			{% EVENT viewtopic_topic_title_prepend %}
			<a class="iz-link" href="{{ U_VIEW_TOPIC }}">{% if FORUM_NAME %}[{{ FORUM_NAME }}]: {% endif %}{{ TOPIC_TITLE }}</a>
			{% EVENT viewtopic_topic_title_append %}
		</h1>

		<!-- NOTE: If you want the forum description visible, remove the hidden attribute below -->
		{% if FORUM_DESC %}
			<div class="iz-page-head__meta" hidden>
				{{ FORUM_DESC }}<br />
			</div>
		{% endif %}

		{% EVENT viewtopic_topic_title_after %}

		{% if MODERATORS %}
			<p class="iz-page-head__meta">
				<strong>{% if S_SINGLE_MODERATOR %}{{ L_MODERATOR }}{% else %}{{ L_MODERATORS }}{% endif %}{{ L_COLON }}</strong>&nbsp;{{ MODERATORS }}
			</p>
		{% endif %}

		{% if S_FORUM_RULES %}
			<div class="iz-alert iz-alert--info" role="note">
				{% if U_FORUM_RULES %}
					<a class="iz-link" href="{{ U_FORUM_RULES }}">{{ L_FORUM_RULES }}</a>
				{% else %}
					<strong>{{ L_FORUM_RULES }}{{ L_COLON }}</strong>&nbsp;{{ FORUM_RULES }}
				{% endif %}
			</div>
		{% endif %}
	</div>
</section>

<!-- Top utility bar: topic search + pagination -->
<div class="iz-toolbar" role="region" aria-label="{{ L_OPTIONS }}">
	<div class="iz-toolbar__left">
		{% if S_DISPLAY_SEARCHBOX %}
			<form class="iz-form iz-form--inline" method="get" id="topic-search" action="{{ S_SEARCHBOX_ACTION }}" role="search" aria-label="{{ L_SEARCH_TOPIC }}">
				<div class="iz-field iz-field--search">
					<label class="iz-sr-only" for="search_keywords">{{ L_SEARCH_TOPIC }}</label>
					<input
						type="text"
						class="iz-input"
						name="keywords"
						id="search_keywords"
						value=""
						placeholder="{{ L_SEARCH_TOPIC }}"
						autocomplete="off"
					/>
					<button class="iz-button iz-button--secondary" type="submit" value="{{ L_SEARCH }}">
						{{ L_SEARCH }}
					</button>
				</div>
				{{ S_SEARCH_LOCAL_HIDDEN_FIELDS }}
			</form>
		{% endif %}
	</div>

	<div class="iz-toolbar__right">
		<nav class="iz-pagination" aria-label="{{ L_JUMP_PAGE }}">
			<span class="iz-pagination__count" aria-label="{{ TOTAL_POSTS }}">{{ TOTAL_POSTS }}</span>

			{% if U_VIEW_UNREAD_POST and not S_IS_BOT %}
				<a class="iz-button iz-button--secondary iz-button--sm" href="{{ U_VIEW_UNREAD_POST }}">
					{{ L_VIEW_UNREAD_POST }}
				</a>
			{% endif %}

			{% if pagination or TOTAL_POSTS %}
				{% include 'pagination.html' %}
			{% else %}
				<span class="iz-pagination__current" aria-current="page">{{ PAGE_NUMBER }}</span>
			{% endif %}
		</nav>
	</div>
</div>

{% EVENT viewtopic_first_topic_buttons_before %}
<div class="iz-toolbar" role="region" aria-label="{{ L_REPLY }}">
	<div class="iz-toolbar__left">
		{% if not S_IS_BOT and S_DISPLAY_REPLY_INFO %}
			{% EVENT viewtopic_buttons_top_before %}
			{% if S_IS_LOCKED %}
				<a class="iz-button iz-button--danger" href="{{ U_POST_REPLY_TOPIC }}" role="button">
					{{ L_TOPIC_LOCKED_SHORT }}
				</a>
			{% else %}
				<a class="iz-button iz-button--primary" href="{{ U_POST_REPLY_TOPIC }}" role="button">
					{{ L_REPLY }}
				</a>
			{% endif %}
			{% EVENT viewtopic_buttons_top_after %}
		{% endif %}
	</div>

	<div class="iz-toolbar__right">
		{% include 'viewtopic_topic_tools.html' %}
	</div>
</div>
{% EVENT viewtopic_first_topic_buttons_after %}

{% EVENT viewtopic_body_poll_before %}

{% if S_HAS_POLL %}
	<form method="post" action="{{ S_POLL_ACTION }}" data-ajax="vote_poll" data-refresh="true" class="iz-poll">
		<fieldset class="iz-fieldset">
			<section class="iz-card iz-card--poll" aria-label="{{ POLL_QUESTION }}">
				<header class="iz-card__header">
					<h2 class="iz-card__title">
						{% EVENT viewtopic_body_poll_question_prepend %}
						{{ POLL_QUESTION }}
						{% EVENT viewtopic_body_poll_question_append %}
					</h2>

					{% if S_CAN_VOTE and L_POLL_LENGTH %}
						<div class="iz-alert iz-alert--info" role="note">
							{{ L_POLL_LENGTH }}
						</div>
					{% endif %}
				</header>

				<div class="iz-card__body">
					<div class="iz-stack iz-stack--sm">
						{% for poll_option in poll_option %}
							{% EVENT viewtopic_body_poll_option_before %}

							<div class="iz-poll__option
								{% if poll_option.POLL_OPTION_VOTED %} is-voted{% endif %}
								{% if poll_option.POLL_OPTION_MOST_VOTES %} is-most-votes{% endif %}"
								data-poll-option-id="{{ poll_option.POLL_OPTION_ID }}"
								{% if poll_option.POLL_OPTION_VOTED %} title="{{ L_POLL_VOTED_OPTION }}"{% endif %}
							>
								<div class="iz-poll__row">
									<div class="iz-poll__choice">
										{% if S_CAN_VOTE %}
											{% if S_IS_MULTI_CHOICE %}
												<input type="checkbox" name="vote_id[]" id="vote_{{ poll_option.POLL_OPTION_ID }}" value="{{ poll_option.POLL_OPTION_ID }}"{% if poll_option.POLL_OPTION_VOTED %} checked="checked"{% endif %} />
											{% else %}
												<input type="radio" name="vote_id[]" id="vote_{{ poll_option.POLL_OPTION_ID }}" value="{{ poll_option.POLL_OPTION_ID }}"{% if poll_option.POLL_OPTION_VOTED %} checked="checked"{% endif %} />
											{% endif %}
											<label for="vote_{{ poll_option.POLL_OPTION_ID }}">{{ poll_option.POLL_OPTION_CAPTION }}</label>
										{% else %}
											<span>{{ poll_option.POLL_OPTION_CAPTION }}</span>
										{% endif %}
									</div>

									<div class="iz-poll__result{% if not S_DISPLAY_RESULTS %} iz-hidden{% endif %}">
										<span class="iz-badge{% if poll_option.POLL_OPTION_VOTED %} iz-badge--info{% endif %}"
											{% if poll_option.POLL_OPTION_VOTED %} title="{{ L_POLL_VOTED_OPTION }}"{% endif %}
										>
											{% if poll_option.POLL_OPTION_RESULT == 0 %}
												{{ L_NO_VOTES }}
											{% else %}
												{{ poll_option.POLL_OPTION_RESULT }}
											{% endif %}
										</span>
									</div>
								</div>

								<div class="iz-poll__bar{% if not S_DISPLAY_RESULTS %} iz-hidden{% endif %}" role="img" aria-label="{{ poll_option.POLL_OPTION_PERCENT }}">
									<div class="iz-progress" aria-hidden="true">
										<div class="iz-progress__fill" style="width:{{ poll_option.POLL_OPTION_PERCENT }};min-width:2em;">
											{{ poll_option.POLL_OPTION_PERCENT }}
										</div>
									</div>
								</div>
							</div>

							{% EVENT viewtopic_body_poll_option_after %}
						{% endfor %}
					</div>
				</div>

				<footer class="iz-card__footer">
					<div class="iz-toolbar">
						<div class="iz-toolbar__left">
							<ul class="iz-inline-list">
								{% if not S_DISPLAY_RESULTS %}
									<li class="poll_view_results"><a class="iz-link" href="{{ U_VIEW_RESULTS }}">{{ L_VIEW_RESULTS }}</a></li>
								{% endif %}

								<li class="poll_total_votes{% if not S_DISPLAY_RESULTS %} iz-hidden{% endif %}">
									<span>{{ L_TOTAL_VOTES }}{{ L_COLON }}&nbsp;<span class="poll_total_vote_cnt">{{ TOTAL_VOTES }}</span></span>
								</li>

								{% if S_CAN_VOTE %}
									<li class="poll_max_votes">{{ L_MAX_VOTES }}</li>
								{% endif %}
							</ul>
						</div>

						<div class="iz-toolbar__right">
							<div class="vote-submitted iz-hidden">&nbsp;<span class="iz-badge iz-badge--success">{{ L_VOTE_SUBMITTED }}</span></div>

							{% if S_CAN_VOTE %}
								<input type="submit" name="update" value="{{ L_SUBMIT_VOTE }}" class="iz-button iz-button--primary" data-loading-text="{{ L_CASTING_VOTE }}" autocomplete="off" />
							{% endif %}
						</div>
					</div>

					{{ S_FORM_TOKEN }}
					{{ S_HIDDEN_FIELDS }}
				</footer>
			</section>
		</fieldset>
	</form>
{% endif %}

{% EVENT viewtopic_body_poll_after %}

<div class="iz-posts" aria-label="{{ L_POSTS }}">
	{% for postrow in postrow %}
		{% EVENT viewtopic_body_postrow_post_before %}

		{% if postrow.S_FIRST_UNREAD %}
			<a id="unread" class="anchor"{% if S_UNREAD_VIEW %} data-url="{{ postrow.U_MINI_POST }}"{% endif %}></a>
		{% endif %}

		<div id="p{{ postrow.POST_ID }}">
			{% if postrow.S_POST_DELETED %}
				<div class="iz-alert iz-alert--neutral" id="post_hidden{{ postrow.POST_ID }}"{% if not postrow.S_POST_HIDDEN %} style="display: none;"{% endif %}>
					{{ postrow.L_POST_DELETED_MESSAGE }}<br />
					<strong>{{ postrow.L_POST_DISPLAY }}</strong>
				</div>
			{% elseif postrow.S_IGNORE_POST %}
				<div class="iz-alert iz-alert--warning" id="post_hidden{{ postrow.POST_ID }}"{% if not postrow.S_POST_HIDDEN %} style="display: none;"{% endif %}>
					{{ postrow.L_IGNORE_POST }}<br />
					<strong>{{ postrow.L_POST_DISPLAY }}</strong>
				</div>
			{% endif %}

			{% if postrow.S_POST_PRIVATE %}
				<section class="iz-card iz-card--post iz-card--muted" aria-label="{{ L_PRIVATE_POST }}">
					<div class="iz-card__body">
						<div class="iz-post-head">
							<div class="iz-post-head__avatar">
								{% if postrow.POSTER_AVATAR %}
									{% if postrow.U_POST_AUTHOR %}<a class="iz-link" href="{{ postrow.U_POST_AUTHOR }}" title="{{ L_USER_MINI_PROFILE }}">{{ postrow.POSTER_AVATAR }}</a>{% else %}{{ postrow.POSTER_AVATAR }}{% endif %}
								{% else %}
									<img src="{{ T_THEME_PATH }}/images/no_avatar.gif" alt="" />
								{% endif %}
								{% if postrow.S_ONLINE %}<span class="iz-presence" aria-label="{{ L_ONLINE }}"></span>{% endif %}
							</div>

							<div class="iz-post-head__meta">
								<div class="iz-post-head__byline">
									{{ L_BY }}&nbsp;{{ postrow.POST_AUTHOR_FULL }}
								</div>
								<div class="iz-post-head__time">
									<time datetime="{{ postrow.POST_DATE_RFC3339 }}">{{ postrow.POST_DATE }}</time>
								</div>
							</div>
						</div>

						<p><strong>{{ L_PRIVATE_POST_NO_CONTENT }}</strong></p>
					</div>
				</section>

			{% else %}

				{% EVENT ss_viewtopic_body_postrow_article_before %}

				<article class="iz-card iz-card--post"{% if postrow.S_POST_HIDDEN %} style="display: none;"{% endif %} aria-labelledby="iz-post-title-{{ postrow.POST_ID }}">
					<header class="iz-card__header">
						<div class="iz-post-head">
							<div class="iz-post-head__avatar" id="profile{{ postrow.POST_ID }}">
								{% if postrow.POSTER_AVATAR %}
									{% if postrow.U_POST_AUTHOR %}<a class="iz-link" href="{{ postrow.U_POST_AUTHOR }}" title="{{ L_USER_MINI_PROFILE }}">{{ postrow.POSTER_AVATAR }}</a>{% else %}{{ postrow.POSTER_AVATAR }}{% endif %}
								{% else %}
									<img src="{{ T_THEME_PATH }}/images/no_avatar.gif" alt="" />
								{% endif %}
								{% if postrow.S_ONLINE %}<span class="iz-presence" aria-label="{{ L_ONLINE }}"></span>{% endif %}
							</div>

							<div class="iz-post-head__main">
								<h2 class="iz-post-title" id="iz-post-title-{{ postrow.POST_ID }}">
									{% if postrow.POST_ICON_IMG %}
										<img class="iz-post-icon" src="{% if not S_BBEMOJI %}{{ T_ICONS_PATH }}{% endif %}{{ postrow.POST_ICON_IMG }}" width="{{ postrow.POST_ICON_IMG_WIDTH }}" height="{{ postrow.POST_ICON_IMG_HEIGHT }}" alt="" />
									{% endif %}
									<a class="iz-link" href="#p{{ postrow.POST_ID }}">{{ postrow.POST_SUBJECT }}</a>
								</h2>

								<div class="iz-post-meta">
									{% EVENT viewtopic_body_post_author_before %}
									<span class="iz-post-meta__by">
										{{ L_BY }}&nbsp;{{ postrow.POST_AUTHOR_FULL }}
									</span>
									<span class="iz-post-meta__sep" aria-hidden="true">•</span>
									<time class="iz-post-meta__time" datetime="{{ postrow.POST_DATE_RFC3339 }}">{{ postrow.POST_DATE }}</time>
									{% EVENT viewtopic_body_post_author_after %}

									<span class="iz-post-meta__sep" aria-hidden="true">•</span>
									{% EVENT viewtopic_body_post_id_before %}
									<a class="iz-link" href="{{ postrow.U_MINI_POST }}" title="{{ L_POST }}">
										#{{ postrow.POST_ID }}
									</a>
								</div>
							</div>

							<div class="iz-post-head__actions">
								{% EVENT viewtopic_body_post_buttons_before_absolute %}
								{% EVENT viewtopic_body_post_buttons_before %}

								{% if not S_IS_BOT and S_REGISTERED_USER %}
									{% set SHOW_POST_BUTTONS = (postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE) %}
									{% if $SHOW_POST_BUTTONS %}
										<details class="iz-menu">
											<summary class="iz-button iz-button--secondary iz-button--sm">{{ L_OPTIONS }}</summary>
											<div class="iz-menu__panel" role="menu" aria-label="{{ L_OPTIONS }}">
												<ul class="iz-menu__list">
													{% EVENT viewtopic_body_post_buttons_list_before %}
													{% if postrow.U_QUOTE %}<li role="none"><a role="menuitem" class="iz-menu__item" href="{{ postrow.U_QUOTE }}">{{ L_QUOTE }}</a></li>{% endif %}
													{% if postrow.U_EDIT %}<li role="none"><a role="menuitem" class="iz-menu__item qlr-trigger" href="{{ postrow.U_EDIT }}">{{ L_EDIT_POST }}</a></li>{% endif %}
													{% if postrow.U_DELETE %}<li role="none"><a role="menuitem" class="iz-menu__item" href="{{ postrow.U_DELETE }}">{{ L_DELETE_POST }}</a></li>{% endif %}
													{% if postrow.U_REPORT %}<li role="none"><a role="menuitem" class="iz-menu__item" href="{{ postrow.U_REPORT }}">{{ L_REPORT_POST }}</a></li>{% endif %}
													{% if postrow.U_WARN %}<li role="none"><a role="menuitem" class="iz-menu__item" href="{{ postrow.U_WARN }}">{{ L_WARN_USER }}</a></li>{% endif %}
													{% if postrow.U_INFO %}<li role="none"><a role="menuitem" class="iz-menu__item" href="{{ postrow.U_INFO }}">{{ L_INFORMATION }}</a></li>{% endif %}
													{% EVENT viewtopic_body_post_buttons_list_after %}
												</ul>
											</div>
										</details>

										{% if postrow.U_QUOTE %}
											<a class="iz-button iz-button--secondary iz-button--sm" href="{{ postrow.U_QUOTE }}" title="{{ L_REPLY_WITH_QUOTE }}" role="button">
												{{ L_QUOTE }}
											</a>
										{% endif %}
									{% endif %}
								{% endif %}

								{% EVENT viewtopic_body_post_buttons_after %}
							</div>
						</div>
					</header>

					<div class="iz-card__body">
						<div class="postbody">
							<div id="post_content{{ postrow.POST_ID }}">
								{% EVENT viewtopic_body_postrow_post_details_before %}
								{% EVENT viewtopic_body_postrow_post_details_after %}

								{% if postrow.S_POST_UNAPPROVED %}
									{% if postrow.S_CAN_APPROVE %}
										<form method="post" class="mcp_approve" action="{{ postrow.U_APPROVE_ACTION }}">
											<div class="iz-alert iz-alert--warning" role="alert">
												<strong>{{ L_POST_UNAPPROVED_ACTION }}</strong>
												<div class="iz-inline-actions">
													<input class="iz-button iz-button--danger iz-button--sm" type="submit" value="{{ L_DISAPPROVE }}" name="action[disapprove]" />
													<input class="iz-button iz-button--primary iz-button--sm" type="submit" value="{{ L_APPROVE }}" name="action[approve]" />
												</div>
												<input type="hidden" name="post_id_list[]" value="{{ postrow.POST_ID }}" />
												{{ S_FORM_TOKEN }}
											</div>
										</form>
									{% else %}
										<div class="iz-alert iz-alert--warning" role="alert">
											<strong>{{ L_POST_UNAPPROVED_EXPLAIN }}</strong>
										</div>
									{% endif %}
								{% elseif postrow.S_POST_DELETED %}
									<form method="post" class="mcp_approve" action="{{ postrow.U_APPROVE_ACTION }}">
										<div class="iz-alert iz-alert--warning" role="alert">
											<strong>{{ L_POST_DELETED_ACTION }}</strong>
											<div class="iz-inline-actions">
												{% if postrow.S_DELETE_PERMANENT %}
													<input class="iz-button iz-button--danger iz-button--sm" type="submit" value="{{ L_DELETE }}" name="action[delete]" />
												{% endif %}
												<input class="iz-button iz-button--primary iz-button--sm" type="submit" value="{{ L_RESTORE }}" name="action[restore]" />
											</div>
											<input type="hidden" name="post_id_list[]" value="{{ postrow.POST_ID }}" />
											{{ S_FORM_TOKEN }}
										</div>
									</form>
								{% endif %}

								{% if postrow.S_POST_REPORTED %}
									<div class="iz-alert iz-alert--danger" role="alert">
										<a class="iz-link" href="{{ postrow.U_MCP_REPORT }}"><strong>{{ L_POST_REPORTED }}</strong></a>
									</div>
								{% endif %}

								<span class="hidden hook-bfr-message"></span>
								<div class="content">{{ postrow.MESSAGE }}</div>

								{% if postrow.S_HAS_ATTACHMENTS %}
									<div class="iz-attachments">
										{% if BBLIGHTBOX_PLUGIN %}
											{% include '@infozone_bblightbox/bblightbox_layout.html' %}
										{% else %}
											<section class="iz-card iz-card--attachments">
												<header class="iz-card__header">
													<h3 class="iz-card__title">{{ L_ATTACHMENTS }}</h3>
												</header>
												<div class="iz-card__body">
													{% for attachment in attachment %}{{ postrow.attachment.DISPLAY_ATTACHMENT }}{% endfor %}
												</div>
											</section>
										{% endif %}
									</div>
								{% endif %}

								{% EVENT viewtopic_body_postrow_post_notices_before %}
								{% if postrow.S_DISPLAY_NOTICE %}<div class="iz-alert iz-alert--neutral">{{ L_DOWNLOAD_NOTICE }}</div>{% endif %}

								{% if postrow.EDITED_MESSAGE or postrow.EDIT_REASON or postrow.BUMPED_MESSAGE %}
									<div class="iz-note">
										<small>{{ postrow.EDITED_MESSAGE }}</small>
										{% if postrow.EDIT_REASON %}<small><strong>{{ L_REASON }}{{ L_COLON }}</strong>&nbsp;{{ postrow.EDIT_REASON }}</small>{% endif %}
										<div><small>{{ postrow.BUMPED_MESSAGE }}</small></div>
									</div>
								{% endif %}
								{% EVENT viewtopic_body_postrow_post_notices_after %}

								{% if postrow.SIGNATURE or postrow.STEAM_SIG_ENABLED %}
									<hr class="iz-divider" />
									{% EVENT viewtopic_body_postrow_signature_before %}
									<div id="sig{{ postrow.POST_ID }}" class="iz-signature">{{ postrow.SIGNATURE }}</div>
									{% EVENT viewtopic_panel_postrow_signature_after %}
								{% endif %}
							</div>

							{% EVENT viewtopic_panel_post_body_inner %}
						</div>
					</div>

					{% if postrow.S_LAST_ROW and S_QUICK_REPLY %}
						<footer class="iz-card__footer">
							<details class="iz-disclosure iz-disclosure--quickreply">
								<summary class="iz-button iz-button--primary iz-button--sm">{{ L_QUICKREPLY }}</summary>
								<div class="iz-disclosure__panel">
									{% if S_SNAPPY %}
										{% include '@infozone_snappy/snappy_quickreply_editor.html' %}
									{% else %}
										{% include 'quickreply_editor.html' %}
									{% endif %}
								</div>
							</details>
						</footer>
					{% endif %}

					{% EVENT viewtopic_body_postrow_post_content_footer %}
				</article>

				{% EVENT ss_viewtopic_body_postrow_article_after %}

				<!-- Mini profile: replace legacy modal with JS-light disclosure -->
				<section class="iz-mini-profile" aria-label="{{ L_USER_MINI_PROFILE }}">
					<details class="iz-disclosure">
						<summary class="iz-link">{{ L_USER_MINI_PROFILE }}</summary>

						<div class="iz-disclosure__panel">
							<div class="iz-mini-profile__grid">
								<div class="iz-mini-profile__left">
									<div class="iz-mini-profile__avatar">
										{% EVENT viewtopic_body_avatar_before %}
										{% if postrow.POSTER_AVATAR %}
											{% if postrow.U_POST_AUTHOR %}<a class="iz-link" href="{{ postrow.U_POST_AUTHOR }}">{{ postrow.POSTER_AVATAR }}</a>{% else %}{{ postrow.POSTER_AVATAR }}{% endif %}
										{% else %}
											<img src="{{ T_THEME_PATH }}/images/no_avatar.gif" alt="" />
										{% endif %}
										{% EVENT viewtopic_body_avatar_after %}
									</div>

									{% EVENT viewtopic_body_postrow_rank_before %}
									{% if postrow.RANK_TITLE and postrow.RANK_IMG %}
										<div class="iz-mini-profile__rank">{{ postrow.RANK_IMG }}</div>
									{% endif %}
									{% EVENT viewtopic_body_postrow_rank_after %}

									{% if postrow.U_POST_AUTHOR %}
										<a class="iz-button iz-button--secondary iz-button--sm" href="{{ postrow.U_POST_AUTHOR }}">
											{{ L_USER_MINI_PROFILE_VIEW_FULL }}
										</a>
									{% endif %}
								</div>

								<div class="iz-mini-profile__right">
									<h3 class="iz-mini-profile__name">
										{{ postrow.POST_AUTHOR_FULL }}
									</h3>

									<ul class="iz-list iz-list--meta">
										{% if postrow.RANK_TITLE and postrow.RANK_IMG %}<li>{{ L_RANK }}{{ L_COLON }}&nbsp;{{ postrow.RANK_TITLE }}</li>{% endif %}
										{% if postrow.POSTER_POSTS != '' %}<li>{{ L_POSTS }}{{ L_COLON }}&nbsp;{{ postrow.POSTER_POSTS }}</li>{% endif %}
										{% if postrow.POSTER_JOINED %}<li>{{ L_JOINED }}{{ L_COLON }}&nbsp;{{ postrow.POSTER_JOINED }}</li>{% endif %}
										<li>{{ L_USER_STATUS }}{{ L_COLON }}&nbsp;{% if postrow.S_ONLINE and not postrow.S_IGNORE_POST %}{{ L_ONLINE }}{% else %}{{ L_OFF_LINE }}{% endif %}</li>
										{% if postrow.POSTER_WARNINGS %}<li>{{ L_WARNINGS }}{{ L_COLON }}&nbsp;{{ postrow.POSTER_WARNINGS }}</li>{% endif %}

										{% if postrow.S_PROFILE_FIELD1 %}
											<li>{{ postrow.PROFILE_FIELD1_NAME }}{{ L_COLON }}&nbsp;{{ postrow.PROFILE_FIELD1_VALUE }}</li>
										{% endif %}

										{% EVENT viewtopic_body_postrow_custom_fields_before %}
										{% for custom_fields in custom_fields %}
											{% if not postrow.custom_fields.S_PROFILE_CONTACT %}
												<li class="profile-custom-field profile-{{ postrow.custom_fields.PROFILE_FIELD_IDENT }}">
													{{ postrow.custom_fields.PROFILE_FIELD_NAME }}{{ L_COLON }} {{ postrow.custom_fields.PROFILE_FIELD_VALUE }}
												</li>
											{% endif %}
										{% endfor %}
										{% EVENT viewtopic_body_postrow_custom_fields_after %}
									</ul>

									{% EVENT viewtopic_body_contact_fields_before %}
									{% if not S_IS_BOT and .postrow.contact %}
										<ul class="iz-inline-list iz-inline-list--icons" aria-label="{{ L_CONTACT }}">
											{% for contact in contact %}
												<li>
													<a class="iz-link"
														href="{% if postrow.contact.U_CONTACT %}{{ postrow.contact.U_CONTACT }}{% else %}{{ postrow.U_POST_AUTHOR }}{% endif %}"
														title="{{ postrow.contact.NAME }}"
														{% if postrow.contact.ID == 'jabber' %} onclick="popup(this.href, 750, 320); return false;"{% endif %}
													>
														{{ postrow.contact.NAME }}
													</a>
												</li>
											{% endfor %}
										</ul>
									{% endif %}
									{% EVENT viewtopic_body_contact_fields_after %}
								</div>
							</div>
						</div>
					</details>
				</section>

			{% endif %}<!-- // private post branch -->
		</div>

		{% EVENT viewtopic_body_postrow_post_after %}
	{% endfor %}
</div>

<!-- Bottom actions -->
<div class="iz-toolbar" role="region" aria-label="{{ L_REPLY }}">
	{% EVENT viewtopic_body_topic_actions_before %}

	<div class="iz-toolbar__left">
		{% if not S_IS_BOT and S_DISPLAY_REPLY_INFO %}
			{% EVENT viewtopic_buttons_bottom_before %}
			{% if S_IS_LOCKED %}
				<a class="iz-button iz-button--danger" href="{{ U_POST_REPLY_TOPIC }}" role="button">
					{{ L_TOPIC_LOCKED_SHORT }}
				</a>
			{% else %}
				<a class="iz-button iz-button--primary" href="{{ U_POST_REPLY_TOPIC }}" role="button">
					{{ L_REPLY }}
				</a>
			{% endif %}
			{% EVENT viewtopic_buttons_bottom_after %}
		{% endif %}
	</div>

	<div class="iz-toolbar__right">
		<nav class="iz-pagination iz-pagination--bottom" aria-label="{{ L_JUMP_PAGE }}">
			{% if pagination or TOTAL_POSTS %}
				<span class="iz-pagination__count" aria-label="{{ TOTAL_POSTS }}">{{ TOTAL_POSTS }}</span>
				{% include 'pagination.html' %}
			{% else %}
				<span class="iz-pagination__current" aria-current="page">{{ PAGE_NUMBER }}</span>
			{% endif %}
		</nav>

		{% if quickmod %}
			<details class="iz-disclosure iz-disclosure--sm">
				<summary class="iz-button iz-button--secondary iz-button--sm">{{ L_MODERATOR_OPTIONS }}</summary>
				<div class="iz-disclosure__panel">
					<!-- (Tools preserved; structure modernized below in the quickmod section) -->
				</div>
			</details>
		{% endif %}

		{% if S_NUM_POSTS > 1 or .pagination %}
			<details class="iz-disclosure iz-disclosure--sm">
				<summary class="iz-button iz-button--secondary iz-button--sm">{{ L_OPTIONS }}</summary>
				<div class="iz-disclosure__panel">
					<!-- options UI is provided by includes below -->
				</div>
			</details>
		{% endif %}
	</div>
</div>

{% include 'jump_links.html' %}

{% if (S_NUM_POSTS > 1 or .pagination) and not S_IS_BOT %}
	{% include 'display_options_viewtopic.html' %}
{% endif %}

{% if quickmod %}
	<section class="iz-card iz-card--tools" aria-label="{{ L_MODERATOR_OPTIONS }}">
		<div class="iz-card__body">
			<div class="iz-grid iz-grid--2">
				<div class="iz-grid__col">
					<label class="iz-label">{{ L_JUMP_TO }}{{ L_COLON }}</label>
					<div class="iz-control">
						{% include 'jumpbox_options.html' %}
					</div>
				</div>

				<div class="iz-grid__col">
					<label class="iz-label">{{ L_QUICK_MOD }}{{ L_COLON }}</label>
					<div class="iz-control">
						{% include 'quickmod_tools.html' %}
					</div>
				</div>
			</div>
		</div>
	</section>
{% endif %}

{% EVENT viewtopic_body_footer_before %}

{% if S_USER_LOGGED_IN %}
	<div class="iz-grid iz-grid--2 iz-grid--stack-sm">
		{% if S_DISPLAY_ONLINE_LIST and U_VIEWONLINE %}
			<section class="iz-card iz-card--whois" aria-label="{{ L_WHO_IS_ONLINE }}">
				<header class="iz-card__header">
					<h2 class="iz-card__title"><a class="iz-link" href="{{ U_VIEWONLINE }}">{{ L_WHO_IS_ONLINE }}</a></h2>
				</header>
				<div class="iz-card__body">
					<p>{{ LOGGED_IN_USER_LIST }}</p>
				</div>
			</section>
		{% endif %}

		{% if S_DISPLAY_POST_INFO %}
			<section class="iz-card" aria-label="{{ L_TOPIC_PERMISSIONS }}">
				<header class="iz-card__header">
					<h2 class="iz-card__title">{{ L_TOPIC_PERMISSIONS }}</h2>
				</header>
				<div class="iz-card__body">
					<p>{% for rules in rules %}{{ rules.RULE }}<br />{% endfor %}</p>
				</div>
			</section>
		{% endif %}
	</div>
{% endif %}

{% include 'overall_footer.html' %}
