{% include 'mcp_header.html' %}

<div class="iz-mcp">

	{% EVENT mcp_front_latest_unapproved_before %}
	{% if S_SHOW_UNAPPROVED %}
	<form id="mcp_queue" class="iz-form" method="post" action="{{ S_MCP_QUEUE_ACTION }}">
		<section class="iz-card iz-card--mcp" aria-labelledby="iz-mcp-unapproved-title">
			<header class="iz-card__header">
				<h2 class="iz-card__title" id="iz-mcp-unapproved-title">{{ L_LATEST_UNAPPROVED }}</h2>
			</header>

			<div class="iz-card__body">
				{% if S_HAS_UNAPPROVED_POSTS %}
					<p class="iz-help">{{ L_UNAPPROVED_TOTAL }}</p>
				{% endif %}

				{% if unapproved %}
					<div class="iz-table" role="region" aria-label="{{ L_LATEST_UNAPPROVED }}">
						<table class="iz-table__table">
							<thead class="iz-table__head">
								<tr class="iz-table__row">
									<th scope="col" class="iz-table__th iz-table__th--grow">{{ L_VIEW_DETAILS }}</th>
									<th scope="col" class="iz-table__th">{{ L_TOPIC }}&nbsp;{{ L_FORUM }}</th>
									<th scope="col" class="iz-table__th iz-table__th--choice">{{ L_MARK }}</th>
								</tr>
							</thead>

							<tbody class="iz-table__body">
								{% for unapproved in unapproved %}
								<tr class="iz-table__row">
									<td class="iz-table__td">
										<div class="iz-topicline">
											<div class="iz-topicline__title">
												<a class="iz-link iz-link--strong" href="{{ unapproved.U_POST_DETAILS }}">{{ unapproved.SUBJECT }}</a>
												{% if unapproved.ATTACH_ICON_IMG %}
													<span class="iz-badge iz-badge--neutral" title="{{ L_ATTACH_FORUM }}">{{ L_ATTACH_FORUM }}</span>
												{% endif %}
											</div>

											<div class="iz-topicline__meta">
												{{ L_POST_BY_AUTHOR }}&nbsp;{{ unapproved.AUTHOR_FULL }}&nbsp;&#45;&nbsp;<small><time>{{ unapproved.POST_TIME }}</time></small>
											</div>
										</div>
									</td>

									<td class="iz-table__td">
										<div class="iz-meta">
											<div>
												{{ L_TOPIC }}{{ L_COLON }}&nbsp;<a class="iz-link" href="{{ unapproved.U_TOPIC }}">{{ unapproved.TOPIC_TITLE }}</a>
												&nbsp;&#91;<a class="iz-link iz-link--muted" href="{{ unapproved.U_MCP_TOPIC }}">{{ L_MODERATE }}</a>&#93;
											</div>
											<div>
												{{ L_FORUM }}{{ L_COLON }}&nbsp;
												{% if unapproved.U_FORUM %}
													<a class="iz-link" href="{{ unapproved.U_FORUM }}">{{ unapproved.FORUM_NAME }}</a>
												{% else %}
													{{ unapproved.FORUM_NAME }}
												{% endif %}
												{% if unapproved.U_MCP_FORUM %}
													&nbsp;&#91;<a class="iz-link iz-link--muted" href="{{ unapproved.U_MCP_FORUM }}">{{ L_MODERATE }}</a>&#93;
												{% endif %}
											</div>
										</div>
									</td>

									<td class="iz-table__td iz-table__td--choice">
										<label class="iz-choice" for="un-{{ unapproved.POST_ID }}">
											<input class="iz-choice__input" type="checkbox" id="un-{{ unapproved.POST_ID }}" name="post_id_list[]" value="{{ unapproved.POST_ID }}">
											<span class="iz-choice__label">{{ L_MARK }}</span>
										</label>
									</td>
								</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>

					<fieldset class="iz-actions iz-actions--split" aria-label="{{ L_OPTIONS }}">
						{{ S_HIDDEN_FIELDS }}

						<div class="iz-actions__left">
							<button class="iz-btn iz-btn--primary" type="submit" name="action[approve]" id="action[approve]" value="{{ L_APPROVE }}">
								{{ L_APPROVE }}
							</button>
							<button class="iz-btn iz-btn--secondary" type="submit" name="action[disapprove]" id="action[disapprove]" value="{{ L_DISAPPROVE }}">
								{{ L_DISAPPROVE }}
							</button>
						</div>

						<div class="iz-actions__right">
							<button class="iz-btn iz-btn--secondary" type="button"
									onclick="marklist('mcp_queue', 'post_id_list', true); return false;"
									title="{{ L_MARK_ALL }}">
								{{ L_MARK_ALL }}
							</button>
							<button class="iz-btn iz-btn--secondary" type="button"
									onclick="marklist('mcp_queue', 'post_id_list', false); return false;"
									title="{{ L_UNMARK_ALL }}">
								{{ L_UNMARK_ALL }}
							</button>
						</div>
					</fieldset>

					{{ S_FORM_TOKEN }}
				{% else %}
					<p class="iz-help"><strong>{{ L_INFO_BOX }}</strong>&nbsp;{{ L_MCP_UNAPPROVED_POSTS_ZERO }}</p>
					{{ S_FORM_TOKEN }}
				{% endif %}
			</div>
		</section>
	</form>
	{% endif %}


	{% EVENT mcp_front_latest_reported_before %}
	{% if S_SHOW_REPORTS %}
	<section class="iz-card iz-card--mcp" aria-labelledby="iz-mcp-reported-title">
		<header class="iz-card__header">
			<h2 class="iz-card__title" id="iz-mcp-reported-title">{{ L_LATEST_REPORTED }}</h2>
		</header>

		<div class="iz-card__body">
			{% if S_HAS_REPORTS %}
				<p class="iz-help">{{ L_REPORTS_TOTAL }}</p>
			{% endif %}

			{% if report %}
				<div class="iz-table" role="region" aria-label="{{ L_LATEST_REPORTED }}">
					<table class="iz-table__table">
						<thead class="iz-table__head">
							<tr class="iz-table__row">
								<th scope="col" class="iz-table__th iz-table__th--grow">{{ L_VIEW_DETAILS }}</th>
								<th scope="col" class="iz-table__th">{{ L_REPORTER }}&nbsp;&amp;&nbsp;{{ L_FORUM }}</th>
							</tr>
						</thead>

						<tbody class="iz-table__body">
							{% for report in report %}
							<tr class="iz-table__row">
								<td class="iz-table__td">
									<div class="iz-topicline">
										<div class="iz-topicline__title">
											<a class="iz-link iz-link--strong" href="{{ report.U_POST_DETAILS }}#reports">{{ report.SUBJECT }}</a>
											{% if report.ATTACH_ICON_IMG %}
												<span class="iz-badge iz-badge--neutral" title="{{ L_ATTACH_FORUM }}">{{ L_ATTACH_FORUM }}</span>
											{% endif %}
										</div>
										<div class="iz-topicline__meta">
											{{ L_POST_BY_AUTHOR }}&nbsp;{{ report.AUTHOR_FULL }}&nbsp;&#45;&nbsp;<small><time>{{ report.POST_TIME }}</time></small>
										</div>
									</div>
								</td>

								<td class="iz-table__td">
									<div class="iz-meta">
										<div>
											{{ L_REPORTED }}&nbsp;{{ L_POST_BY_AUTHOR }}&nbsp;{{ report.REPORTER_FULL }}&nbsp;{{ L_REPORTED_ON_DATE }}{{ L_COLON }}&nbsp;<small><time>{{ report.REPORT_TIME }}</time></small>
										</div>
										<div>
											{{ L_FORUM }}{{ L_COLON }}&nbsp;<a class="iz-link" href="{{ report.U_FORUM }}">{{ report.FORUM_NAME }}</a>
										</div>
									</div>
								</td>
							</tr>
							{% endfor %}
						</tbody>
					</table>
				</div>
			{% else %}
				<p class="iz-help"><strong>{{ L_INFO_BOX }}</strong>&nbsp;{{ L_MCP_REPORTS_ZERO }}</p>
			{% endif %}
		</div>
	</section>
	{% endif %}


	{% EVENT mcp_front_latest_reported_pms_before %}
	{% if S_SHOW_PM_REPORTS %}
	<section class="iz-card iz-card--mcp" aria-labelledby="iz-mcp-reported-pms-title">
		<header class="iz-card__header">
			<h2 class="iz-card__title" id="iz-mcp-reported-pms-title">{{ L_LATEST_REPORTED_PMS }}</h2>
		</header>

		<div class="iz-card__body">
			{% if S_HAS_PM_REPORTS %}
				<p class="iz-help">{{ L_PM_REPORTS_TOTAL }}</p>
			{% endif %}

			{% if pm_report %}
				<div class="iz-table" role="region" aria-label="{{ L_LATEST_REPORTED_PMS }}">
					<table class="iz-table__table">
						<thead class="iz-table__head">
							<tr class="iz-table__row">
								<th scope="col" class="iz-table__th iz-table__th--grow">{{ L_VIEW_DETAILS }}</th>
								<th scope="col" class="iz-table__th">{{ L_REPORTER }}</th>
							</tr>
						</thead>

						<tbody class="iz-table__body">
							{% for pm_report in pm_report %}
							<tr class="iz-table__row">
								<td class="iz-table__td">
									<div class="iz-topicline">
										<div class="iz-topicline__title">
											<a class="iz-link iz-link--strong" href="{{ pm_report.U_PM_DETAILS }}">{{ pm_report.PM_SUBJECT }}</a>
											{% if pm_report.ATTACH_ICON_IMG %}
												<span class="iz-badge iz-badge--neutral" title="{{ L_ATTACH_FORUM }}">{{ L_ATTACH_FORUM }}</span>
											{% endif %}
										</div>

										<div class="iz-topicline__meta">
											{{ L_MESSAGE_BY_AUTHOR }}&nbsp;{{ pm_report.PM_AUTHOR_FULL }}&nbsp;{{ L_MESSAGE_TO }}&nbsp;{{ pm_report.RECIPIENTS }}&nbsp;&#45;&nbsp;
											<small><time>{{ pm_report.PM_TIME }}</time></small>
										</div>
									</div>
								</td>

								<td class="iz-table__td">
									{{ L_REPORTED }}&nbsp;{{ L_POST_BY_AUTHOR }}&nbsp;{{ pm_report.REPORTER_FULL }}
									<br>
									{{ L_REPORTED_ON_DATE }}{{ L_COLON }}&nbsp;<small><time>{{ pm_report.REPORT_TIME }}</time></small>
								</td>
							</tr>
							{% endfor %}
						</tbody>
					</table>
				</div>
			{% else %}
				<p class="iz-help"><strong>{{ L_INFO_BOX }}</strong>&nbsp;{{ L_MCP_PM_REPORTS_ZERO }}</p>
			{% endif %}
		</div>
	</section>
	{% endif %}


	{% EVENT mcp_front_latest_logs_before %}
	{% if S_SHOW_LOGS %}
	<section class="iz-card iz-card--mcp" aria-labelledby="iz-mcp-logs-title">
		<header class="iz-card__header">
			<h2 class="iz-card__title" id="iz-mcp-logs-title">{{ L_LATEST_LOGS }}</h2>
		</header>

		<div class="iz-card__body">
			<div class="iz-table" role="region" aria-label="{{ L_LATEST_LOGS }}">
				<table class="iz-table__table">
					<thead class="iz-table__head">
						<tr class="iz-table__row">
							<th scope="col" class="iz-table__th iz-table__th--grow">{{ L_ACTION }}</th>
							<th scope="col" class="iz-table__th">{{ L_MCP_DETAIL_U_IP }}</th>
							<th scope="col" class="iz-table__th">{{ L_MCP_DETAILS_LOG }}</th>
						</tr>
					</thead>

					<tbody class="iz-table__body">
						{% for log in log %}
						<tr class="iz-table__row">
							<td class="iz-table__td">{{ log.ACTION }}</td>
							<td class="iz-table__td">
								{{ log.USERNAME }}<br>
								{{ log.IP }}<br>
								<small><time>{{ log.TIME }}</time></small>
							</td>
							<td class="iz-table__td">
								{% if log.U_VIEW_TOPIC %}
									<a class="iz-link" href="{{ log.U_VIEW_TOPIC }}" title="{{ L_VIEW_TOPIC }}">{{ L_VIEW_TOPIC }}</a>
								{% endif %}
								<br>
								{% if log.U_VIEWLOGS %}
									<a class="iz-link iz-link--muted" href="{{ log.U_VIEWLOGS }}" title="{{ L_VIEW_TOPIC_LOGS }}">{{ L_VIEW_TOPIC_LOGS }}</a>
								{% endif %}
							</td>
						</tr>
						<!-- BEGINELSE -->
						<tr class="iz-table__row">
							<td class="iz-table__td" colspan="3">{{ L_NO_ENTRIES }}</td>
						</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</section>
	{% endif %}
	{% EVENT mcp_front_latest_logs_after %}

</div>

{% include 'mcp_footer.html' %}
