src/Cms/FileBundle/Resources/views/Modal/folder.html.twig line 1

Open in your IDE?
  1. {% extends '@CmsFile/Modal/includes/modal.html.twig' %}
  2. {% block header_right %}
  3.     {% if is_granted('campussuite.cms.file.manage', container) %}
  4.         {% include '@ui/common/buttons/default.html.twig' with {
  5.             text: 'Add File',
  6.             icon: 'plus',
  7.             helper: 'primary',
  8.             block: true,
  9.             link: curpath(routes.upload)
  10.         } %}
  11.     {% endif %}
  12. {% endblock %}
  13. {% block crumbs %}
  14.     <nav aria-label="breadcrumbs">
  15.         <ol class="breadcrumb">
  16.             <li>
  17.                 <a href="{{- curpath(routes.container, {
  18.                     folderId: null
  19.                 }) -}}">{{ container.name }}</a>
  20.             </li>
  21.             {% for ancestor in ancestors %}
  22.                 <li aria-current="folder">
  23.                     <a href="{{- curpath(routes.folder, {
  24.                         folderId: ancestor.id
  25.                     }) -}}">{{ ancestor.name }}</a>
  26.                 </li>
  27.             {% endfor %}
  28.             <li class="active" aria-current="folder">{{ folder.name }}</li>
  29.         </ol>
  30.     </nav>
  31. {% endblock %}
  32. {% block actions %}
  33.     {% 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') %}
  34.         <a href="{{ curpath(routes.url) }}">+ Add custom URL</a>
  35.     {% endif %}
  36.     {% if is_granted('campussuite.cms.file.manage', container) %}
  37.         <a href="{{ curpath(routes.folder_child_create) }}">+ Add folder</a>
  38.     {% endif %}
  39. {% endblock %}
  40. {% block body %}
  41.     <div class="table-responsive">
  42.         <table class="media">
  43.             <thead class="media__thead">
  44.             <tr class="media__row">
  45.                 <th
  46.                     class="media__details"
  47.                     data-campussuite-modals-action-navigate="{{- curpath(routes.folder_sort, {
  48.                         sort: 'name',
  49.                         direction: (direction == 'asc') ? 'desc' : 'asc'
  50.                     }) -}}"
  51.                 >
  52.                     <div class="sort {{ direction }}{% if sort is same as('name') %} active{% endif %}">Filename</div>
  53.                 </th>
  54.                 <th
  55.                     class="media__datetime"
  56.                     data-campussuite-modals-action-navigate="{{- curpath(routes.folder_sort, {
  57.                         sort: 'timestamp',
  58.                         direction: (direction == 'asc') ? 'desc' : 'asc'
  59.                     }) -}}"
  60.                 >
  61.                     <div class="sort {{ direction }}{% if sort is same as('timestamp') %} active{% endif %}">Date</div>
  62.                 </th>
  63.                 <th class="media__actions"></th>
  64.             </tr>
  65.             </thead>
  66.             <tbody class="media__tbody">
  67.                 {% if modal.mode is same as('folder') %}
  68.                     <tr class="media__row media__row--other">
  69.                         <td class="media__details">
  70.                             <div class="media__details-inner">
  71.                                 <div class="media__preview">
  72.                                     <a href="#" data-campussuite-modals-action-save="{{- folder.id|json_encode|escape('html_attr') -}}">
  73.                                         <em class="fa fa-upload"></em>
  74.                                     </a>
  75.                                 </div>
  76.                                 <div class="media__details-body">
  77.                                     <p class="media__title">Select All</p>
  78.                                 </div>
  79.                             </div>
  80.                         </td>
  81.                         <td class="media__datetime">
  82.                             <span class="date"></span>
  83.                             <span class="time"></span>
  84.                         </td>
  85.                         <td class="media__actions"></td>
  86.                     </tr>
  87.                 {% endif %}
  88.                 {% for current in folders %}
  89.                     {% include '@CmsFile/Modal/includes/items/Folder.html.twig' with {
  90.                         folder: current
  91.                     } %}
  92.                 {% endfor %}
  93.                 {% for current in files %}
  94.                     {% if instanceof(current, 'Cms\\FileBundle\\Entity\\Nodes\\Files\\ImageFile') %}
  95.                         {% include '@CmsFile/Modal/includes/items/ImageFile.html.twig' with {
  96.                             file: current
  97.                         } %}
  98.                     {% elseif instanceof(current, 'Cms\\FileBundle\\Entity\\Nodes\\Files\\DocumentFile') %}
  99.                         {% include '@CmsFile/Modal/includes/items/GenericFile.html.twig' with {
  100.                             file: current
  101.                         } %}
  102.                     {% else %}
  103.                         {% include '@CmsFile/Modal/includes/items/GenericFile.html.twig' with {
  104.                             file: current
  105.                         } %}
  106.                     {% endif %}
  107.                 {% endfor %}
  108.             </tbody>
  109.         </table>
  110.     </div>
  111. {% endblock %}