1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
{% extends "admin/base_site.html" %}
<!-- LOADING -->
{% load i18n adminmedia fb_tags %}
<!-- STYLESHEETS -->
{% block stylesheets %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
<link rel="stylesheet" type="text/css" href="{{ settings_var.URL_FILEBROWSER_MEDIA }}css/filebrowser.css" />
<link rel="stylesheet" type="text/css" href="{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/uploadify.css" />
{% endblock %}
<!-- JAVASCRIPTS -->
{% block javascripts %}
{{ block.super }}
<script type="text/javascript" src="../../jsi18n/"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script>
<script type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/jquery.uploadify.v2.1.0.js"></script>
<script type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/swfobject.js"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/admin/CollapsedFieldsets.js"></script>
<script type="text/javascript">
(function($){
$(document).ready(function() {
$('#id_file').uploadify({
'uploader' : '{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/uploadify.swf',
'script' : '{% url fb_do_upload %}',
'scriptData' : {'session_key': '{{session_key}}'},
'checkScript' : '{% url fb_check %}',
'cancelImg' : '{{ settings_var.URL_FILEBROWSER_MEDIA }}uploadify/cancel.png',
'auto' : false,
'folder' : '{{ query.dir }}',
'multi' : true,
'fileDesc' : '{% for extension in settings_var.EXTENSIONS.items %}{% ifnotequal extension.0 'Folder' %}{% for item in extension.1 %}*{{ item|safe }};{% endfor %}{% endifnotequal %}{% endfor %}',
'fileExt' : '{% for extension in settings_var.EXTENSIONS.items %}{% ifnotequal extension.0 'Folder' %}{% for item in extension.1 %}*{{ item|safe }};{% endfor %}{% endifnotequal %}{% endfor %}',
'sizeLimit' : {{ settings_var.MAX_UPLOAD_SIZE }},
'scriptAccess' : 'sameDomain',
'queueSizeLimit' : 50,
'simUploadLimit' : 1,
'width' : 300,
'height' : 30,
'hideButton' : false,
'wmode' : 'transparent',
translations : {
browseButton: '{% trans "BROWSE" %}',
error: '{% trans "An Error occured" %}',
completed: '{% trans "Completed" %}',
replaceFile: '{% trans "Do you want to replace the file" %}',
unitKb: '{% trans "KB" %}',
unitMb: '{% trans "MB" %}'
}
});
$('input:submit').click(function(evt){
$('#id_file').uploadifyUpload();
return false;
});
$('a.cancel-link').click(function(evt){
$('#id_file').uploadifyClearQueue();
return false;
});
});
})(jQuery.noConflict());
</script>
{% endblock %}
<!-- COLTYPE/BODYCLASS -->
{% block bodyclass %}change-form filebrowser{% if query.pop %} popup{% endif %}{% endblock %}
{% block content-class %}content-flexible{% endblock %}
<!-- BREADCRUMBS -->
{% block breadcrumbs %}{% include "filebrowser/include/breadcrumbs.html" %}{% endblock %}
<!-- CONTENT -->
{% block content %}
<div id="content-main">
<form>
<fieldset class="module aligned">
<div class="row">
<input type="File" id="id_file" />
</div>
</fieldset>
<fieldset class="module aligned collapse closed">
<h2>{% trans "Help" %}</h2>
<div class="row">
{% for extension in settings_var.EXTENSIONS.items %}
{% ifnotequal extension.0 'Folder' %}
<div class="column span-4"><label class="required">{% if forloop.first %}{% trans "Allowed" %}:{% else %} {% endif %}</label></div>
<div class="column span-12 last"><p>{{ extension.0|safe }} ({{ extension.1|join:", "|safe }})</p></div><br clear="all" />
{% endifnotequal %}
{% endfor %}
</div>
<div class="row">
<div class="column span-4"><label class="required">{% trans "Max. Filesize" %}:</label></div>
<div class="column span-12 last"><p>{{ settings_var.MAX_UPLOAD_SIZE|filesizeformat }}</p></div><br clear="all" />
</div>
{% if settings_var.CONVERT_FILENAME %}
<div class="row">
<div class="column span-16 last"><p>
{% trans "The Name will be converted to lowercase. Spaces will be replaced with underscores." %}
</p></div><br clear="all" />
</div>
{% endif %}
</fieldset>
<div class="module footer">
<ul class="submit-row">
<li class="left cancel-link-container"><a class="cancel-link" href="javascript://">{% trans "Clear Queue" %}</a></li>
<li class="submit-button-container"><input class="default" type="submit" name="_save" value='{% trans "Upload" %}' /></li>
</ul>
</div>
</form>
</div>
{% endblock %}
|