<tal:block metal:use-macro="python:here.getFormsTool().getForm('site_macro_schema_edit').macros['page']">

<!-- Custom File fields -->
<tal:block metal:fill-slot="custom_properties">

<!-- Download file name -->
<div class="field">
	<input type="hidden" name="downloadfilename" id="downloadfilename" size="40" tal:attributes="value python:here.getSession('downloadfilename', here.getVersionProperty('downloadfilename'))" />
</div>

<br />
<!-- Attached file -->
<fieldset style="background-color: #F9FCFE">
<legend>
	<span i18n:translate="">Attached file</span>
	<span tal:condition="python:here.get_pluggable_item_property_mandatory(here.meta_type, 'file')" class="mandatory_field"> *</span>
</legend>

<div class="field-inline" tal:condition="python:here.get_size()>0">
	<input type="radio" name="source" id="source-none" value="" checked="checked" />
	<label for="source-none" i18n:translate="">Keep</label>
	<tal:block define="download_url here/getEditDownloadUrl;
			size python:here.utShowSizeKb(here.size);
			icon python:here.rstk['icon_for_content_type'](here.content_type);
			title python:icon['title'];
			url python:icon['url']">
		<a tal:attributes="href download_url">
			<img tal:attributes="src url;
								alt title;
								title title" />
			<span tal:replace="string:${here/downloadfilename} (${title}, ${size} Kb)"/>
		</a>
	</tal:block>
</div>
<div class="field-inline">
	<input type="radio" name="source" id="source-file" value="file" tal:attributes="checked python:test(here.get_size()<=0, 'checked', None)"/>
	<label for="source-file" i18n:translate="">Upload file</label>
	<input type="file" name="file" id="file" value="" size="50" onclick="document.getElementById('source-file').checked='checked'"/>
</div>
<div class="field-inline">
	<input type="radio" name="source" id="source-url" value="url" />
	<label for="source-url" i18n:translate="">Get from URL</label>
	<input type="text" name="url" id="url" value="" size="50" onclick="document.getElementById('source-url').checked='checked'"/>
</div>
<div class="field-inline">
	<input type="checkbox" name="version" id="version" checked="checked"/>
	<label for="version" i18n:translate="">Check this to create a new version and maintain the previous one(s)</label>
</div>

</fieldset>
</tal:block>

</tal:block>
