summaryrefslogtreecommitdiff
path: root/app/lib/filebrowser/templates/filebrowser/include/filelisting.html
blob: f3ec09dc18e5a0cb3b7d18da5996f77be211e26b (plain)
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
133
134
135
136
{% load i18n adminmedia fb_tags fb_versions %}

{% for file in page.object_list %}
    <tr class="{% cycle 'row1' 'row2' %}{% if file.filetype == "Folder" %} fb_folder{% endif %}">
        
        <!-- FILESELECT FOR FILEBROWSEFIELD -->
        {% if query.pop == "1" and results_var.select_total %}
            <td class="fb_icon">
                {% selectable file.filetype query.type %}
                {% if selectable %}
                    <button class="button fb_selectlink" onclick="FileSubmit('{{ file.url_save }}', '{{ file.url_thumbnail }}', '{{ file.filetype }}');">{% trans "Select" %}</button>
                {% else %}
                    &nbsp;
                {% endif %}
            </td>
        {% endif %}
        
        <!-- FILESELECT FOR RTE/TINYMCE -->
        {% if query.pop == "2" and results_var.select_total %}
            <td class="fb_icon">
                {% selectable file.filetype query.type %}
                {% if selectable %}
                    <button class="button fb_selectlink" onclick="FileBrowserDialogue.fileSubmit('{{ file.url_save|escapejs }}');">{% trans "Select" %}</button>
                {% else %}
                    &nbsp;
                {% endif %}
            </td>
        {% endif %}
        
        <!-- FILESELECT FOR CKEDITOR (FORMER "FCKEDITOR") -->
        {% if query.pop == "3" and results_var.select_total %}
            <td class="fb_icon">
                {% selectable file.filetype query.type %}
                {% if selectable %}
                    <button class="button fb_selectlink" onclick="OpenFile(ProtectPath('{{ file.url_save|escapejs }}'));return false;">{% trans "Select" %}</button>
                {% else %}
                    &nbsp;
                {% endif %}
            </td>
        {% endif %}
        
        <!-- FILEICON -->
        <td>
            {% comment %}<img src="{{ settings_var.URL_FILEBROWSER_MEDIA }}img/filebrowser_type_{{ file.filetype|lower }}.gif" />{% endcomment %}
            <span class="fb_type {{ file.filetype|lower }}">{{ file.filetype }}</span>
        </td>
        
        <!-- THUMBNAIL -->
        <td class="fb_thumbnail">
            {% if file.filetype == "Image" %}
                <a href="{{ file.url_full }}" class="fb_viewlink"><img src="{% version file.path settings_var.ADMIN_THUMBNAIL %}" title="{% trans 'View Image' %}" /></a>
            {% endif %}
        </td>
        
        <!-- FILENAME/DIMENSIONS -->
        {% if file.filetype == "Folder" %}
            <td><a href="{% url fb_browse %}{% query_string "" "q,dir,p" %}&amp;dir={{ file.path_relative_directory|urlencode }}"><strong>{{ file.filename }}</strong></a></td>
        {% else %}
            <td>
                <b><a href="{{ file.url_full }}">{{ file.filename }}</a></b>
                {% if file.dimensions %}
                    <br /><span class="tiny">{{ file.dimensions.0 }} x {{ file.dimensions.1 }} px</span><br clear="all" />
                {% endif %}
                {% comment %}
                {% if file.filetype == "Image" %}
                    <a class="preview fb_showpreview" href="javascript://" title="{% trans 'Preview' %}">{% trans 'Preview' %}</a>
                    <div class="fb_preview_container">
                        <a href="{{ file.url_full }}" class="fb_view_image external" target="_blank"><span>{% trans 'View Image' %}</span><img src="{% version file.path settings_var.PREVIEW_VERSION %}" title="{% trans 'View Image' %}" class="fb_preview" /></a>
                    </div>
                {% endif %}
                {% endcomment %}
                {% if results_var.images_total and settings_var.ADMIN_VERSIONS and file.filetype == "Image" %}
                    <a class="internal fb_showversions" href="{% url fb_versions %}{% query_string "" "p" %}&amp;filename={{ file.filename }}" title="{% trans 'Versions' %}">{% trans 'Versions' %}</a>
                {% endif %}
            </td>
        {% endif %}
        
        <!-- FOLDER -->
        {% if q %}<td><a href="{% url fb_browse %}{% query_string "" "dir,p" %}&amp;dir={{ file.folder_for_link|urlencode }}"><strong>{{ file.folder }}</strong></a></td>{% endif %}
        
        <!-- SIZE -->
        <td>{{ file.filesize|filesizeformat }}</td>
        
        <!-- DATE -->
        <td>{{ file.datetime|date:"N j, Y" }}</td>
        
        <!-- ACTIONS -->
        <td>
            <div class="pulldown-actions-container">
                <a href="javascript://" class="pulldown-actions-handler">&nbsp;</a>
                <ul class="pulldown-actions">
                    <li><a href="{% url fb_rename %}{% query_string %}&amp;filename={{ file.filename }}" title="{% trans 'Rename' %}">{% trans 'Rename' %}</a></li>
                    {% ifnotequal file.filetype 'Folder' %}
                        <li><a href="{% url fb_delete %}{% query_string %}&amp;filename={{ file.filename }}&amp;filetype={{ file.filetype }}" onclick="return confirm('{% trans "Are you sure you want to delete this file?" %}');" title="{% trans 'Delete File' %}">{% trans 'Delete File' %}</a></li>
                    {% else %}
                        {% if file.is_empty %}
                            <li><a href="{% url fb_delete %}{% query_string %}&amp;filename={{ file.filename }}&amp;filetype={{ file.filetype }}" onclick="return confirm('{% trans "Are you sure you want to delete this Folder?" %}');" title="{% trans 'Delete Folder' %}">{% trans 'Delete Folder' %}</a></li>
                        {% endif %}
                    {% endifnotequal %}
                </ul>
            </div>
        </td>
        
        <!-- DEBUG -->
        {% if settings_var.DEBUG %}
        <td>
            <strong>Filename</strong> {{ file.filename }}<br />
            <strong>Filetype</strong> {{ file.filetype }}<br />
            <strong>Filesize</strong> {{ file.filesize }}<br />
            <strong>Extension</strong> {{ file.extension }}<br />
            <strong>Date</strong> {{ file.date }}<br />
            <strong>Datetime Object</strong> {{ file.datetime }}<br /><br />
            <strong>Relative Path</strong> {{ file.path_relative }}<br />
            <strong>Full Path</strong> {{ file.path_full }}<br />
            <strong>Relative URL</strong> {{ file.url_relative }}<br />
            <strong>Full URL</strong> {{ file.url_full }}<br /><br />
            <strong>URL for FileBrowseField</strong> {{ file.url_save }}<br />
            <strong>Thumbnail URL</strong> {{ file.url_thumbnail }}
            {% if file.filetype == "Image" %}
                <br /><br />
                <strong>Dimensions</strong> {{ file.dimensions }}<br />
                <strong>Width</strong> {{ file.width }}<br />
                <strong>Height</strong> {{ file.height }}<br />
                <strong>Orientation</strong> {{ file.orientation }}
            {% endif %}
            {% if file.filetype == "Folder" %}
                <br /><br />
                <strong>Is Empty</strong> {{ file.is_empty }}
            {% endif %}
        </td>
        {% endif %}
        
    </tr>
{% endfor %}