file.jinja 1.45 KB
Newer Older
Skia's avatar
Skia committed
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
{% extends "core/base.jinja" %}

{% block title %}
{% if file %}
{{ file.get_display_name() }}
{% elif file_list %}
{% trans %}File list{% endtrans %}
{% elif new_file %}
{% trans %}New file{% endtrans %}
{% else %}
{% trans %}Not found{% endtrans %}
{% endif %}
{% endblock %}

{% macro print_file_name(file) %}
{% if file %}
{{ print_file_name(file.parent) }} >
<a href="{{ url('core:file_detail', file_id=file.id, popup=popup) }}">{{ file.get_display_name() }}</a>
{% else %}
<a href="{{ url('core:file_list', popup) }}">{% trans %}Files{% endtrans %}</a>
{% endif %}
{% endmacro %}

{% block content %}
{{ print_file_name(file) }}

<div class="tool-bar">
    <div class="tools">
Skia's avatar
Skia committed
29
30
31
32
33
34
        <div>
            {% set home = user.home %}
            {% if home %}
            <a href="{{ url('core:file_detail', home.id, popup) }}">{% trans %}My files{% endtrans %}</a>
            {% endif %}
        </div>
Skia's avatar
Skia committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
        {% if file %}
        <a href="{{ url('core:file_detail', file.id, popup) }}">{% trans %}View{% endtrans %}</a>
        {% if can_edit(file, user) %}
        <a href="{{ url('core:file_edit', file_id=file.id, popup=popup) }}">{% trans %}Edit{% endtrans %}</a>
        {% endif %}
        {% if can_edit_prop(file, user) %}
        <a href="{{ url('core:file_prop', file_id=file.id, popup=popup) }}">{% trans %}Prop{% endtrans %}</a>
        {% endif %}
        {% endif %}
    </div>
</div>
<hr>

{% if file %}
{% block file %}
{% endblock %}
{% endif %}

{% endblock %}