{% extends 'admin/master.html' %} {% from 'macro/icon.html' import render_icon %} {% import 'macro/actions.html' as actionslib with context %} {% block main %} {% block breadcrums %} {% endblock %} {% block file_list_table %}
{% block list_header scoped %} {% if actions %} {% endif %} {% for column in view.column_list %} {% endfor %} {% endblock %} {% for name, path, is_dir, size, date in items %} {% block list_row scoped %} {% if actions %} {% endif %} {% if is_dir %} {% else %} {% if view.is_column_visible('size') %} {% endif %} {% endif %} {% if view.is_column_visible('date') %} {% endif %} {% endblock %} {% endfor %}
  {% if view.is_column_sortable(column) %} {% if sort_column == column %} {{ view.column_label(column) }} {% if sort_desc %}↑{% else %}↓{% endif %} {% else %} {{ view.column_label(column) }} {% endif %} {% else %} {{ gettext(view.column_label(column)) }} {% endif %}
{% if not is_dir %} {% endif %} {% block list_row_actions scoped %} {% if view.can_rename and path and name != '..' %} {%- if view.rename_modal -%} {{ actionslib.add_modal_button(url=get_url('.rename', path=path, modal=True), title=gettext('Rename File'), content='' ) }} {% else %} {{ render_icon('pencil') }} {%- endif -%} {% endif %} {%- if view.can_delete and path -%} {% if is_dir %} {% if name != '..' and view.can_delete_dirs %}
{{ delete_form.path(value=path) }} {{ delete_form.csrf_token }}
{% endif %} {% else %}
{{ delete_form.path(value=path) }} {{ delete_form.csrf_token }}
{% endif %} {%- endif -%} {% endblock %}
{{ render_icon('folder') }} {{ name }} {% if view.can_download %} {%- if view.edit_modal and view.is_file_editable(path) -%} {{ actionslib.add_modal_button(url=get_file_url(path, modal=True)|safe, btn_class='', content=name) }} {% else %} {{ name }} {%- endif -%} {% else %} {{ name }} {% endif %} {{ size|filesizeformat }} {{ timestamp_format(date) }}
{% endblock %} {% block toolbar %}
{% if view.can_upload %}
{%- if view.upload_modal -%} {{ actionslib.add_modal_button(url=get_dir_url('.upload', path=dir_path, modal=True),btn_class="btn btn-secondary",content=gettext('Upload File')) }} {% else %} {{ gettext('Upload File') }} {%- endif -%}
{% endif %} {% if view.can_mkdir %}
{%- if view.mkdir_modal -%} {{ actionslib.add_modal_button(url=get_dir_url('.mkdir', path=dir_path, modal=True),btn_class="btn btn-secondary",content=gettext('Create Directory')) }} {% else %} {{ gettext('Create Directory') }} {%- endif -%}
{% endif %} {% if actions %}
{{ actionslib.dropdown(actions, 'dropdown-toggle btn btn-secondary') }}
{% endif %}
{% endblock %} {% block actions %} {% if actions %} {{ actionslib.form(get_url('.action_view')) }} {% endif %} {% endblock %} {%- if view.rename_modal or view.mkdir_modal or view.upload_modal or view.edit_modal -%} {{ actionslib.add_modal_window() }} {%- endif -%} {% endblock %} {% block tail %} {{ super() }} {%- if view.rename_modal or view.mkdir_modal or view.upload_modal or view.edit_modal -%} {{ actionslib.add_modal_js() }} {%- endif -%} {% if actions %} {{ actionslib.add_action_js(gettext('Please select at least one file.'), actions, actions_confirmation) }} {% endif %} {% endblock %}