src/App/Resources/views/dashboard/websites/content/_list_legacy.html.twig line 1

Open in your IDE?
  1. {% extends '@App/dashboard/websites/base.html.twig' %}
  2. {% do dom_title_section('Dashboard') %}
  3. {% block content %}
  4.     <div class="row mb-4">
  5.         <div class="col text-right">
  6.             {% if sites|length %}
  7.                 {% include '@ui2022/button--a.html.twig' with {
  8.                     text: 'View Site',
  9.                     link: web_url_catchall(sites[0]).withQueryParameter('_mimic', app.user.uid),
  10.                     styles: 'gray',
  11.                     attr: {
  12.                         class: 'mr-3',
  13.                     },
  14.                 } %}
  15.             {% endif %}
  16.             {% include '@ui2022/button--a.html.twig' with {
  17.                 text: '+ Add',
  18.                 link: path('app.app.dashboard.websites.content.add'),
  19.                 styles: 'primary',
  20.                 modal: 'modal__add',
  21.             } %}
  22.         </div>
  23.     </div>
  24.     <div class="row">
  25.         <div class="col">
  26.             {% include '@ui2022/table-filter.html.twig' with {
  27.                 form: form,
  28.             } %}
  29.             <div id="{{ form.vars.id }}__results">
  30.                 {% set headers = [
  31.                     {
  32.                         title: 'Name',
  33.                         sort: 'name',
  34.                     },
  35.                     {
  36.                         title: 'Type',
  37.                         spacing: 15,
  38.                     },
  39.                     {
  40.                         title: 'Last Modified',
  41.                         spacing: 25,
  42.                         sort: 'timestamp',
  43.                     },
  44.                 ] %}
  45.                 {% embed '@ui2022/table--search.html.twig' with {
  46.                     form: form,
  47.                     headers: headers,
  48.                     items: items,
  49.                 } %}
  50.                     {% block items %}
  51.                         {% for item in items %}
  52.                             {% set school = item.container|schoolify %}
  53.                             {% set link = web_url_view(item) %}
  54.                             {% set isGranted = is_granted(
  55.                                 attributes_expression([
  56.                                     item.department ? 'campussuite.cms.container.%s.manage'|format(item.department.type) : null,
  57.                                     'campussuite.cms.module.manage',
  58.                                     'campussuite.cms.modules.page.manage',
  59.                                 ]),
  60.                                 [item, item.department],
  61.                             ) %}
  62.                             <tr>
  63.                                 {% include '@ui2022/table__item__cell--status.html.twig' with {
  64.                                     title: item.data.ui,
  65.                                     link: link ? link.withQueryParameter('_mimic', app.user.uid) : null,
  66.                                     actions: [],
  67.                                     status: (not item.placeholder) ? 'sent' : 'draft',
  68.                                     subtext: (not item.placeholder) ? 'Published' : 'Draft',
  69.                                     subicon: school ? 'icon-ui-board' : 'icon-folder',
  70.                                     subinfo: (not school) ? item.container.name : (
  71.                                         (school.department and school.department is same as (item.container))
  72.                                             ? school.name
  73.                                             : '%s > %s'|format(
  74.                                                 school.name,
  75.                                                 item.container.name
  76.                                             )
  77.                                     ),
  78.                                     actions: [
  79.                                         isGranted ? {
  80.                                             text: 'More',
  81.                                             dropdown: {
  82.                                                 items: [
  83.                                                     {
  84.                                                         text: 'Delete',
  85.                                                         link: path(paths.delete|format(item.discr), {
  86.                                                             object: item.id,
  87.                                                         }),
  88.                                                         modal: 'feed-entry-modal2',
  89.                                                     },
  90.                                                 ],
  91.                                             },
  92.                                         } : null,
  93.                                         isGranted ? {
  94.                                             text: 'Edit',
  95.                                             link: path(paths.update|format(item.discr), {
  96.                                                 object: item.id,
  97.                                             }),
  98.                                         } : null,
  99.                                     ]|filter((v) => v is not empty),
  100.                                 } %}
  101.                                 <td>
  102.                                     {{ 'app.content.types.%s'|format(item.discr)|trans }}
  103.                                 </td>
  104.                                 <td>
  105.                                     {{ item.timestampedAt|ui_relativeDate }}
  106.                                     {% if item.blamedBy %}
  107.                                         <div class="font-12">{{ item.blamedBy.displayName }}</div>
  108.                                     {% endif %}
  109.                                 </td>
  110.                             </tr>
  111.                         {% endfor %}
  112.                     {% endblock %}
  113.                 {% endembed %}
  114.                 {% if items is not empty and pagination is defined %}
  115.                     {% include '@ui2022/pagination.html.twig' with pagination %}
  116.                 {% endif %}
  117.             </div>
  118.         </div>
  119.     </div>
  120. {% endblock %}
  121. {% block modals %}
  122.     {{ parent() }}
  123.     {% include '@ui2022/modal.html.twig' with {
  124.         attr: {
  125.             id: 'feed-entry-modal2',
  126.         },
  127.     } %}
  128.     {% include '@ui2022/modal.html.twig' with {
  129.         dialog_styles: 'scrollable centered',
  130.         attr: {
  131.             id: 'modal__add',
  132.             class: 'modal-ajax',
  133.         },
  134.     } %}
  135. {% endblock %}