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

<xf:form action="{{ link('options/email-handler-setup', $option) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:radiorow label="{$option.title}" name="new_type"
				value="{{ $option.option_value.enabled ? 'unchanged' : 'disabled' }}">

				<xf:option value="disabled">{{ phrase('disabled') }}</xf:option>
				<xf:if is="$option.option_value.enabled">
					<xf:set var="$unchangedHint">
						<ul class="listInline listInline--bullet listInline--selfInline">
							<li>{$option.option_value.type|to_upper}</li>
							<li>{$option.option_value.host}:{$option.option_value.port}</li>
							<xf:if is="$option.option_value.username">
								<li>{$option.option_value.username}</li>
							</xf:if>
							<xf:if is="$option.option_value.oauth AND $option.option_value.oauth.provider == 'Google'">
								<li>{{ phrase('google_oauth') }}</li>
							</xf:if>
						</ul>
					</xf:set>
					<xf:option value="unchanged" label="{{ phrase('do_not_change') }}" hint="{$unchangedHint}" />
				</xf:if>
				<xf:option value="pop3">POP3</xf:option>
				<xf:option value="imap">IMAP</xf:option>
				<xf:option value="google">{{ phrase('google_oauth') }}</xf:option>
				<xf:option value="microsoft">{{ phrase('microsoft_oauth') }}</xf:option>
			</xf:radiorow>
		</div>
		<xf:submitrow submit="{{ phrase('continue') }}" />
	</div>
</xf:form>