file_detail.jinja 1.46 KB
Newer Older
Skia's avatar
Skia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% extends "core/file.jinja" %}


{% block file %}
<h3>
{% if file.is_folder %}
&#x1f4c1;
{% else %}
&#128462;
{% endif %}
{{ file.get_display_name() }}
</h3>
<p>{% trans %}Owner: {% endtrans %}{{ file.owner.get_display_name() }}</p>
{% if file.is_folder %}
Skia's avatar
Skia committed
15
{% if user.can_edit(file) %}
Skia's avatar
Skia committed
16
17
18
19
20
<form action="" method="post" enctype="multipart/form-data">
    {% csrf_token %}
    {{ form.as_p() }}
    <p><input type="submit" value="{% trans %}Add{% endtrans %}"></p>
</form>
Skia's avatar
Skia committed
21
{% endif %}
Skia's avatar
Skia committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<ul>
    {% for f in file.children.order_by('-is_folder', 'name').all() %}
    <li>
        {% if f.is_folder %}
        &#x1f4c1;
        {% else %}
        &#128462;
        {% endif %}
        <a href="{{ url('core:file_detail', file_id=f.id, popup=popup) }}">{{ f.get_display_name() }}</a></li>
    {% endfor %}
</ul>
{% else %}
<p>{% trans %}Real name: {% endtrans %}{{ file.file.name.split('/')[-1] }}</p>
<p>{% trans %}Date: {% endtrans %}{{ file.date|localtime|date(DATETIME_FORMAT) }} -
{{ file.date|localtime|time(DATETIME_FORMAT) }}</p>
<p>{% trans %}Type: {% endtrans %}{{ file.mime_type }}</p>
<p>{% trans %}Size: {% endtrans %}{{ file.size }} {% trans %}bytes{% endtrans %}</p>

<p><a href="{{ url('core:download', file_id=file.id) }}">{% trans %}Download{% endtrans %}</a></p>
{% endif %}
Skia's avatar
Skia committed
42
{% if not file.home_of and not file.home_of_club and file.parent %}
Skia's avatar
Skia committed
43
<p><a href="{{ url('core:file_delete', file_id=file.id, popup=popup) }}">{% trans %}Delete{% endtrans %}</a></p>
Skia's avatar
Skia committed
44
{% endif %}
Skia's avatar
Skia committed
45
46
47
48
49
{% endblock %}