{% extends '@CmsFile/Modal/includes/modal.html.twig' %}
{% block header_right %}
{% if is_granted('campussuite.cms.file.manage', container) %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Add File',
icon: 'plus',
helper: 'primary',
block: true,
link: curpath(routes.upload)
} %}
{% endif %}
{% endblock %}
{% block crumbs %}
<nav aria-label="breadcrumbs">
<ol class="breadcrumb">
<li>
<a href="{{- curpath(routes.container, {
folderId: null
}) -}}">{{ container.name }}</a>
</li>
{% for ancestor in ancestors %}
<li aria-current="folder">
<a href="{{- curpath(routes.folder, {
folderId: ancestor.id
}) -}}">{{ ancestor.name }}</a>
</li>
{% endfor %}
<li class="active" aria-current="folder">{{ folder.name }}</li>
</ol>
</nav>
{% endblock %}
{% block actions %}
{% if modal.mode is defined and modal.mode is not same as('id') and modal.mode is not same as('folder') and modal.mode is not same as('smm') and modal.mode is not same as('attachments') %}
<a href="{{ curpath(routes.url) }}">+ Add custom URL</a>
{% endif %}
{% if is_granted('campussuite.cms.file.manage', container) %}
<a href="{{ curpath(routes.folder_child_create) }}">+ Add folder</a>
{% endif %}
{% endblock %}
{% block body %}
<div class="table-responsive">
<table class="media">
<thead class="media__thead">
<tr class="media__row">
<th
class="media__details"
data-campussuite-modals-action-navigate="{{- curpath(routes.folder_sort, {
sort: 'name',
direction: (direction == 'asc') ? 'desc' : 'asc'
}) -}}"
>
<div class="sort {{ direction }}{% if sort is same as('name') %} active{% endif %}">Filename</div>
</th>
<th
class="media__datetime"
data-campussuite-modals-action-navigate="{{- curpath(routes.folder_sort, {
sort: 'timestamp',
direction: (direction == 'asc') ? 'desc' : 'asc'
}) -}}"
>
<div class="sort {{ direction }}{% if sort is same as('timestamp') %} active{% endif %}">Date</div>
</th>
<th class="media__actions"></th>
</tr>
</thead>
<tbody class="media__tbody">
{% if modal.mode is same as('folder') %}
<tr class="media__row media__row--other">
<td class="media__details">
<div class="media__details-inner">
<div class="media__preview">
<a href="#" data-campussuite-modals-action-save="{{- folder.id|json_encode|escape('html_attr') -}}">
<em class="fa fa-upload"></em>
</a>
</div>
<div class="media__details-body">
<p class="media__title">Select All</p>
</div>
</div>
</td>
<td class="media__datetime">
<span class="date"></span>
<span class="time"></span>
</td>
<td class="media__actions"></td>
</tr>
{% endif %}
{% for current in folders %}
{% include '@CmsFile/Modal/includes/items/Folder.html.twig' with {
folder: current
} %}
{% endfor %}
{% for current in files %}
{% if instanceof(current, 'Cms\\FileBundle\\Entity\\Nodes\\Files\\ImageFile') %}
{% include '@CmsFile/Modal/includes/items/ImageFile.html.twig' with {
file: current
} %}
{% elseif instanceof(current, 'Cms\\FileBundle\\Entity\\Nodes\\Files\\DocumentFile') %}
{% include '@CmsFile/Modal/includes/items/GenericFile.html.twig' with {
file: current
} %}
{% else %}
{% include '@CmsFile/Modal/includes/items/GenericFile.html.twig' with {
file: current
} %}
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}