<tal:block tal:define="this_absolute_url python:here.absolute_url(0);
    submissions here/process_submissions;
    perm_add_something python:len(submissions)>0;
    perm_edit_object here/checkPermissionEditObject;
    perm_del_object here/checkPermissionDeleteObject;
    perm_publish_objects here/checkPermissionPublishObjects;
    perm_validate_objects here/checkPermissionValidateObjects">
<div id="admin_this_folder" tal:condition="python:perm_add_something or perm_edit_object and perm_publish_objects or perm_validate_objects">
    <tal:block condition="perm_add_something">
        <select name="typetoadd"
            tal:attributes="onchange string:document.location.href='${this_absolute_url}/' + this.options[this.selectedIndex].value">
            <option value="#"><tal:block i18n:translate="">Add content</tal:block>...</option>
            <option tal:repeat="item submissions"
                tal:attributes="value python:item[0]"
                tal:content="python:item[1]" i18n:translate="" />
        </select>
    </tal:block>
	<a tal:condition="perm_edit_object"
		tal:attributes="href string:${this_absolute_url}/edit_html"><span i18n:translate="">Edit folder</span></a>
	<a tal:condition="perm_del_object"
		tal:attributes="href string:${this_absolute_url}/deleteThis"
		onclick="return confirm(gettext('Are you sure?'))"><span i18n:translate="">Delete folder</span></a>
	<select tal:condition="perm_publish_objects" name="more_actions" class="more_actions"
		tal:attributes="onchange string:document.location.href='${this_absolute_url}/' + this.options[this.selectedIndex].value">
		<option value="#"><tal:block i18n:translate="">More actions</tal:block>...</option>
		<option value="subobjects_html"
			i18n:translate="" >Manage content types</option>
		<option value="basketofapprovals_html"
			i18n:translate="" >Approve/unapprove content</option>
		<option value="sortorder_html"
			i18n:translate="" >Sort content</option>
		<option value="restrict_html"
			i18n:translate="" >Restrict folder</option>
		<option value="csv_export"
			i18n:translate="" >Export content</option>
		<option value="csv_import"
			i18n:translate="" >Import content</option>
	</select>
</div>
</tal:block>
