<div class="row">
	<div class="page-header">
		<h1>
			Application settings
			<small>
				<a ng-click="toUsers()" class="pointer">Manage users</a>
			</small>
		</h1>
	</div>

	<div>
		<form name="settingsForm" class="form-horizontal" ng-submit="save()">
			<div class="row-fluid">
				<div class="span6">
					<div class="control-group">
						<label class="control-label" for="publicUrl">Public URL</label>
						<div class="controls">
							<input type="text" id="publicUrl" name="publicUrl" class="input-block-level"
								placeholder="http://localhost:8082/commafeed" ng-model="settings.publicUrl" />
							<span class="help-block">The URL in your address bar right now, up to the # (not included)</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="allowRegistrations">Allow
							registrations</label>
						<div class="controls">
							<input type="checkbox" id="allowRegistrations" class="input-block-level"
								name="allowRegistrations" ng-model="settings.allowRegistrations" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="feedbackButton">Feedback
							button</label>
						<div class="controls">
							<input type="checkbox" id="feedbackButton" name="feedbackButton"
								class="input-block-level" ng-model="settings.feedbackButton" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="googleClientId">Google
							client ID</label>
						<div class="controls">
							<input type="text" name="googleClientId" class="input-block-level"
								ng-model="settings.googleClientId" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="googleClientSecret">Google
							client secret</label>
						<div class="controls">
							<input type="text" name="googleClientSecret" class="input-block-level"
								ng-model="settings.googleClientSecret" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="googleAnalyticsTrackingCode">Google
							Analytics tracking code</label>
						<div class="controls">
							<input type="text" name="googleAnalyticsTrackingCode" class="input-block-level"
								ng-model="settings.googleAnalyticsTrackingCode" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="googleClientSecret">Background HTTP
							threads</label>
						<div class="controls">
							<input type="number" name="backgroundThreads" class="input-block-level"
								ng-model="settings.backgroundThreads" />
							<span class="help-inline">Requires restart</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="databaseUpdateThreads">Database update 
							threads</label>
						<div class="controls">
							<input type="number" name="databaseUpdateThreads" class="input-block-level"
								ng-model="settings.databaseUpdateThreads" />
							<span class="help-inline">Requires restart</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="announcement">Announcement</label>
						<div class="controls">
							<textarea name="announcement" rows="10" class="input-block-level"
								ng-model="settings.announcement">
							</textarea>
						</div>
					</div>
				</div>
				<div class="span6">
					<div class="control-group">
						<label class="control-label" for="announcement">SMTP Host</label>
						<div class="controls">
							<input type="text" name="smtpHost" class="input-block-level" 
								ng-model="settings.smtpHost" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="announcement">SMTP Port</label>
						<div class="controls">
							<input type="text" name="smtpPort" class="input-block-level" 
								ng-model="settings.smtpPort" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="smtpTls">SMTP TLS </label>
						<div class="controls">
							<input type="checkbox" name="smtpTls" class="input-block-level" 
								ng-model="settings.smtpTls" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="smtpUserName">SMTP
							Username</label>
						<div class="controls">
							<input type="text" name="smtpUserName" class="input-block-level"
								ng-model="settings.smtpUserName" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="smtpPassword">SMTP
							Password</label>
						<div class="controls">
							<input type="password" name="smtpPassword" class="input-block-level"
								ng-model="settings.smtpPassword" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="heavyLoad">Heavy load</label>
						<div class="controls">
							<input type="checkbox" name="heavyLoad" ng-model="settings.heavyLoad" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="pubsubhubbub">PubSubHubbub</label>
						<div class="controls">
							<input type="checkbox" name="pubsubhubbub" ng-model="settings.pubsubhubbub" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="imageProxyEnabled">Proxy entry images</label>
						<div class="controls">
							<input type="checkbox" name="imageProxyEnabled" ng-model="settings.imageProxyEnabled" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="logLevel">Logging level</label>
						<div class="controls">
							<select name="logLevel" ng-model="settings.logLevel" class="input-block-level"
								ng-options="level for level in ['DEBUG', 'INFO', 'WARN', 'ERROR']">
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="logLevel">Database query timeout (ms)</label>
						<div class="controls">
							<input type="number" name="queryTimeout" class="input-block-level"
								ng-model="settings.queryTimeout" />
						</div>
					</div>
				</div>
			</div>
			<div class="control-group">
				<div class="controls">
					<button type="button" class="btn" ng-click="cancel()">Cancel</button>
					<button type="submit" class="btn btn-primary">Save</button>
				</div>
			</div>
		</form>
	</div>
</div>