<xf:title>{$option.title}</xf:title>

<xf:form action="{{ link('options/email-transport-server', $option) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:formrow label="{{ phrase('connection_type') }}">
				{$type|to_upper}
				<xf:hiddenval name="emailTransport" value="{$type}" />
			</xf:formrow>

			<xf:set var="$values" value="{{ $type == $option.option_value.emailTransport ? $option.option_value : [] }}" />

			<xf:formrow label="{{ phrase('host') }}" rowtype="input">
				<div class="inputGroup">
					<xf:textbox name="smtpHost" value="{$values.smtpHost}" placeholder="{{ phrase('host') }}" size="40" required="required" />
					<span class="inputGroup-text">:</span>
					<xf:textbox name="smtpPort" value="{$values.smtpPort}" placeholder="{{ phrase('port') }}" size="5" required="required" />
				</div>
			</xf:formrow>

			<xf:radiorow label="{{ phrase('authentication') }}" name="smtpAuth" value="{{ $values.smtpAuth ?: 'none' }}">
				<xf:option value="none">{{ phrase('none') }}</xf:option>
				<xf:option value="login" label="{{ phrase('user_name_and_password') }}">
					<xf:dependent>
						<div class="inputGroup">
							<xf:textbox name="smtpLoginUsername" value="{$values.smtpLoginUsername}" placeholder="{{ phrase('user_name') }}" size="15" />
							<span class="inputGroup-splitter"></span>
							<xf:textbox name="smtpLoginPassword" placeholder="{{ phrase('password') }}" type="password" size="15" />
						</div>
					</xf:dependent>
				</xf:option>
			</xf:radiorow>

			<xf:checkboxrow>
				<xf:option name="smtpSsl" checked="{$values.smtpSsl}"
					label="{{ phrase('use_ssl_tls') }}"
					hint="{{ phrase('email_transport_smtp_ssl_hint') }}" />
			</xf:checkboxrow>
		</div>
		<xf:submitrow sticky="true" icon="save" />
	</div>
</xf:form>