mirror of
https://github.com/flextype/flextype.git
synced 2025-08-18 10:51:21 +02:00
feat(admin-plugin): updates and fixes for templates #211
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
cache.save(entry.slug ~ '_counter', _entries_length) %}
|
||||
{% endif %}
|
||||
<div class="w-full md:w-3/12 lg:w-2/12 text-center p-4 relative">
|
||||
<button type="button" class="js-dropdown-btn" style="top: 16px; right: 16px; position: absolute; z-index: 10; width: 34px; height: 34px;" data-dropdown="dropdown-{{ entry.slug }}">
|
||||
<button type="button" class="js-dropdown-btn" style="top: 16px; right: 16px; position: absolute; z-index: 10; width: 34px; height: 34px;" data-dropdown="dropdown-list-{{ entry.slug }}">
|
||||
<i class="icon">{{ icon('fas fa-ellipsis-h') }}</i>
|
||||
</button>
|
||||
<div id="dropdown-{{ entry.slug }}" class="dropdown">
|
||||
<div id="dropdown-list-{{ entry.slug }}" class="dropdown">
|
||||
<a class="dropdown__item" href="{{ path_for('admin.entries.edit') }}?id={{ entry.slug }}&type=editor">
|
||||
<i class="icon icon--white mr-3">{{ icon('fas fa-edit') }}</i>
|
||||
{{ tr('admin_edit') }}</a>
|
||||
@@ -133,13 +133,13 @@
|
||||
{% if fieldset.icon %}
|
||||
<i class="icon">{{ icon(fieldset.icon) }}</i>
|
||||
{% else %}
|
||||
<i class="icon">{{ icon(fieldset.icon) }}</i>
|
||||
<i class="icon">{{ icon('far fa-file-alt') }}</i>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<i class="icon">{{ icon(fieldset.icon) }}</i>
|
||||
<i class="icon">{{ icon('far fa-file-alt') }}</i>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<i class="icon">{{ icon(fieldset.icon) }}</i>
|
||||
<i class="icon">{{ icon('far fa-file-alt') }}</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="pl-0 {% if entry.visibility == 'hidden' or entry.visibility == 'draft' or entry.routable == false %}opacity-50{% endif %}">
|
||||
@@ -283,13 +283,13 @@
|
||||
<script>
|
||||
function deleteEntry(id, row_num) {
|
||||
dropdown[row_num].hide();
|
||||
Swal.fire({title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_entry') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}).then(
|
||||
(result) => {
|
||||
if (result.value) {
|
||||
document.getElementById('delete-id-' + id).submit();
|
||||
}
|
||||
Swal.fire(
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_entry_delete') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
document.getElementById('delete-id-' + id).submit();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@@ -45,8 +45,7 @@
|
||||
<i class="icon icon--white mr-3">{{ icon('fas fa-copy') }}</i>
|
||||
{{ tr('admin_duplicate') }}</a>
|
||||
<div class="dropdown__divider"></div>
|
||||
<a class="dropdown__item" href="javascript:;" onclick="event.preventDefault();
|
||||
document.getElementById('delete-fieldset-id-{{ id }}').submit();">
|
||||
<a class="dropdown__item" href="javascript:;" onclick="event.preventDefault(); deleteFieldset('{{ id }}', {{ loop.index0 }});">
|
||||
<i class="icon icon--white mr-3">{{ icon('fas fa-trash-alt') }}</i>
|
||||
{{ tr('admin_delete') }}</a>
|
||||
<form id="delete-fieldset-id-{{ id }}" action="{{ path_for('admin.fieldsets.deleteProcess') }}" method="POST" style="display: none;">
|
||||
@@ -72,4 +71,19 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block tail %}
|
||||
<script>
|
||||
function deleteFieldset(id, row_num) {
|
||||
dropdown[row_num].hide();
|
||||
Swal.fire(
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_fieldset_delete') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
document.getElementById('delete-fieldset-id-' + id).submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@@ -94,7 +94,7 @@
|
||||
function deleteSnippet(id, row_num) {
|
||||
dropdown[row_num].hide();
|
||||
Swal.fire(
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_delivery_token') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_snippet_delete') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
document.getElementById('delete-snippet-id-' + id).submit();
|
||||
@@ -106,10 +106,10 @@
|
||||
dropdown[row_num].hide();
|
||||
Swal.fire({
|
||||
title: "{{ tr('admin_embeded_code') }}",
|
||||
html: '<div><label>{{ tr("admin_shortcode") }}</label><div class="form-control"><span id="snippet">[snippets_exec id="' + id + '"]</span><button class="js-clipboard-buttonbtn" data-clipboard-target="#snippet">{{ tr("admin_copy") }}</button></div><br><label for="template_code"' +
|
||||
'>{{ tr("admin_template_code") }}</label><div id="template_code" class="alert alert-dark clipboard" role="alert"><span id="html">{{ snippets.exec("' + id + '") }}</span><button class="js-clipboard-buttonbtn" data-clipboard-target' +
|
||||
'="#html">{{ tr("admin_copy") }}</button></div></div>'
|
||||
html: '<div><label>{{ tr("admin_shortcode") }}</label><div class="form-control"><span id="snippet">[snippets_exec id="' + id + '"]</span><button class="js-clipboard-buttonbtn" data-clipboard-target="#snippet">{{ tr("admin_copy") }}</button></div><br><labe' +
|
||||
'l for="template_code">{{ tr("admin_template_code") }}</label><div id="template_code" class="alert alert-dark clipboard" role="alert"><span id="html">{{ snippets.exec("' + id + '") }}</span><button class="js-clipboard-buttonbtn" ' +
|
||||
'data-clipboard-target="#html">{{ tr("admin_copy") }}</button></div></div>'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@@ -77,7 +77,7 @@
|
||||
function deleteDeliveryToken(id, row_num) {
|
||||
dropdown[row_num].hide();
|
||||
Swal.fire(
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_delivery_token') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
{title: "{{ tr('admin_cofirmation_required') }}", text: "{{ tr('admin_cofirmation_required_for_delivery_token_delete') }}", showCancelButton: true, confirmButtonText: "{{ tr('admin_yes_iam_sure')|raw }}", cancelButtonText: "{{ tr('admin_cancel') }}"}
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
document.getElementById('delete-api-token-id-' + id).submit();
|
||||
@@ -85,4 +85,4 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user