##This file is based on the template from the SimpleWiki source which carries the GPL license
##This file has been converted to Mako, but not tested. It is because uploads are disabled for the wiki. If they are reenabled, this may contain bugs.
<%!
    from django.template.defaultfilters import filesizeformat
%>


%if started:
<script type="text/javascript">
	parent.document.getElementById("wiki_attach_progress_container").style.display='block';
</script>
%else:
%if finished:
<script type="text/javascript">
	parent.document.getElementById("wiki_attach_progress_container").style.display='none';
	parent.location.reload();
</script>
%else:
%if overwrite_warning:
<script type="text/javascript">
	if (confirm('Warning: The filename already exists? Really overwrite ${ filename }?'))
		parent.document.getElementById("wiki_attach_overwrite").checked=true;
		parent.document.getElementById("wiki_attach_overwrite").form.submit();
</script>
%else:
%if too_big:
<script type="text/javascript">
	alert('File is too big. Maximum: ${filesizeformat(max_size)}\nYour file was: ${filesizeformat(file.size)}');
</script>
%else:
<script type="text/javascript">
	parent.document.getElementById("wiki_attach_progress").style.width='${progress_width}%';
</script>
%endif
%endif
%endif
%endif
