1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-16 01:54:28 +02:00

feat(admin-plugin): update layout for media

This commit is contained in:
Awilum
2020-02-21 15:41:10 +03:00
parent 25e439da91
commit 683471b0bb

View File

@@ -15,8 +15,71 @@
</div>
</div>
<br>
{% set allowed_image_files = ['jpeg', 'png', 'gif', 'jpg'] %}
<table class="table">
<thead>
<tr>
<th>
{{ tr('admin_file') }}
</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td style="height: 64px;">
{{ filesystem_basename(file) }}
</td>
<td class="text-center flex justify-center" style="height: 64px;">
{% if (filesystem_ext(file) in allowed_image_files) %}
<img src="{{ site_url() }}/api/delivery/images/{{ id }}/{{ filesystem_basename(file) }}?w=64&q=70&dpr=2&token={{ registry.flextype.api.images.default_token }}" alt="" class="border-2 rounded border-gray-200" style="height: 50px;">
{% endif %}
</td>
<td class="text-right" style="height: 64px;">
<button type="button" class="js-dropdown-btn" data-dropdown="dropdown-{{ id }}">
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
</button>
<div id="dropdown-{{ id }}" class="dropdown">
<a class="dropdown__item" href="{{ path_for('admin.snippets.edit') }}?id={{ id }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
{{ tr('admin_edit') }}</a>
<a class="dropdown__item" href="{{ path_for('admin.snippets.rename') }}?id={{ id }}">
<i class="icon icon--white mr-3">{{ icon('fas fa-font') }}</i>
{{ tr('admin_rename') }}</a>
<a class="dropdown__item" href="javascript:;" onclick="event.preventDefault();
document.getElementById('duplicate-snippet-id-{{ id }}').submit();">
<i class="icon icon--white mr-3">{{ icon('fas fa-copy') }}</i>
{{ tr('admin_duplicate') }}</a>
<a class="dropdown__item js-snippets-info" href="javascript:;" onclick="event.preventDefault();
embededCode('{{ id }}', {{ loop.index0 }});">
<i class="icon icon--white mr-3">{{ icon('fas fa-code') }}</i>
{{ tr('admin_embeded_code') }}</a>
<div class="dropdown__divider"></div>
<a class="dropdown__item" href="javascript:;" onclick="event.preventDefault();
deleteSnippet('{{ id }}', {{ loop.index0 }});">
<i class="icon icon--white mr-3">{{ icon('fas fa-trash-alt') }}</i>
{{ tr('admin_delete') }}</a>
<form id="delete-snippet-id-{{ id }}" action="{{ path_for('admin.snippets.deleteProcess') }}" method="POST" style="display: none;">
{{ csrf() }}
<input type="hidden" name="snippet-id" value="{{ id }}">
</form>
<form id="duplicate-snippet-id-{{ id }}" action="{{ path_for('admin.snippets.duplicateProcess') }}" method="POST" style="display: none;">
{{ csrf() }}
<input type="hidden" name="snippet-id" value="{{ id }}">
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
{#
<div class="flex row">
{% for file in files %}
<div class="col w-3/12 flex row justify-center items-center relative p-10 mb-2">
@@ -27,7 +90,7 @@
{% endfor %}
</div>
{#
<div class="modal animated fadeIn faster image-preview-modal" id="entriesImagePreview" tabindex="-1" role="dialog" aria-labelledby="entriesImagePreviewLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">