{% extends "freeform/_layouts/main" %}

{% set title = "Freeform Setup"|t('freeform') %}

{% block content %}

	<script type="application/json" id="setting-defaults">
		{
			"settings": {
				"freeform": {
					"pro": {{ craft.freeform.pro ? 'true' : 'false' }}
				}
			},
			"general": {
				"name": "{{ settings.pluginName }}",
				"defaultView": "{{ settings.defaultView }}",
				"ajax": {{ settings.defaults.settings.processing.ajax.value ? 'true' : 'false' }},
				"defaultFormattingTemplate": "{{ settings.defaults.settings.general.formattingTemplate.value }}",
				"disableSubmit": {{ settings.formSubmitDisable ? 'true' : 'false' }},
				"autoScroll": {{ settings.autoScrollToErrors ? 'true' : 'false' }},
				"jsInsertLocation": "footer",
				"jsInsertType": "{{ canInsertPointers ? "pointers" : "files" }}",
				"canInsertPointers": false,
				"sessionType": "payload"
			},
			"spam": {
				"spamFolder": {{ settings.spamFolderEnabled ? 'true' : 'false' }},
				"spamBehavior": "{{ settings.spamProtectionBehavior }}"
			},
			"reliability": {
				"errorRecipients": "{{ settings.alertNotificationRecipients }}",
				"updateNotices": {{ settings.displayFeed ? 'true' : 'false' }},
				"digestRecipients": "{{ settings.digestRecipients }}",
				"digestFrequency": {{ settings.digestFrequency }},
				"clientDigestRecipients": "{{ settings.clientDigestRecipients }}",
				"clientDigestFrequency": {{ settings.clientDigestFrequency }},
				"digestProductionOnly": {{ settings.digestOnlyOnProduction ? 'true' : 'false' }}
			}
		}
	</script>

	<div id="welcome-screen" style="min-height: 400px;"></div>

	<style>
		#header {
			display: none;
		}
	</style>

{% endblock %}
