mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-23 00:01:16 +00:00
Sli
3af5d96bf5
* Convert FileModerationView into ListView and add pagination with htmx * Don't allow sas moderation in file moderation view * Split up base.jinja and introduce base_fragment.jinja * Improve FileModerationView performances and make it root only * Add permissions tests for file modération
70 lines
1.8 KiB
Django/Jinja
70 lines
1.8 KiB
Django/Jinja
{% if is_fragment %}
|
|
{% extends "core/base_fragment.jinja" %}
|
|
{% else %}
|
|
{% extends "core/base.jinja" %}
|
|
{% endif %}
|
|
|
|
{% 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 tabs %}
|
|
{{ print_file_name(file) }}
|
|
|
|
<div class="tool_bar">
|
|
<div class="tools">
|
|
<div>
|
|
{% set home = user.home %}
|
|
{% if home %}
|
|
<a href="{{ url('core:file_detail', home.id, popup) }}">{% trans %}My files{% endtrans %}</a>
|
|
{% endif %}
|
|
</div>
|
|
{% 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>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{% if file %}
|
|
{% block file %}
|
|
{% endblock %}
|
|
{% endif %}
|
|
|
|
{% block script %}
|
|
{{ super() }}
|
|
{% if popup %}
|
|
<script>
|
|
parent.$(".choose_file_widget").css("height", "75%");
|
|
</script>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% endblock %}
|