mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 19:06:16 +01:00
Merge branch 'develop' into 1.10
# Conflicts: # CHANGELOG.md # themes/grav/css-compiled/preset.css.map # themes/grav/css-compiled/template.css # themes/grav/css-compiled/template.css.map # themes/grav/templates/pages.html.twig
This commit is contained in:
13
CHANGELOG.md
13
CHANGELOG.md
@@ -110,6 +110,19 @@
|
|||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed admin caching issues
|
* Fixed admin caching issues
|
||||||
|
|
||||||
|
# v1.9.11
|
||||||
|
## mm/dd/2019
|
||||||
|
|
||||||
|
1. [](#improved)
|
||||||
|
* Added new "secure delete" functionality [#1752](https://github.com/getgrav/grav-plugin-admin/issues/1752)
|
||||||
|
* Center text logo [#1751](https://github.com/getgrav/grav-plugin-admin/issues/1751)
|
||||||
|
* Added required span to editor field [#1748](https://github.com/getgrav/grav-plugin-admin/issues/1748)
|
||||||
|
* Warn users if JS is disabled [#1722](https://github.com/getgrav/grav-plugin-admin/issues/1722)
|
||||||
|
* Added target rule to quick links [#1518](https://github.com/getgrav/grav-plugin-admin/issues/1518)
|
||||||
|
1. [](#bugfix)
|
||||||
|
* Fixed `Badly encoded JSON data` warning when uploading files [grav#2663](https://github.com/getgrav/grav/issues/2663)
|
||||||
|
* Fixed `accept` for SVG in `file` uploaders [#1732](https://github.com/getgrav/grav-plugin-admin/issues/1732)
|
||||||
|
|
||||||
# v1.9.10
|
# v1.9.10
|
||||||
## 09/19/2019
|
## 09/19/2019
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ session:
|
|||||||
timeout: 1800
|
timeout: 1800
|
||||||
warnings:
|
warnings:
|
||||||
delete_page: true
|
delete_page: true
|
||||||
|
secure_delete: false
|
||||||
edit_mode: normal
|
edit_mode: normal
|
||||||
frontend_preview_target: inline
|
frontend_preview_target: inline
|
||||||
show_github_msg: true
|
show_github_msg: true
|
||||||
|
|||||||
@@ -243,6 +243,18 @@ form:
|
|||||||
type: bool
|
type: bool
|
||||||
help: Ask the user confirmation when deleting a page
|
help: Ask the user confirmation when deleting a page
|
||||||
|
|
||||||
|
warnings.secure_delete:
|
||||||
|
type: toggle
|
||||||
|
label: Secure Delete
|
||||||
|
highlight: 1
|
||||||
|
default: 1
|
||||||
|
options:
|
||||||
|
1: PLUGIN_ADMIN.ENABLED
|
||||||
|
0: PLUGIN_ADMIN.DISABLED
|
||||||
|
validate:
|
||||||
|
type: bool
|
||||||
|
help: Shows the user a field to enter the word DELETE and enable the confirm delete button.
|
||||||
|
|
||||||
hide_page_types:
|
hide_page_types:
|
||||||
type: array
|
type: array
|
||||||
label: Hide page types in Admin
|
label: Hide page types in Admin
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ class AdminBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$isMime = strstr($type, '/');
|
$isMime = strstr($type, '/');
|
||||||
$find = str_replace(['.', '*'], ['\.', '.*'], $type);
|
$find = str_replace(['.', '*', '+'], ['\.', '.*', '\+'], $type);
|
||||||
|
|
||||||
if ($isMime) {
|
if ($isMime) {
|
||||||
$match = preg_match('#' . $find . '$#', $mime);
|
$match = preg_match('#' . $find . '$#', $mime);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
PLUGIN_ADMIN:
|
PLUGIN_ADMIN:
|
||||||
|
ADMIN_NOSCRIPT_MSG: "Please enable JavaScript in your browser."
|
||||||
ADMIN_BETA_MSG: "This is a Beta release! Use this in production at your own risk..."
|
ADMIN_BETA_MSG: "This is a Beta release! Use this in production at your own risk..."
|
||||||
ADMIN_REPORT_ISSUE: "Found an issue? Please report it on GitHub."
|
ADMIN_REPORT_ISSUE: "Found an issue? Please report it on GitHub."
|
||||||
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Powered by Grav</a> - The Modern Flat File CMS"
|
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Powered by Grav</a> - The Modern Flat File CMS"
|
||||||
@@ -43,10 +44,12 @@ PLUGIN_ADMIN:
|
|||||||
EXPERT: "Expert"
|
EXPERT: "Expert"
|
||||||
EXPAND_ALL: "Expand All"
|
EXPAND_ALL: "Expand All"
|
||||||
COLLAPSE_ALL: "Collapse All"
|
COLLAPSE_ALL: "Collapse All"
|
||||||
|
SECURE_DELETE_DESC: "Type DELETE and confirm"
|
||||||
ERROR: "Error"
|
ERROR: "Error"
|
||||||
CLOSE: "Close"
|
CLOSE: "Close"
|
||||||
CANCEL: "Cancel"
|
CANCEL: "Cancel"
|
||||||
CONTINUE: "Continue"
|
CONTINUE: "Continue"
|
||||||
|
CONFIRM: "Confirm"
|
||||||
MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE: "Confirmation Required"
|
MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE: "Confirmation Required"
|
||||||
MODAL_CHANGED_DETECTED_TITLE: "Changes Detected"
|
MODAL_CHANGED_DETECTED_TITLE: "Changes Detected"
|
||||||
MODAL_CHANGED_DETECTED_DESC: "You have unsaved changes. Are you sure you want to leave without saving?"
|
MODAL_CHANGED_DETECTED_DESC: "You have unsaved changes. Are you sure you want to leave without saving?"
|
||||||
|
|||||||
@@ -43,10 +43,12 @@ PLUGIN_ADMIN:
|
|||||||
EXPERT: "Esperto"
|
EXPERT: "Esperto"
|
||||||
EXPAND_ALL: "Expandir Tudo"
|
EXPAND_ALL: "Expandir Tudo"
|
||||||
COLLAPSE_ALL: "Recolher Tudo"
|
COLLAPSE_ALL: "Recolher Tudo"
|
||||||
|
SECURE_DELETE_DESC: "Digite DELETE e confirme"
|
||||||
ERROR: "Erro"
|
ERROR: "Erro"
|
||||||
CLOSE: "Fechar"
|
CLOSE: "Fechar"
|
||||||
CANCEL: "Cancelar"
|
CANCEL: "Cancelar"
|
||||||
CONTINUE: "Continuar"
|
CONTINUE: "Continuar"
|
||||||
|
CONFIRM: "Confirmar"
|
||||||
MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE: "Confirmação Requerida"
|
MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE: "Confirmação Requerida"
|
||||||
MODAL_CHANGED_DETECTED_TITLE: "Alterações Detectadas"
|
MODAL_CHANGED_DETECTED_TITLE: "Alterações Detectadas"
|
||||||
MODAL_CHANGED_DETECTED_DESC: "Você tem alterações não salvas. Tem certeza que deseja sair sem salvar?"
|
MODAL_CHANGED_DETECTED_DESC: "Você tem alterações não salvas. Tem certeza que deseja sair sem salvar?"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
4
themes/grav/css-compiled/template.css
vendored
4
themes/grav/css-compiled/template.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
36
themes/grav/js/admin.min.js
vendored
36
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
4
themes/grav/js/vendor.min.js
vendored
4
themes/grav/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -103,6 +103,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
&.text-logo {
|
&.text-logo {
|
||||||
|
text-align: center;
|
||||||
font-size: 4rem;
|
font-size: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,10 @@
|
|||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
opacity: .6;
|
||||||
|
cursor: no-drop;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,10 @@
|
|||||||
{% if field.help %}
|
{% if field.help %}
|
||||||
{% set hint = 'data-hint="' ~ field.help|tu|raw ~ '"' %}
|
{% set hint = 'data-hint="' ~ field.help|tu|raw ~ '"' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="form-label form-field hint--bottom" {{ hint|raw }}>{{ field.label|tu|raw }}</div>
|
<div class="form-label form-field hint--bottom" {{ hint|raw }}>
|
||||||
|
{{ field.label|tu|raw }}
|
||||||
|
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<div class="form-field {{ field.classes|default('') }}">
|
<div class="form-field {{ field.classes|default('') }}">
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
|
|
||||||
{% set modular = context.modular ? 'modular_' : '' %}
|
{% set modular = context.modular ? 'modular_' : '' %}
|
||||||
{% set warn = config.plugins.admin.warnings.delete_page %}
|
{% set warn = config.plugins.admin.warnings.delete_page %}
|
||||||
|
{% set secure_delete = config.plugins.admin.warnings.secure_delete %}
|
||||||
{% set page_lang = context.language %}
|
{% set page_lang = context.language %}
|
||||||
{% set type = 'page' %}
|
{% set type = 'page' %}
|
||||||
|
|
||||||
@@ -426,10 +427,19 @@
|
|||||||
<p class="bigger">
|
<p class="bigger">
|
||||||
{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}
|
{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}
|
||||||
</p>
|
</p>
|
||||||
|
{% if secure_delete %}
|
||||||
|
<p class="form-secure-delete">
|
||||||
|
<input id="secure-delete-field" autofocus type="text" placeholder="{{ "PLUGIN_ADMIN.SECURE_DELETE_DESC"|tu }}" />
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
<br>
|
<br>
|
||||||
<div class="button-bar">
|
<div class="button-bar">
|
||||||
<button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</button>
|
<button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</button>
|
||||||
<a class="button danger disable-after-click" data-delete-action href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
{% if secure_delete %}
|
||||||
|
<button id="secure-delete-btn" disabled="true" class="button danger disable-after-click" data-delete-action><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONFIRM"|tu }}</button>
|
||||||
|
{% else %}
|
||||||
|
<a class="button danger disable-after-click" data-delete-action href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -442,5 +452,18 @@
|
|||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
<script>
|
<script>
|
||||||
$('.admin-pages .form-tabs .tabs-nav').css('margin-right', ($('#admin-topbar').width() + 20) + 'px');
|
$('.admin-pages .form-tabs .tabs-nav').css('margin-right', ($('#admin-topbar').width() + 20) + 'px');
|
||||||
|
{% if secure_delete %}
|
||||||
|
$('#secure-delete-field').keyup(function () {
|
||||||
|
var inputValue = $(this).val();
|
||||||
|
if (inputValue == 'DELETE') {
|
||||||
|
$('#secure-delete-btn').attr('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#secure-delete-btn').attr('disabled', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(document).on('closing', '.remodal', function () {
|
||||||
|
$('#secure-delete-field').val('');
|
||||||
|
});
|
||||||
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@
|
|||||||
{% include 'partials/messages.html.twig' %}
|
{% include 'partials/messages.html.twig' %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
{% block noscript %}
|
||||||
|
{% include 'partials/noscript.html.twig' %}
|
||||||
|
{% endblock noscript %}
|
||||||
|
|
||||||
{% block page %}
|
{% block page %}
|
||||||
<div class="remodal-bg">
|
<div class="remodal-bg">
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="{{ item.class }} hint--bottom" data-hint="{{ item.hint }}" {{ data_tags|raw }}>
|
<li class="{{ item.class }} hint--bottom" data-hint="{{ item.hint }}" {{ data_tags|raw }}>
|
||||||
{% if item.route %}
|
{% if item.route %}
|
||||||
<a href="{{ url(item.route) }}">
|
<a href="{{ url(item.route) }}" {% if item.target %}target="{{ item.target }}"{% endif %}>
|
||||||
<i class="fa fa-fw {{ item.icon }}"></i>
|
<i class="fa fa-fw {{ item.icon }}"></i>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
42
themes/grav/templates/partials/noscript.html.twig
Normal file
42
themes/grav/templates/partials/noscript.html.twig
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<style>
|
||||||
|
.error-message {
|
||||||
|
background-color: #fce4e4;
|
||||||
|
border: 1px solid #fcc2c3;
|
||||||
|
width: 100%;
|
||||||
|
padding: 20px 30px;
|
||||||
|
}
|
||||||
|
.error-text {
|
||||||
|
color: #cc0033;
|
||||||
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
|
width: 100%;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 20px;
|
||||||
|
text-shadow: 1px 1px rgba(250,250,250,.3);
|
||||||
|
}
|
||||||
|
.full-height {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="noscript" class="full-height">
|
||||||
|
<main id="admin-main" class="full-height">
|
||||||
|
<div id="titlebar" class="titlebar">
|
||||||
|
<h1><i class="fa fa-fw fa-exclamation-triangle"></i>{{ "PLUGIN_ADMIN.ERROR"|tu }}</h1>
|
||||||
|
</div>
|
||||||
|
<div class="full-height">
|
||||||
|
<div class="error-message {% if config.plugins.admin.content_padding %}content-padding{% endif %}">
|
||||||
|
<span class="error-text">{{ "PLUGIN_ADMIN.ADMIN_NOSCRIPT_MSG"|tu }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function checkjs() {
|
||||||
|
var element = document.getElementById("noscript");
|
||||||
|
element.style.display = 'none';
|
||||||
|
}
|
||||||
|
checkjs();
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user