merge master in prod
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
{% if not blueprints or (blueprints.schema.type(field.type)['input@'] ?? true) is same as(true) %}
|
||||
{% set originalValue = originalValue is defined ? originalValue : value %}
|
||||
{% set toggleableChecked = field.toggleable and (originalValue is not null and originalValue is not empty) %}
|
||||
{% set toggleableChecked = field.toggleable and originalValue is not null %}
|
||||
{% set isDisabledToggleable = field.toggleable and not toggleableChecked %}
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
{% set value = value ?? field.default %}
|
||||
|
||||
{% if (field.yaml or field.validate.type == 'yaml') and value is iterable%}
|
||||
{% set value = value|toYaml %}
|
||||
|
||||
@@ -11,7 +11,10 @@
|
||||
{% if field.help %}
|
||||
{% set hint = 'data-hint="' ~ field.help|tu|raw ~ '"' %}
|
||||
{% 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 %}
|
||||
{% endblock %}
|
||||
<div class="form-field {{ field.classes|default('') }}">
|
||||
|
||||
@@ -48,9 +48,12 @@
|
||||
>
|
||||
|
||||
{% block group %}
|
||||
{% if field.text %}
|
||||
<p>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.text|tu }}{% else %}{{ field.text|t }}{% endif %}
|
||||
<p>
|
||||
{% if field.text %}
|
||||
{% if grav.twig.twig.filters['tu'] is defined %}
|
||||
{{ field.markdown ? field.text|tu|markdown : '<p>' ~ field.text|tu ~ '</p>' }}
|
||||
{% else %}
|
||||
{{ field.markdown ? field.text|t|markdown : '<p>' ~ field.t ~ '</p>' }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if field.fields %}
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
|
||||
{% set modular = context.modular ? 'modular_' : '' %}
|
||||
{% set warn = config.plugins.admin.warnings.delete_page %}
|
||||
{% set secure_delete = config.plugins.admin.warnings.secure_delete %}
|
||||
{% set admin_lang = admin.session.admin_lang ?: 'en' %}
|
||||
{% set page_lang = context.language %}
|
||||
{% set type = 'page' %}
|
||||
@@ -405,10 +406,19 @@
|
||||
<p class="bigger">
|
||||
{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}
|
||||
</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>
|
||||
<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>
|
||||
<a class="button 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>
|
||||
</form>
|
||||
</div>
|
||||
@@ -421,5 +431,18 @@
|
||||
{{ parent() }}
|
||||
<script>
|
||||
$('.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>
|
||||
{% endblock %}
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
{% else %}
|
||||
|
||||
{% block noscript %}
|
||||
{% include 'partials/noscript.html.twig' %}
|
||||
{% endblock noscript %}
|
||||
|
||||
{% block page %}
|
||||
<div class="remodal-bg">
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{% endif %}
|
||||
<li class="{{ item.class }} hint--bottom" data-hint="{{ item.hint }}" {{ data_tags|raw }}>
|
||||
{% 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>
|
||||
</a>
|
||||
{% else %}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{% set user_avatar = admin.user.getAvatarUrl() %}
|
||||
<img src="{{ '?' not in user_avatar ? user_avatar ~ '?s=80' : user_avatar }}" />
|
||||
<img src="{{ ('?' not in user_avatar) and (not user_avatar starts with 'data:') ? user_avatar ~ '?s=80' : user_avatar }}" />
|
||||
|
||||
@@ -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>
|
||||
@@ -42,7 +42,7 @@
|
||||
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
|
||||
</td>
|
||||
<td class="gpm-actions">
|
||||
{% if (not installing and (plugin.form.fields.enabled.type != 'hidden' and plugin.form.fields.tabs.fields.login.fields.enabled.type != 'hidden')) %}
|
||||
{% if (not installing and (plugin.form.fields.enabled.type != 'hidden' and plugin.form.fields.tabs.fields.options.fields.enabled.type != 'hidden')) %}
|
||||
<a class="{{ data.get('enabled') ? 'enabled' : 'disabled' }}" href="{{ uri.addNonce(base_url_relative ~ '/plugins/' ~ slug ~ '/task' ~ config.system.param_sep ~ (data.get('enabled') ? 'disable' : 'enable'), 'admin-form', 'admin-nonce') }}">
|
||||
<i class="fa fa-fw fa-toggle-{{ data.get('enabled') ? 'on' : 'off' }}"></i>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user