|
| 1 | +{% macro render(directoryPath) %} |
| 2 | + {% trans_default_domain 'JoliMediaSyliusBundle' %} |
| 3 | + |
| 4 | + <div id="modal-folder-choice" class="modal" tabindex="-1"> |
| 5 | + <div class="modal-dialog"> |
| 6 | + <div class="modal-content"> |
| 7 | + <div class="modal-body"> |
| 8 | + <div class="mb-3 d-flex justify-content-between align-items-center"> |
| 9 | + <div class="folder-modal-breadcrumb"> |
| 10 | + {% if directoryPath %} |
| 11 | + {% set parts = directoryPath|split('/') %} |
| 12 | + <a href="{{ path('joli_media_sylius_admin_choose') }}" data-folder-path=""> |
| 13 | + {{ 'media_library'|trans }} |
| 14 | + </a> |
| 15 | + {% for part in parts %} |
| 16 | + {% if part %} |
| 17 | + <span class="breadcrumb-separator">/</span> |
| 18 | + {% set path_so_far = parts|slice(0, loop.index)|join('/') %} |
| 19 | + {% if loop.last %} |
| 20 | + <span class="breadcrumb-current">{{ part }}</span> |
| 21 | + {% else %} |
| 22 | + <a href="{{ path('joli_media_sylius_admin_choose', { key: path_so_far }) }}" data-folder-path="{{ path_so_far }}">{{ part }}</a> |
| 23 | + {% endif %} |
| 24 | + {% endif %} |
| 25 | + {% endfor %} |
| 26 | + {% else %} |
| 27 | + <a href="{{ path('joli_media_sylius_admin_choose') }}" data-folder-path=""> |
| 28 | + {{ 'media_library'|trans }} |
| 29 | + </a> |
| 30 | + <span class="breadcrumb-separator">/</span> |
| 31 | + <span class="breadcrumb-current">{{ 'root'|trans }}</span> |
| 32 | + {% endif %} |
| 33 | + </div> |
| 34 | + <button type="button" class="btn btn-primary" data-component="folder-create"> |
| 35 | + {{ ux_icon('tabler:folder-plus') }} |
| 36 | + {{ 'directory.create'|trans }} |
| 37 | + </button> |
| 38 | + </div> |
| 39 | + <form method="post" action="{{ path('joli_media_sylius_admin_create_directory') }}" class="folder-create-form d-none mb-3"> |
| 40 | + <input type="hidden" name="_csrf_token" value="{{ csrf_token('media_create_directory') }}"> |
| 41 | + <input type="hidden" name="parentPath" value="{{ directoryPath|default('') }}"> |
| 42 | + <div class="input-group"> |
| 43 | + <input type="text" name="name" class="form-control folder-create-input" placeholder="{{ 'directory.create'|trans }}"> |
| 44 | + <button type="submit" class="btn btn-primary">{{ 'action.create'|trans }}</button> |
| 45 | + <button type="button" class="btn btn-secondary folder-create-cancel">{{ 'action.cancel'|trans }}</button> |
| 46 | + </div> |
| 47 | + </form> |
| 48 | + <div class="folder-list-container"></div> |
| 49 | + </div> |
| 50 | + <div class="modal-footer"> |
| 51 | + <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> |
| 52 | + {{ 'action.cancel'|trans }} |
| 53 | + </button> |
| 54 | + <a |
| 55 | + href="#" |
| 56 | + class="btn btn-primary folder-move-btn" |
| 57 | + data-folder-path="" |
| 58 | + > |
| 59 | + {{ 'action.move_to_this_directory'|trans }} |
| 60 | + </a> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + |
| 66 | + <form method="post" action="{{ path('joli_media_sylius_admin_move_directory') }}" id="move-form" class="d-none"> |
| 67 | + <input type="hidden" name="_csrf_token" value="{{ csrf_token('media_move_directory') }}"> |
| 68 | + <input type="hidden" name="from" value="{{ directoryPath }}"> |
| 69 | + <input type="hidden" name="to" id="move_to" value=""> |
| 70 | + </form> |
| 71 | +{% endmacro %} |
0 commit comments