<metal:block metal:use-macro="here/standard_template_macro">

<metal:block fill-slot="body">
<tal:block define="folder_path python:here.aq_parent.absolute_url(1);
                   xls python:here.rstk['we_provide']('Excel export')">

<h1 tal:content="here/title_or_id" i18n:translate="" />

<div class="floated-buttons"><span class="buttons">
	<a tal:attributes="href here/aq_parent/absolute_url" i18n:translate="">Back to index</a></span>
</div>

<p tal:condition="xls" i18n:translate="">
    You can export information stored in
    <i i18n:name="folder" tal:content="folder_path" />
    as a CSV or Excel file by choosing the content type and the file format.
</p>
<p tal:condition="not:xls" i18n:translate="">
    You can export information stored in
    <i i18n:name="folder" tal:content="folder_path" />
    as a CSV file by choosing the content type.
</p>

<form name="csv_import" action="" method="post" enctype="multipart/form-data">

<div class="field-inline">
    <label for="meta_type-input"
           i18n:translate="">Object type</label>
    <select id="meta_type-input" name="meta_type">
    <option tal:define="sel python:options.get('meta_type', None);
                        schema_tool python:here.getSite().getSchemaTool();
                        schemas python:schema_tool.listSchemas(installed=True)"
            tal:repeat="schema python:schemas.iteritems()"
            tal:attributes="value python:schema[0];
                            selected python:test(schema[0] == sel,
                                                 'selected', None)"
            tal:content="python:schema[1].title_or_id()" />
    </select>
</div>
<div class="field-inline" tal:condition="xls">
    <label for="file_type"
           i18n:translate="">Export as</label>
    <select id="file_type" name="file_type">
        <option value="CSV" i18n:translate="">CSV</option>
        <option value="Excel" i18n:translate="">Microsoft Excel</option>
    </select>
</div>

<div class="field">
    <input type="hidden" name="as_attachment:boolean" value="True" />
    <input type="submit" name="export:method" value="Download"/>
</div>

</form>

</tal:block>
</metal:block>

</metal:block>
