mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-18 04:03:22 +00:00
61 lines
1.8 KiB
Django/Jinja
61 lines
1.8 KiB
Django/Jinja
{% extends "core/file.jinja" %}
|
|
|
|
|
|
{% block file %}
|
|
<h3>
|
|
{% if file.is_folder %}
|
|
📁
|
|
{% else %}
|
|
🗎
|
|
{% endif %}
|
|
{{ file.get_display_name() }}
|
|
</h3>
|
|
<p>{% trans %}Owner: {% endtrans %}{{ file.owner.get_display_name() }}</p>
|
|
{% if file.is_folder %}
|
|
{% if user.can_edit(file) %}
|
|
<form action="" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ form.as_p() }}
|
|
<p><input type="submit" value="{% trans %}Add{% endtrans %}"></p>
|
|
</form>
|
|
{% endif %}
|
|
<ul>
|
|
{% for f in file.children.order_by('-is_folder', 'name').all() %}
|
|
<li>
|
|
{% if f.is_folder %}
|
|
📁
|
|
{% else %}
|
|
🗎
|
|
{% 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 %}
|
|
{% if not file.home_of and not file.home_of_club and file.parent %}
|
|
<p><a href="{{ url('core:file_delete', file_id=file.id, popup=popup) }}">{% trans %}Delete{% endtrans %}</a></p>
|
|
{% endif %}
|
|
{% if popup %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
{{ super() }}
|
|
<script>
|
|
{% if popup and file.is_file %}
|
|
parent.$("#file_id").replaceWith('<div id="file_id" value="{{ file.id }}">{{ file.name }}</div>');
|
|
parent.$(".ui-dialog-buttonpane button").button("option", "disabled", false);
|
|
{% endif %}
|
|
</script>
|
|
{% endblock %}
|
|
|
|
|
|
|