<xf:title>{{ phrase('question_and_answer_captchas') }}</xf:title>

<xf:pageaction>
	<xf:button href="{{ link('captcha-questions/add') }}" icon="add">{{ phrase('add_question') }}</xf:button>
</xf:pageaction>

<xf:if is="$questions is not empty">
	<xf:form action="{{ link('captcha-questions/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro id="filter_macros::quick_filter" arg-key="questions" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$questions" value="$question">
						<xf:datarow>
							<xf:main hash="{$question.captcha_question_id}"
								href="{{ link('captcha-questions/edit', $question) }}"
								label="{$question.question}" />
							<xf:toggle name="active[{$question.captcha_question_id}]" selected="$question.active"
								class="dataList-cell--separated" submit="true"
								tooltip="{{ phrase('enable_disable_x', {'title': $question.question}) }}" />
							<xf:delete href="{{ link('captcha-questions/delete', $question) }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($questions) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>