templates/admin/index/progress_report_index_alt.html.twig line 1

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var entities \EasyCorp\Bundle\EasyAdminBundle\Collection\EntityDtoCollection #}
  3. {# @var paginator \EasyCorp\Bundle\EasyAdminBundle\Orm\EntityPaginator #}
  4. {% extends ea.templatePath('layout') %}
  5. {% trans_default_domain ea.i18n.translationDomain %}
  6. {% block body_id entities|length > 0 ? 'ea-index-' ~ entities|first.name : '' %}
  7. {% block body_class 'ea-index' ~ (entities|length > 0 ? ' ea-index-' ~ entities|first.name : '') %}
  8. {% set ea_field_assets = ea.crud.fieldAssets(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Crud::PAGE_INDEX')) %}
  9. {% block configured_head_contents %}
  10.     {{ parent() }}
  11.     {% for htmlContent in ea_field_assets.headContents %}
  12.         {{ htmlContent|raw }}
  13.     {% endfor %}
  14. {% endblock %}
  15. {% block configured_body_contents %}
  16.     {{ parent() }}
  17.     {% for htmlContent in ea_field_assets.bodyContents %}
  18.         {{ htmlContent|raw }}
  19.     {% endfor %}
  20. {% endblock %}
  21. {% block configured_stylesheets %}
  22.     {{ parent() }}
  23.     {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea_field_assets.cssAssets }, with_context = false) }}
  24.     {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }}
  25. {% endblock %}
  26. {% block configured_javascripts %}
  27.     {{ parent() }}
  28.     {{ include('@EasyAdmin/includes/_js_assets.html.twig', { assets: ea_field_assets.jsAssets }, with_context = false) }}
  29.     {{ include('@EasyAdmin/includes/_encore_script_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }}
  30. {% endblock %}
  31. {% block content_title %}
  32.     {%- apply spaceless -%}
  33.         {% set custom_page_title = ea.crud.customPageTitle('index', null, ea.i18n.translationParameters) %}
  34.         {{ custom_page_title is null
  35.             ? ea.crud.defaultPageTitle('index', null, ea.i18n.translationParameters)|trans|raw
  36.             : custom_page_title|trans|raw }}
  37.     {%- endapply -%}
  38. {% endblock %}
  39. {% set has_batch_actions = batch_actions|length > 0 %}
  40. {% block page_actions %}
  41.     {% if filters|length > 0 %}
  42.         <div class="datagrid-filters">
  43.             {% block filters %}
  44.                 {% set applied_filters = ea.request.query.all['filters']|default([])|keys %}
  45.                 <div class="btn-group action-filters">
  46.                     <a href="#" data-href="{{ ea_url().setAction('renderFilters').includeReferrer() }}" class="btn btn-secondary btn-labeled btn-labeled-right action-filters-button disabled {{ applied_filters ? 'action-filters-applied' }}" data-bs-toggle="modal" data-bs-target="#modal-filters">
  47.                         <i class="fa fa-filter fa-fw"></i> {{ t('filter.title', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}{% if applied_filters %} <span class="action-filters-button-count">({{ applied_filters|length }})</span>{% endif %}
  48.                     </a>
  49.                     {% if applied_filters %}
  50.                         <a href="{{ ea_url().unset('filters') }}" class="btn btn-secondary action-filters-reset">
  51.                             <i class="fa fa-close"></i>
  52.                         </a>
  53.                     {% endif %}
  54.                 </div>
  55.             {% endblock filters %}
  56.         </div>
  57.     {% endif %}
  58.     {% block global_actions %}
  59.         <div class="global-actions">
  60.             {% for action in global_actions %}
  61.                 {{ include(action.templatePath, { action: action }, with_context = false) }}
  62.             {% endfor %}
  63.         </div>
  64.     {% endblock global_actions %}
  65.     {% block batch_actions %}
  66.         {% if has_batch_actions %}
  67.             <div class="batch-actions" style="display: none">
  68.                 {% for action in batch_actions %}
  69.                     {{ include(action.templatePath, { action: action }, with_context = false) }}
  70.                 {% endfor %}
  71.             </div>
  72.         {% endif %}
  73.     {% endblock %}
  74. {% endblock page_actions %}
  75. {% block main %}
  76.     {# sort can be multiple; let's consider the sorting field the first one #}
  77.     {% set sort_field_name = app.request.get('sort')|keys|first %}
  78.     {% set sort_order = app.request.get('sort')|first %}
  79.     {% set some_results_are_hidden = entities|reduce((some_results_are_hidden, entity) => some_results_are_hidden or not entity.isAccessible, false) %}
  80.     {% set has_footer = entities|length != 0 %}
  81.     {% set has_search = ea.crud.isSearchEnabled %}
  82.     {% set has_filters = filters|length > 0 %}
  83.     {% set num_results = entities|length %}
  84.     <table class="table datagrid {{ entities is empty ? 'datagrid-empty' }}">
  85.         {% if num_results > 0 %}
  86.             <thead>
  87.             {% block table_head %}
  88.                 <tr>
  89.                     {% if has_batch_actions %}
  90.                         <th>
  91.                             <div class="form-check">
  92.                                 <span><input type="checkbox" class="form-check-input form-batch-checkbox-all"></span>
  93.                             </div>
  94.                         </th>
  95.                     {% endif %}
  96.                     {% set ea_sort_asc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::ASC') %}
  97.                     {% set ea_sort_desc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::DESC') %}
  98.                     {% for field in entities|first.fields ?? [] %}
  99.                         {% set is_sorting_field = ea.search.isSortingField(field.property) %}
  100.                         {% set next_sort_direction = is_sorting_field ? (ea.search.sortDirection(field.property) == ea_sort_desc ? ea_sort_asc : ea_sort_desc) : ea_sort_desc %}
  101.                         {% set column_icon = is_sorting_field ? (next_sort_direction == ea_sort_desc ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %}
  102.                         <th class="{{ is_sorting_field ? 'sorted' }} {{ field.isVirtual ? 'field-virtual' }} header-for-{{ field.cssClass|split(' ')|filter(class => class starts with 'field-')|join('') }} text-{{ field.textAlign }}" dir="{{ ea.i18n.textDirection }}">
  103.                             {% if field.isSortable %}
  104.                                 <a href="{{ ea_url({ page: 1, sort: { (field.property): next_sort_direction } }).includeReferrer() }}">
  105.                                     {{ field.label|trans|raw }} <i class="fa fa-fw {{ column_icon }}"></i>
  106.                                 </a>
  107.                             {% else %}
  108.                                 <span>{{ field.label|trans|raw }}</span>
  109.                             {% endif %}
  110.                         </th>
  111.                     {% endfor %}
  112.                     <th {% if ea.crud.showEntityActionsAsDropdown %}style="width: 10px"{% endif %} dir="{{ ea.i18n.textDirection }}">
  113.                         <span class="sr-only">{{ t('action.entity_actions', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}</span>
  114.                     </th>
  115.                 </tr>
  116.             {% endblock table_head %}
  117.             </thead>
  118.         {% endif %}
  119.         <tbody>
  120.         {% block table_body %}
  121.             {% for entity in entities %}
  122.                 {% if entity.isAccessible %}
  123.                     <tr data-id="{{ entity.primaryKeyValueAsString }}">
  124.                         {% if has_batch_actions %}
  125.                             <td class="batch-actions-selector">
  126.                                 <div class="form-check">
  127.                                     <input type="checkbox" class="form-check-input form-batch-checkbox" value="{{ entity.primaryKeyValue }}">
  128.                                 </div>
  129.                             </td>
  130.                         {% endif %}
  131.                         {% for field in entity.fields %}
  132.                             <td data-label="{{ field.label|trans|e('html_attr') }}" class="{{ field.property == sort_field_name ? 'sorted' }} text-{{ field.textAlign }} {{ field.cssClass }}" dir="{{ ea.i18n.textDirection }}">
  133.                                 {{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
  134.                             </td>
  135.                         {% endfor %}
  136.                         {% block entity_actions %}
  137.                             <td class="actions {{ ea.crud.showEntityActionsAsDropdown ? 'actions-as-dropdown' }}">
  138.                                 {% if entity.actions.count > 0 %}
  139.                                     {% if ea.crud.showEntityActionsAsDropdown %}
  140.                                         <div class="dropdown dropdown-actions">
  141.                                             <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  142.                                                 {# don't use FontAwesome 'fa-ellipsis-h' icon here because it doesn't look good #}
  143.                                                 {# this icon is 'dots-horizontal' icon from https://heroicons.com/ #}
  144.                                                 <svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  145.                                                     <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" />
  146.                                                 </svg>
  147.                                             </a>
  148.                                             <div class="dropdown-menu dropdown-menu-right">
  149.                                                 {% for action in entity.actions %}
  150.                                                     {{ include(action.templatePath, { action: action, entity: entity, isIncludedInDropdown: ea.crud.showEntityActionsAsDropdown }, with_context = false) }}
  151.                                                 {% endfor %}
  152.                                             </div>
  153.                                         </div>
  154.                                     {% else %}
  155.                                         {% for action in entity.actions %}
  156.                                             {{ include(action.templatePath, { action: action, entity: entity, isIncludedInDropdown: ea.crud.showEntityActionsAsDropdown }, with_context = false) }}
  157.                                         {% endfor %}
  158.                                     {% endif %}
  159.                                 {% endif %}
  160.                             </td>
  161.                         {% endblock entity_actions %}
  162.                     </tr>
  163.                 {% endif %}
  164.             {% else %}
  165.                 {% block table_body_empty %}
  166.                     {% for i in 1..14 %}
  167.                         <tr class="empty-row">
  168.                             <td><span></span></td>
  169.                             <td><span></span></td>
  170.                             <td><span></span></td>
  171.                             <td><span></span></td>
  172.                             <td><span></span></td>
  173.                             <td><span></span></td>
  174.                         </tr>
  175.                         {% if 3 == loop.index %}
  176.                             <tr class="no-results">
  177.                                 <td colspan="100">
  178.                                     {{ t('datagrid.no_results', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}
  179.                                 </td>
  180.                             </tr>
  181.                         {% endif %}
  182.                     {% endfor %}
  183.                 {% endblock table_body_empty %}
  184.             {% endfor %}
  185.             {% if some_results_are_hidden %}
  186.                 <tr class="datagrid-row-empty">
  187.                     <td class="text-center" colspan="100">
  188.                         <span class="datagrid-row-empty-message"><i class="fa fa-lock mr-1"></i> {{ 'datagrid.hidden_results'|trans({}, 'EasyAdminBundle') }}</span>
  189.                     </td>
  190.                 </tr>
  191.             {% endif %}
  192.         {% endblock table_body %}
  193.         </tbody>
  194.         <tfoot>
  195.         {% block table_footer %}
  196.         {% endblock table_footer %}
  197.         </tfoot>
  198.     </table>
  199.     {% if entities|length > 0 %}
  200.         <div class="content-panel-footer without-padding without-border">
  201.             {% macro render_hidden_inputs(name, value) %}
  202.                 {% if value is iterable %}
  203.                     {% for k, v in value %}
  204.                         {{ _self.render_hidden_inputs(name ~ '[' ~ k ~ ']', v) }}
  205.                     {% endfor %}
  206.                 {% else %}
  207.                     <input type="hidden" name="{{ name }}" value="{{ value }}">
  208.                 {% endif %}
  209.             {% endmacro %}
  210.             <form method="get"
  211.                 action="{{ ea_url().setController(ea.crud.controllerFqcn).setAction('index') }}"
  212.                 id="perPageForm"
  213.                 style="margin-top: 14px;">
  214.                 {% import _self as macros %}
  215.                 {% for key, value in app.request.query.all %}
  216.                     {% if key != 'perPage' %}
  217.                         {{ macros.render_hidden_inputs(key, value) }}
  218.                     {% endif %}
  219.                 {% endfor %}
  220.                 <label for="perPage">Show:</label>
  221.                 <select name="perPage" id="perPage" onchange="this.form.submit()">
  222.                     <option value="10" {{ app.request.get('perPage') == 10 ? 'selected' }}>10</option>
  223.                     <option value="20" {{ app.request.get('perPage') == 20 ? 'selected' }}>20</option>
  224.                     <option value="50" {{ app.request.get('perPage') == 50 ? 'selected' }}>50</option>
  225.                     <option value="100" {{ app.request.get('perPage') == 100 ? 'selected' }}>100</option>
  226.                 </select>
  227.             </form>
  228.             {% block paginator %}
  229.                 {{ include(ea.templatePath('crud/paginator'), { render_detailed_pagination: not some_results_are_hidden }) }}
  230.             {% endblock paginator %}
  231.         </div>
  232.     {% endif %}
  233.     {% block delete_form %}
  234.         {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', with_context = false) }}
  235.     {% endblock delete_form %}
  236.     {% if has_filters %}
  237.         {{ include('@EasyAdmin/crud/includes/_filters_modal.html.twig') }}
  238.     {% endif %}
  239.     {% if has_batch_actions %}
  240.         {{ include('@EasyAdmin/crud/includes/_batch_action_modal.html.twig', {}, with_context = false) }}
  241.     {% endif %}
  242.     <div id="custom-batch-actions" class="custom-modal fade" tabindex="-1">
  243.         <div class="modal-dialog">
  244.             <div class="modal-content">
  245.                 <div class="modal-body">
  246.                     <div class="row ">
  247.                         <div class="col-12 d-flex align-items-center flex-wrap batch-actions">
  248.                             <p class="number-selected"><span class="numberOfSelected"></span> Item(s)</p>
  249.                             {% if has_batch_actions %}
  250.                                 {% for action in batch_actions %}
  251.                                     <a href="{{ action.linkUrl }}" class="btn btn-primary custom-batch-btn {{action.cssClass}}"  
  252.                                     {% for name, value in action.htmlAttributes %}{{ name }}="{{ value|e('html_attr') }}" {% endfor %}>
  253.                                         <span class="btn-label">{{ action.label|trans|raw }}</span>
  254.                                     </a>
  255.                                 {% endfor %}
  256.                             {% endif %}
  257.                             <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"  data-bs-target="#modal-batch-action" ></button>
  258.                         </div>
  259.                     </div>
  260.                 </div>
  261.             </div>
  262.         </div>
  263.     </div>
  264.      <div id="progress-report-turn-on-modal" aria-hidden="true" class="modal micromodal-slide">
  265.         <input name="data-id" id="data-id" type="hidden" />
  266.         <div class="modal__overlay" tabindex="-1" data-micromodal-close>
  267.             <div class="modal__main_content">
  268.                 <div class="icon__overlay">
  269.                     <img src="/build/images/check.png" />
  270.                 </div>
  271.                 <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="modal-title" >
  272.                     
  273.                     <header class="modal_header">
  274.                         <h2 class="modal__title" id="modal-title">Progress Report</h2>
  275.                     </header>
  276.                     <main class="modal__content" id="modal-content">
  277.                         <div class="text-center">
  278.                             Choose the progress report year and project timeline for which you want to enable the progress report.<br/>
  279.                             NOTE: Progress report mode will only apply to projects that are approved and not archived on Wordpress.<br/><br/>
  280.                         </div>
  281.                         <div class="text-start">
  282.                             <label class="pb-2">Progress Report Year:</label>
  283.                             <select name="year" class="form-control">
  284.                                 {% set current_year = "now"|date("Y") %}
  285.                                 {% for y in range(current_year + 2, current_year - 10, -1) %}
  286.                                     <option value="{{ y }}" {% if y == current_year %}selected{% endif %}>{{ y }}</option>
  287.                                 {% endfor %}
  288.                             </select>
  289.                             <br/>
  290.                             <label class="pb-2">Active Projects From:</label>
  291.                             <input name="from-date" type="date" class="form-control field-datetime" />
  292.                             <br/>
  293.                             <label class="pb-2">Active Projects To:</label>
  294.                             <input name="to-date" type="date" class="form-control field-datetime" />
  295.                         </div>
  296.                         <p class="d-flex justify-content-center">
  297.                             <a class="btn btn-primary mt-4 mx-2 w-40 cursor-pointer activate-progress-report-btn" href="javascript:void(0);">Activate Progress Report</a>
  298.                         </p>
  299.                     </main>
  300.                 </div>
  301.             </div>
  302.         </div>
  303.     </div>
  304. {% endblock main %}