{% extends('layout.twig') %}

{% block content %}
<h1>Settings</h1>

<p>These settings are applied to all Fontsamplers on the site. You can set sensible defaults here, 
and if needed overwrite a specific option in a Fontsampler's unique settings.</p>
<p>Updating the default settings will update all Fontsamplers that use default settings.</p>

<form method="post" action="?page=fontsampler&amp;subpage=settings" class="form-settings fontsampler-validate">
	<input type="hidden" name="action" value="edit_settings">
	{{ wp_nonce_field( 'fontsampler-action-edit_settings' )|raw }}

	{{ include('options.twig', { 'settings': true }) }}

	{{ include('partials/preview.twig', { 'settings': true }) }}


	<h2>Font file URL paths</h2>
	<label>
		<input type="checkbox" name="admin_proxy_urls" value="1" 
		{% if admin_proxy_urls() %} checked="checked" {% endif %}>
		<span class="settings-description">Rewrite the loaded webfont file paths.</span>
		<small>By default the webfonts in the fontsamplers are loaded from their WP media gallery upload locations. Check if you wish to rewrite those paths on the fly.<br>
		Note that this does only hide the location of the files on the server, but does not stop the files from being downloadable.</small> 
		{% if admin_no_permalinks() %} <small style="color: #f30;" >NOTE: This setting will not work with 'plain' permalink structure. To use this feature, change your permalink settings under Settings > Permalinks.</small>{% endif %}
	</label>
		
	<h2>Admin interface customizations</h2>
	<label>
		<input type="checkbox"
		       name="admin_hide_legacy_formats"
		       value="1"
			   {% if admin_hide_legacy_formats() %} checked="checked" {% endif %}>
		<span class="settings-description">Hide legacy webfont formats in admin interface.</span>
		<small>When activated (recommended) this option hides all but the <span class="filename">WOFF</span> and
			<span class="filename">WOFF2</span> webfont formats, since those are the formats sufficient for rendering
			webfonts in modern browsers. Enabling this option de-clutters the interface. Disable only if you explicitly
			want to upload <span class="filename">EOT</span>, <span class="filename">SVG</span> or
			<span class="filename">TTF</span> files for the fontsamplers to use.
		</small>
	</label>
	{{ submit_button('Save') }}
</form>
<form method="post" action="?page=fontsampler&amp;subpage=settings_reset" class="form-settings fontsampler-settings-reset">
	{{ submit_button('Restore default settings', 'delete' ) }}
</form>

{% endblock %}