You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.7KB

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {% use '@EasyAdmin/crud/form_theme.html.twig' %}
  3. {% block gallery_manager_row %}
  4. {{ block('collection_row') }}
  5. {% endblock gallery_manager_row %}
  6. {% block gallery_manager_widget %}
  7. {{ block('collection_widget') }}
  8. {% endblock gallery_manager_widget %}
  9. {% block collection_row %}
  10. {% if prototype is defined and not prototype.rendered %}
  11. {% set row_attr = row_attr|merge({ 'data-prototype': form_row(prototype) }) %}
  12. {% endif %}
  13. {% set row_attr = row_attr|merge({
  14. 'data-entry-is-complex': form.vars.ea_crud_form.ea_field and form.vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ? 'true' : 'false',
  15. 'data-allow-add': allow_add ? 'true' : 'false',
  16. 'data-allow-delete': allow_delete ? 'true' : 'false',
  17. 'data-num-items': form.children|length,
  18. 'data-form-type-name-placeholder': prototype is defined ? prototype.vars.name : '',
  19. }) %}
  20. {{ block('form_row') }}
  21. {% endblock collection_row %}
  22. {% block collection_widget %}
  23. {{ block('form_widget') }}
  24. {% if allow_add|default(false) %}
  25. <button type="button" class="btn btn-link field-collection-add">
  26. <i class="fa fa-plus pr-1"></i>
  27. {{ 'action.add_new_item'|trans({}, 'EasyAdminBundle') }}
  28. </button>
  29. {% endif %}
  30. {% endblock collection_widget %}
  31. {% block collection_entry_widget %}
  32. {% set is_complex = form_parent(form).vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ?? false %}
  33. <div class="field-collection-item {{ is_complex ? 'field-collection-item-complex' }}">
  34. {{ form_widget(form) }}
  35. {% if form_parent(form).vars.allow_delete|default(false) %}
  36. <button type="button" class="btn btn-link field-collection-delete"
  37. title="{{ 'action.remove_item'|trans({}, 'EasyAdminBundle') }}">
  38. <i class="fas fa-times"></i>
  39. </button>
  40. {% endif %}
  41. </div>
  42. {% endblock collection_entry_widget %}
  43. {% block file_manager_image_row %}
  44. {{ form_widget(form) }}
  45. {% endblock file_manager_image_row %}
  46. {% block file_manager_legend_row %}
  47. {{ form_widget(form) }}
  48. {% endblock file_manager_legend_row %}
  49. {% block file_manager_position_row %}
  50. {{ form_widget(form) }}
  51. {% endblock file_manager_position_row %}
  52. {% block file_manager_widget %}
  53. <div class="lc-filemanager col-xs-12">
  54. <div class="col-md-6 col-xs-12 nopadding" style="padding: 0px;">
  55. <img style="width: 200px; height: 150px; object-fit: contain; background: #ddd; " src="{{ form.path.vars.value }}" class="lc-filemenager-preview" id="{{ form.path.vars.id }}_preview" alt="">
  56. </div>
  57. <div class="input-group">
  58. {{ form_widget(form) }}
  59. <div class="input-group-append">
  60. <button type="button" class="btn btn-sm lc-filemanager-open" data-id="{{ form.path.vars.id }}"
  61. data-target="{{ path('file_manager', {module:1, conf:'default'})|raw }}">
  62. <i class="fa fa-folder-open-o"></i>
  63. </button>
  64. {% if value %}
  65. <button type="button" class="btn btn-sm lc-filemanager-delete" data-id="{{ form.path.vars.id }}">
  66. <i class="fa fa-trash-o"></i>
  67. </button>
  68. {% endif %}
  69. {% if form.parent.vars['row_attr']['data-sortable'] is defined %}
  70. <button type="button" class="btn btn-sm lc-btn-sortable" >
  71. <i class="fa fa-arrows"></i>
  72. </button>
  73. {% endif %}
  74. </div>
  75. </div>
  76. </div>
  77. {% endblock file_manager_widget %}