<div class="row">
	<div class="col-12">
		<h1 class="h4 mb-3">{{ title }}</h1>
		<form action="{{ admin_dir }}/settings/general/" method="post" class="needs-validation" autocomplete="off" novalidate>
			<div class="row">
				<div class="col-12 col-md-6">
					<div class="form-group">
						<label for="main_site">Main Site Homepage URL</label>
						<input type="url" name="opt[main_site]" id="main_site" placeholder="Example: http://mainsite.com/" class="form-control" value="{{ main_site }}" required>
						<small class="form-text text-muted">Main site as public video player generator. If someone accesses the video player generator from a load balancer site then they will be redirected to this main site.</small>
					</div>
					<div class="form-group">
						<label for="timezone">Timezone</label>
						<select name="opt[timezone]" id="timezone" class="form-control select2">
                            {% for dt in timezone_list %}
							    <option value="{{ dt }}" {{ dt == timezone ? 'selected' : '' }}>{{ dt }}</option>
                            {% endfor %}
						</select>
					</div>
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="production_mode" name="opt[production_mode]" value="true" {{ production_mode ? 'checked' : '' }}>
							<label class="custom-control-label" for="production_mode">Production Mode</label>
						</div>
						<small class="form-text text-muted">If you enabled this option, we will encrypt the javascript code.</small>
					</div>
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="load_balancer_rand" name="opt[load_balancer_rand]" value="true" {{ load_balancer_rand ? 'checked' : '' }}>
							<label class="custom-control-label" for="load_balancer_rand">Video Stream Rand</label>
						</div>
						<small class="form-text text-muted">Checked = Direct URL (stream) video will be selected from alternative source randomly.<br>Unchecked = A list of alternative hosts will be displayed on the embed page.</small>
					</div>
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="disable_validation" name="opt[disable_validation]" value="true" {{ disable_validation ? 'checked' : '' }}>
							<label class="custom-control-label" for="disable_validation">Disable Validation</label>
						</div>
						<small class="form-text text-muted">If you enable this option then CORS Policy and token validation are disabled. Be careful using this feature as your site is vulnerable to DDoS attacks.</small>
					</div>
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="gdrive_copy" name="opt[gdrive_copy]" value="true" {{ gdrive_copy ? 'checked' : '' }}>
							<label class="custom-control-label" for="gdrive_copy">Enable Always Copy Google Drive Files</label>
						</div>
						<small class="form-text text-muted">If you enable this option, Google Drive videos embedded by users or the public will be backed up to any Google Drive account.</small>
					</div>
					<div class="form-group">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="gdrive_copy_all" name="opt[gdrive_copy_all]" value="true" {{ gdrive_copy_all ? 'checked' : '' }}>
							<label class="custom-control-label" for="gdrive_copy_all">Enable Always Copy Google Drive Files to All Accounts</label>
						</div>
						<small class="form-text text-muted">If you enable this option, Google Drive videos embedded by users or public will be backed up to all Google Drive accounts.</small>
					</div>
					<div class="form-group">
						<label for="visit_counter">Visit Counter</label>
						<input type="number" min="1" class="form-control" name="opt[visit_counter]" id="visit_counter" placeholder="Insert Max. Views Per Video/IP" value="{{ visit_counter }}">
						<small class="form-text text-muted">Maximum number of views per Video/IP within 24 hours.</small>
					</div>
					<div class="form-group">
						<label for="visit_counter_runtime">Visit Counter Running Time</label>
						<div class="input-group">
							<input type="text" class="form-control" name="opt[visit_counter_runtime]" id="visit_counter_runtime" placeholder="Insert Visit Counter Running Time" value="{{ visit_counter_runtime }}">
							<div class="input-group-append">
								<div class="input-group-text">Seconds</div>
							</div>
						</div>
						<small class="form-text text-muted">The visit counter will run once the video is played equal to/more than that time.</small>
					</div>
					<div class="form-group">
						<label for="maxmind_license_key">MaxMind License Key</label>
						<input type="text" class="form-control" name="opt[maxmind_license_key]" id="maxmind_license_key" value="{{ maxmind_license_key }}" placeholder="Insert MaxMind License Key">
						<small class="form-text text-muted">You need MaxMind License Key to update GeoIP information for validation system to work properly to avoid DDoS attacks.</small>
					</div>
				</div>
				<div class="col-12 col-md-6">
					<div class="form-group">
						<label for="uptobox_api">Uptobox API Token</label>
						<input type="text" class="form-control" name="opt[uptobox_api]" id="uptobox_api" value="{{ uptobox_api }}" placeholder="Insert Uptobox API Token">
					</div>
					<div class="form-group">
						<label for="anti_captcha">
							<a href="https://bit.ly/3rCQPtU" target="_blank" rel="noopener">Anti-Captcha</a>
							API Key</label>
						<input type="text" class="form-control" name="opt[anti_captcha]" id="anti_captcha" value="{{ anti_captcha }}" placeholder="Insert Anti-Captcha API Key">
						<small class="form-text text-muted">This Anti-Captcha API key will be used to fetch videos from various hostings. Ex. To get DoodStream sources, get Uptobox multi-resolution</small>
					</div>
					<div class="form-group">
						<label for="google_analytics_id">
							<a href="https://analytics.google.com/" target="_blank" rel="noopener">Google Analytics</a>
							ID</label>
						<input type="text" class="form-control" name="opt[google_analytics_id]" id="google_analytics_id" placeholder="Example: UA-123456" value="{{ google_analytics_id }}">
					</div>
					<div class="form-group">
						<label for="google_tag_manager">
							<a href="https://tagmanager.google.com/" target="_blank" rel="noopener">Google Tag Manager</a>
							ID</label>
						<input type="text" class="form-control" name="opt[google_tag_manager]" id="google_tag_manager" placeholder="Example: GTM-123456" value="{{ google_tag_manager }}">
					</div>
					<div class="form-group">
						<label for="histats_id">
							<a href="https://www.histats.com/" target="_blank" rel="noopener">Histats</a>
							SID</label>
						<input type="text" class="form-control" name="opt[histats_id]" id="histats_id" placeholder="Insert Histats SID" value="{{ histats_id }}">
					</div>
					<div class="form-group">
						<label for="recaptcha_site_key">
							<a href="https://www.google.com/recaptcha/admin" target="_blank" rel="noopener">Google ReCaptcha</a>
							Site Key</label>
						<input type="text" class="form-control" name="opt[recaptcha_site_key]" id="recaptcha_site_key" placeholder="Insert Google ReCaptcha Site Key" value="{{ recaptcha_site_key }}">
					</div>
					<div class="form-group">
						<label for="recaptcha_secret_key">Google ReCaptcha Secret Key</label>
						<input type="text" class="form-control" name="opt[recaptcha_secret_key]" id="recaptcha_secret_key" placeholder="Insert Google ReCaptcha Secret Key" value="{{ recaptcha_secret_key }}">
					</div>
					<div class="form-group">
						<label for="disqus_shortname">Disqus Shortname</label>
						<div class="input-group">
							<input type="text" name="opt[disqus_shortname]" id="disqus_shortname" placeholder="Insert Disqus Shortname" class="form-control" value="{{ disqus_shortname }}">
							<div class="input-group-append">
								<div class="input-group-text">.disqus.com</div>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="chat_widget">Chat Widget Script</label>
						<textarea name="opt[chat_widget]" id="chat_widget" cols="30" rows="5" class="form-control" placeholder="Enter the Chat Widget javascript code (with the <script> tag)">{{ chat_widget }}</textarea>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col">
					<button type="submit" class="btn btn-success shadow-sm">
						<em class="fas fa-save mr-2"></em>Update
					</button>
				</div>
			</div>
		</form>
	</div>
</div>
