Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

93 lines
4.3KB

  1. {% extends '@EasyAdmin/default/list.html.twig' %}
  2. {% block content_title %}
  3. Édition des positions
  4. {% if entity is defined and entity is not null %}
  5. <strong>: {{ entity.title }}</strong>
  6. {% endif %}
  7. {% endblock %}
  8. {% block batch_actions %}{% endblock %}
  9. {% block global_actions %}{% endblock %}
  10. {% block main %}
  11. {% set _fields_visible_by_user = fields|filter((metadata, field) => easyadmin_is_granted(metadata.permission)) %}
  12. {% set _number_of_hidden_results = 0 %}
  13. {% set _list_item_actions = easyadmin_get_actions_for_list_item(_entity_config.name) %}
  14. {{ form_start(postion_form) }}
  15. <table class="table datagrid lc-sortable" data-parent-position="{{ entity is not null ? entity.position : ''}}">
  16. <thead>
  17. {% block table_head %}
  18. <tr>
  19. <th></th>
  20. {% for field, metadata in _fields_visible_by_user %}
  21. {% set isSortingField = (metadata.property == app.request.get('sortField')) or ('association' == metadata.type and app.request.get('sortField') starts with metadata.property ~ '.') %}
  22. {% set nextSortDirection = isSortingField ? (app.request.get('sortDirection') == 'DESC' ? 'ASC' : 'DESC') : 'DESC' %}
  23. {% set _column_label = metadata.label|trans(_trans_parameters) %}
  24. {% set _column_icon = isSortingField ? (nextSortDirection == 'DESC' ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %}
  25. <th class="{{ isSortingField ? 'sorted' }} {{ metadata.virtual ? 'virtual' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}>
  26. <span>{{ _column_label|raw }}</span>
  27. </th>
  28. {% endfor %}
  29. </tr>
  30. {% endblock table_head %}
  31. </thead>
  32. <tbody>
  33. {% block table_body %}
  34. {% for item in paginator.currentPageResults %}
  35. {% if not easyadmin_is_granted(_entity_config.list.item_permission, item) %}
  36. {% set _number_of_hidden_results = _number_of_hidden_results + 1 %}
  37. {% else %}
  38. {# the empty string concatenation is needed when the primary key is an object (e.g. an Uuid object) #}
  39. {% set _item_id = '' ~ attribute(item, _entity_config.primary_key_field_name) %}
  40. <tr class="lc-draggable" data-id="{{ _item_id }}">
  41. <td>
  42. <i class="fa fa-fw fa-sort"></i>
  43. </td>
  44. {% for field, metadata in _fields_visible_by_user %}
  45. {% set isSortingField = metadata.property == app.request.get('sortField') %}
  46. {% set _column_label = (metadata.label ?: field|humanize)|trans(_trans_parameters) %}
  47. <td class="{{ isSortingField ? 'sorted' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}>
  48. {{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
  49. </td>
  50. {% endfor %}
  51. </tr>
  52. {% endif %}
  53. {% else %}
  54. <tr>
  55. <td class="no-results" colspan="{{ _fields_visible_by_user|length + 1 }}">
  56. {{ 'search.no_results'|trans(_trans_parameters, 'EasyAdminBundle') }}
  57. </td>
  58. </tr>
  59. {% endfor %}
  60. {% if _number_of_hidden_results > 0 %}
  61. <tr class="datagrid-row-empty">
  62. <td class="text-center" colspan="{{ _fields_visible_by_user|length + 1 }}">
  63. <span class="datagrid-row-empty-message"><i
  64. class="fa fa-lock mr-1"></i> {{ 'security.list.hidden_results'|trans({}, 'EasyAdminBundle') }}</span>
  65. </td>
  66. </tr>
  67. {% endif %}
  68. {% endblock table_body %}
  69. </tbody>
  70. </table>
  71. <div style="display: none;">
  72. {{ form_row(postion_form.entities) }}
  73. {{ form_rest(postion_form) }}
  74. </div>
  75. <div class="form-actions">
  76. <button type="submit" class="btn btn-primary"> Sauvegarder</button>
  77. </div>
  78. {{ form_end(postion_form) }}
  79. {% endblock main %}