-
Notifications
You must be signed in to change notification settings - Fork 406
/
filelisting.html
132 lines (118 loc) · 6.87 KB
/
filelisting.html
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{% load i18n fb_tags fb_versions %}
{% for fileobject in page.object_list %}
<!-- THUMBNAIL-VERSION FOR IMAGE-OBJECT -->
{% if fileobject.filetype == "Image" %}
{% version fileobject settings_var.ADMIN_THUMBNAIL as thumbnail_version %}
{% endif %}
<tr class="grp-row grp-row-even{% if fileobject.is_folder %} fb_folder{% endif %}">
<!-- FILESELECT FOR FILEBROWSEFIELD -->
{% if query.pop == "1" %}
<td class="fb_icon">
{% if not query.type or query.type in fileobject.format %}
<!-- select original -->
<button class="grp-button fb_selectlink" onclick="FileSubmit('{{ fileobject.path }}', '{{ fileobject.url }}', '{{ thumbnail_version.url }}', '{{ fileobject.filetype }}');">{% trans "Select" %}</button>
<!-- select versions -->
{% if fileobject.filetype == "Image" and settings_var.ADMIN_VERSIONS %}
<div class="grp-pulldown-versions-container">
<a href="javascript://" class="grp-pulldown-versions-handler" title="{% trans "Versions" %}"> </a>
<ul class="grp-pulldown-versions">
{% for version in settings_var.ADMIN_VERSIONS %}
{% version_setting version %}
<li><a href="{% url 'filebrowser:fb_version' %}{% query_string '' 'filename, dirname' %}&dir={{ fileobject.dirname|urlencode }}&filename={{ fileobject.filename|urlencode }}&version={{ version }}" title="">{{ version_setting.verbose_name }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% else %}
{% endif %}
</td>
{% endif %}
<!-- FILESELECT FOR RTE/TINYMCE -->
<!-- we need to use the absolute url here -->
{% if query.pop == "2" or query.pop == "4" or query.pop == "5" %}
<td class="fb_icon">
{% if not query.type or query.type in fileobject.format %}
<!-- select original -->
<button class="grp-button fb_selectlink" onclick="FileBrowserDialogue.fileSubmit('{{ fileobject.url|escapejs }}');">{% trans "Select" %}</button>
<!-- select versions -->
{% if fileobject.filetype == "Image" and settings_var.ADMIN_VERSIONS %}
<div class="grp-pulldown-versions-container">
<a href="javascript://" class="grp-pulldown-versions-handler" title="{% trans "Versions" %}"> </a>
<ul class="grp-pulldown-versions">
{% for version in settings_var.ADMIN_VERSIONS %}
{% version_setting version %}
<li><a href="{% url 'filebrowser:fb_version' %}{% query_string '' 'filename' %}&filename={{ fileobject.filename|urlencode }}&version={{ version }}" title="">{{ version_setting.verbose_name }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% else %}
{% endif %}
</td>
{% endif %}
<!-- FILESELECT FOR CKEDITOR -->
{% if query.pop == "3" %}
<td class="fb_icon">
{% if not query.type or query.type in fileobject.format %}
<!-- select original -->
<button class="grp-button fb_selectlink" onclick="OpenFile(ProtectPath('{{ fileobject.url|escapejs }}'));return false;">{% trans "Select" %}</button>
<!-- select versions -->
{% if fileobject.filetype == "Image" and settings_var.ADMIN_VERSIONS %}
<div class="grp-pulldown-versions-container">
<a href="javascript://" class="grp-pulldown-versions-handler" title="{% trans "Versions" %}"> </a>
<ul class="grp-pulldown-versions">
{% for version in settings_var.ADMIN_VERSIONS %}
{% version_setting version %}
<li><a href="" title="" onclick="OpenFile(ProtectPath('{% version fileobject version %}'));return false;">{{ version_setting.verbose_name }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% else %}
{% endif %}
</td>
{% endif %}
<!-- FILEICON -->
<td>
{% if fileobject.filetype %}
<span class="fb_type {{ fileobject.filetype|lower }}">{% trans fileobject.filetype %}</span>
{% else %}
<span class="fb_type none">—</span>
{% endif %}
</td>
<!-- THUMBNAIL -->
<td class="fb_thumbnail">
{% if fileobject.filetype == "Image" %}
<a href="{{ fileobject.url }}" class="fb_viewlink"><img src="{{ thumbnail_version.url }}" title="{% trans 'View Image' %}" /></a>
{% endif %}
</td>
<!-- FILENAME/DIMENSIONS -->
{% if fileobject.is_folder %}
<td><a href="{% url 'filebrowser:fb_browse' %}{% query_string "" "q,dir,p" %}&dir={{ fileobject.path_relative_directory|urlencode }}"><strong>{{ fileobject.filename }}</strong></a></td>
{% else %}
<td>
<strong>{{ fileobject.filename }}</strong>
{% if fileobject.dimensions %}
<br /><span class="small">{{ fileobject.dimensions.0 }} x {{ fileobject.dimensions.1 }} px</span><br clear="all" />
{% endif %}
</td>
{% endif %}
<!-- FOLDER -->
{% if query.q and settings_var.SEARCH_TRAVERSE %}
<td><a href="{% url 'filebrowser:fb_browse' %}{% query_string "" "dir,p" %}&dir={{ fileobject.dirname|urlencode }}"><strong>{{ fileobject.dirname }}</strong></a></td>
{% endif %}
<!-- SIZE -->
<td><span class="small">{% if fileobject.filesize %}{{ fileobject.filesize|filesizeformat }}{% else %}—{% endif %}</span></td>
<!-- DATE -->
<td><span class="small">{{ fileobject.datetime|date:"N j, Y" }}</span></td>
<!-- EDIT -->
<td>
<ul class="grp-actions">
<li class="grp-change-link"><a href="{% url 'filebrowser:fb_detail' %}{% query_string "" "p,dir" %}&dir={{ fileobject.dirname|urlencode }}&filename={{ fileobject.filename|urlencode }}"><strong>{% trans "Change" %}</strong></a></li>
</ul>
</td>
</tr>
{% endfor %}