<header>
	<a href="#" class="close" data-bind="click: close">×</a>
	<h3 data-i18n="OPENPGP/POPUP_GENERATE_TITLE"></h3>
</header>
<form id="openpgp-generate" class="modal-body form-horizontal" autocomplete="off" data-bind="submit: submitForm">
	<div class="alert" data-bind="visible: '' !== submitError()">
		<a href="#" class="close" data-bind="click: function () { submitError('') }">×</a>
		<span data-bind="text: submitError"></span>
	</div>
	<!-- Disable stupid browser password autofill -->
	<input type="password" style="display:none">
	<div class="control-group" data-bind="css: {'error': emailError}">
		<label data-i18n="GLOBAL/EMAIL"></label>
		<input type="email" required="" class="input-xlarge"
			autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
			list="emailaddresses" data-bind="value: email">
		<datalist id="emailaddresses">
			<!-- ko foreach: identities -->
			<option data-bind="attr:{value:email}"></option>
			<!-- /ko -->
		</datalist>
	</div>
	<div class="control-group">
		<label data-i18n="GLOBAL/NAME"></label>
		<input type="text" required="" class="input-xlarge"
			autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
			data-bind="value: name">
	</div>
	<div class="control-group">
		<label data-i18n="GLOBAL/PASSWORD"></label>
		<input type="password" required="" class="input-xlarge"
			autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false"
			data-bind="value: password">
	</div>
	<div class="control-group">
		<label data-i18n="OPENPGP/LABEL_KEY_TYPE"></label>
		<select data-bind="value: keyType, options: ['ECC', 'RSA']"></select>
	</div>
	<div class="control-group">
		<div data-bind="component: {
			name: 'Checkbox',
			params: {
				label: 'Backup public key on server',
				value: backupPublicKey
			}
		}"></div>
		<br>
		<div data-bind="component: {
			name: 'Checkbox',
			params: {
				label: 'Backup private key on server',
				value: backupPrivateKey
			}
		}"></div>
		<br>
		<div data-bind="visible: canGnuPG, component: {
			name: 'Checkbox',
			params: {
				label: 'Store public key on server in GnuPG',
				value: saveGnuPGPublic
			}
		}"></div>
		<br>
		<div data-bind="visible: canGnuPG, component: {
			name: 'Checkbox',
			params: {
				label: 'Store private key on server in GnuPG',
				value: saveGnuPGPrivate
			}
		}"></div>
	</div>
</form>
<footer>
	<button class="btn" form="openpgp-generate">
		<i class="fontastic" data-bind="css: {'icon-spinner': submitRequest()}">🔑</i>
		<span data-i18n="OPENPGP/POPUP_GENERATE_BUTTON"></span>
	</button>
</footer>
