first commit

This commit is contained in:
2020-06-11 16:42:43 +02:00
commit 449ca1d987
5099 changed files with 622034 additions and 0 deletions
@@ -0,0 +1,90 @@
{% extends 'partials/base.html.twig' %}
{% set config_slug = uri.basename|e %}
{% set isInfo = (config_slug == 'info') %}
{% set tab_title_string = "PLUGIN_ADMIN." ~ config_slug|upper %}
{% set tab_title = (tab_title_string|tu == tab_title_string ? config_slug|capitalize : tab_title_string|tu) %}
{% set title = "PLUGIN_ADMIN.CONFIGURATION"|tu ~ ": " ~ tab_title %}
{% set config_ignores = ['scheduler', 'backups'] %}
{% if not isInfo %}
{% set data = admin.data('config/' ~ config_slug) %}
{% endif %}
{% block stylesheets %}
{% do assets.addCss(theme_url ~ '/css/codemirror/codemirror.css') %}
{{ parent() }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% endblock %}
{% block titlebar %}
<div class="button-bar">
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
{% if data.file.filename %}
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
{% endif %}
</div>
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ tab_title }}</h1>
{% endblock %}
{% block content_top %}
{% if data.file.filename %}
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
{% endif %}
<div class="form-tabs">
<div class="tabs-nav">
{% if authorize(['admin.configuration_system', 'admin.super']) %}
<a {% if config_slug == 'system' %}class="active"{% endif %} href="{{ base_url_relative }}/config/system">
<span>{{ "PLUGIN_ADMIN.SYSTEM"|tu }}</span>
</a>
{% endif %}
{% if authorize(['admin.configuration_site', 'admin.super']) %}
<a {% if config_slug == 'site' %}class="active"{% endif %} href="{{ base_url_relative }}/config/site">
<span>{{ "PLUGIN_ADMIN.SITE"|tu }}</span>
</a>
{% endif %}
{% for configuration in admin.configurations if (configuration not in config_ignores) %}
{% if authorize(['admin.configuration_' ~ configuration, 'admin.super']) %}
{% set current_blueprints = admin.data('config/' ~ configuration).blueprints.toArray() %}
{% if configuration != 'system' and configuration != 'site' and not current_blueprints.form.hidden and (current_blueprints.form.fields is not empty or current_blueprints.form.field is not empty) %}
<a {% if config_slug == configuration %}class="active"{% endif %} href="{{ base_url_relative }}/config/{{configuration}}">
{% set configuration_string = "PLUGIN_ADMIN." ~ configuration|upper %}
<span>{{ (configuration_string|tu == configuration_string ? configuration|capitalize : configuration_string|tu) }}</span>
</a>
{% endif %}
{% endif %}
{% endfor %}
{% if authorize(['admin.configuration_info', 'admin.super']) %}
<a {% if config_slug == 'info' %}class="active"{% endif %} href="{{ base_url_relative }}/config/info">
<span>{{ "PLUGIN_ADMIN.INFO"|tu }}</span>
</a>
{% endif %}
</div>
</div>
{% endblock %}
{% block content %}
{% if authorize(['admin.configuration_' ~ config_slug, 'admin.super']) %}
{% if isInfo %}
<div id="phpinfo">
{{ admin.phpinfo|raw }}
</div>
{% else %}
<div class="config-wrapper-{{ config_slug }}">
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
</div>
{% endif %}
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% endblock %}
@@ -0,0 +1,70 @@
{% extends 'partials/base.html.twig' %}
{% set title = "PLUGIN_ADMIN.DASHBOARD"|tu %}
{% set clear_cache_url = base_url_relative ~ '/cache.json/task' ~ config.system.param_sep ~ 'clearCache'|e('html_attr') %}
{% block titlebar %}
<div class="button-bar">
{% if authorize(['admin.maintenance', 'admin.super', 'admin.cache']) %}
<div class="button-group">
<button data-clear-cache-type="" data-clear-cache="{{ uri.addNonce(clear_cache_url, 'admin-form', 'admin-nonce') }}" class="button"><i class="fa fa-trash"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}</button>
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu">
<li><a data-clear-cache-type="all" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'all', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ALL_CACHE"|tu }}</a></li>
<li><a data-clear-cache-type="assets-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'assets-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ASSETS_ONLY"|tu }}</a></li>
<li><a data-clear-cache-type="images-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'images-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_IMAGES_ONLY"|tu }}</a></li>
<li><a data-clear-cache-type="cache-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'cache-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_CACHE_ONLY"|tu }}</a></li>
<li><a data-clear-cache-type="tmp-only" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'tmp-only', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_TMP_ONLY"|tu }}</a></li>
<li><a data-clear-cache-type="purge" data-clear-cache="{{ uri.addNonce(clear_cache_url ~'/cleartype' ~ config.system.param_sep ~ 'purge', 'admin-form', 'admin-nonce') }}" href="#">{{ "PLUGIN_ADMIN.CACHE_PURGE"|tu }}</a></li>
</ul>
</div>
{% endif %}
{% if authorize(['admin.maintenance', 'admin.super']) %}
<button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
{% endif %}
</div>
<h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</h1>
{% endblock %}
{% block widgets %}
{% if config.plugins.admin.notifications.dashboard %}
<div class="dashboard-notifications-container"></div>
{% endif %}
<div id="admin-dashboard">
{% if grav.twig.plugins_hooked_dashboard_widgets_top %}
{% for widget in grav.twig.plugins_hooked_dashboard_widgets_top %}
{% if attribute(config.plugins.admin.widgets, widget.template) == true %}
<div class="dashboard-item-flex">
{% include 'partials/' ~ widget.template ~ '.html.twig' %}
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
{% endblock %}
{% block content %}
{%- if grav.twig.plugins_hooked_dashboard_widgets_main -%}
{%- for widget in grav.twig.plugins_hooked_dashboard_widgets_main -%}
{%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
{% include 'partials/' ~ widget.template ~ '.html.twig' %}
{% endif -%}
{%- endfor -%}
{%- endif -%}
{% endblock %}
{% block content_bottom %}
<div id="admin-dashboard">
{%- if grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
{%- for widget in grav.twig.plugins_hooked_dashboard_widgets_bottom -%}
{%- if attribute(config.plugins.admin.widgets, widget.template) == true %}
{% include 'partials/' ~ widget.template ~ '.html.twig' %}
{% endif -%}
{%- endfor -%}
{%- endif -%}
</div>
{% endblock %}
@@ -0,0 +1,5 @@
{% if admin.json_response %}
{{ admin.json_response|json_encode|raw }}
{% else %}
{}
{% endif %}
@@ -0,0 +1,18 @@
{% extends 'partials/base.html.twig' %}
{% block messages %}{% endblock %}
{% block content %}
<div class="admin-block">
<h1>
{{ "PLUGIN_ADMIN.ACCESS_DENIED"|tu }}
</h1>
{% include 'partials/messages.html.twig' %}
<p>{{ admin.user.fullname }}, {{ "PLUGIN_ADMIN.ACCOUNT_NOT_ADMIN"|tu }}. <a href="{{ uri.addNonce(base_url_relative ~ '/task' ~ config.system.param_sep ~ 'logout', 'logout-form', 'logout-nonce') }}">{{ "PLUGIN_ADMIN.LOGOUT"|tu }}</a></p>
</div>
{% endblock %}
{% block navigation %}
{% endblock %}
@@ -0,0 +1,194 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Really Simple HTML Email Template</title>
<style>
/* -------------------------------------
GLOBAL
------------------------------------- */
* {
margin: 0;
padding: 0;
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
font-size: 100%;
line-height: 1.6;
}
img {
max-width: 100%;
}
body {
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: none;
width: 100%!important;
height: 100%;
}
/* -------------------------------------
ELEMENTS
------------------------------------- */
a {
color: #348eda;
}
.btn-primary {
text-decoration: none;
color: #FFF;
background-color: #348eda;
border: solid #348eda;
border-width: 10px 20px;
line-height: 2;
font-weight: bold;
margin-right: 10px;
text-align: center;
cursor: pointer;
display: inline-block;
border-radius: 25px;
}
.btn-secondary {
text-decoration: none;
color: #FFF;
background-color: #aaa;
border: solid #aaa;
border-width: 10px 20px;
line-height: 2;
font-weight: bold;
margin-right: 10px;
text-align: center;
cursor: pointer;
display: inline-block;
border-radius: 25px;
}
.last {
margin-bottom: 0;
}
.first {
margin-top: 0;
}
.padding {
padding: 10px 0;
}
/* -------------------------------------
BODY
------------------------------------- */
table.body-wrap {
width: 100%;
padding: 20px;
}
table.body-wrap .container {
border: 1px solid #f0f0f0;
}
/* -------------------------------------
FOOTER
------------------------------------- */
table.footer-wrap {
width: 100%;
clear: both!important;
}
.footer-wrap .container p {
font-size: 12px;
color: #666;
}
table.footer-wrap a {
color: #999;
}
/* -------------------------------------
TYPOGRAPHY
------------------------------------- */
h1, h2, h3 {
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color: #000;
margin: 40px 0 10px;
line-height: 1.2;
font-weight: 200;
}
h1 {
font-size: 36px;
}
h2 {
font-size: 28px;
}
h3 {
font-size: 22px;
}
p, ul, ol {
margin-bottom: 10px;
font-weight: normal;
font-size: 14px;
}
ul li, ol li {
margin-left: 5px;
list-style-position: inside;
}
/* ---------------------------------------------------
RESPONSIVENESS
Nuke it from orbit. It's the only way to be sure.
------------------------------------------------------ */
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container {
display: block!important;
max-width: 600px!important;
margin: 0 auto!important; /* makes it centered */
clear: both!important;
}
/* Set the padding on the td rather than the div for Outlook compatibility */
.body-wrap .container {
padding: 20px;
}
/* This should also be a block element, so that it will fill 100% of the .container */
.content {
max-width: 600px;
margin: 0 auto;
display: block;
}
/* Let's make sure tables in the content area are 100% wide */
.content table {
width: 100%;
}
</style>
</head>
<body bgcolor="#f6f6f6">
<!-- body -->
<table class="body-wrap" bgcolor="#f6f6f6">
<tr>
<td></td>
<td class="container" bgcolor="#FFFFFF">
<div class="content">
<table>
<tr>
<td>
{{ content|raw }}
</td>
</tr>
</table>
</div>
</td>
<td></td>
</tr>
</table>
<!-- /body -->
<!-- footer -->
<table class="footer-wrap">
<tr>
<td></td>
<td class="container">
<div class="content">
<table>
<tr>
<td align="center">
{{ 'PLUGIN_ADMIN.EMAIL_FOOTER'|tu|raw }}
</td>
</tr>
</table>
</div>
</td>
<td></td>
</tr>
</table>
<!-- /footer -->
</body>
</html>
@@ -0,0 +1,20 @@
{% extends 'partials/base.html.twig' %}
{% block titlebar %}
<h1><i class="fa fa-fw fa-exclamation-triangle"></i> {{ "PLUGIN_ADMIN.ERROR"|tu }}</h1>
{% endblock %}
{% block content %}
<div class="error-block">
<h1>Error {{ page.header.http_response_code }}</h1>
<div class="padding">
<p>
{{ page.content|raw }}
</p>
</div>
</div>
{% endblock %}
{% block footer_section %}
<br /><br /><br />
{% endblock %}
@@ -0,0 +1 @@
{{ content|json_encode|raw }}
@@ -0,0 +1,17 @@
{% embed 'partials/login.html.twig' with {title:'Grav Forgot Password'} %}
{% block form %}
{% for field in form.fields %}
{% if field.type %}
<div>
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
<div class="form-actions primary-accent">
<button type="submit" class="button primary" name="task" value="forgot"><i class="fa fa-paper-plane"></i> {{ "PLUGIN_ADMIN.LOGIN_BTN_SEND_INSTRUCTIONS"|tu }}</button>
</div>
{% endblock %}
{% endembed %}
@@ -0,0 +1,114 @@
{% if not field.validate.ignore %}
{% 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 %}
{% set isDisabledToggleable = field.toggleable and not toggleableChecked %}
{% set value = value ?? field.default %}
{% if (field.yaml or field.validate.type == 'yaml') and value is iterable%}
{% set value = value|toYaml %}
{% endif %}
{% endif %}
{% set vertical = field.style == 'vertical' %}
{% set field_name = (scope ~ field.name)|fieldName %}
{% block field %}
<div class="form-field grid{% if vertical %} vertical{% endif %}{% if field.toggleable %} form-field-toggleable{% endif %} {{ field.outerclasses }} {{ field.field_classes }}">
{% block contents %}
<div class="form-label{% if not vertical %} block size-1-3{% endif %}">
{% if field.toggleable %}
<span class="checkboxes toggleable" data-grav-field="toggleable" data-grav-field-name="{{ field_name }}">
<input type="checkbox"
id="toggleable_{{ field.name }}"
{% if toggleableChecked %}value="1"{% endif %}
name="toggleable_{{ field_name }}"
{% if toggleableChecked %}checked="checked"{% endif %}
>
<label for="toggleable_{{ field.name }}"></label>
</span>
{% endif %}
<label{{ (field.toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
{% block label %}
{% if field.help %}
{% if field.markdown %}
<span class="hint--bottom" data-hint="{{ field.help|tu|markdown(false)|e('html') }}">{{ field.label|tu|markdown(false)|raw }}</span>
{% else %}
<span class="hint--bottom" data-hint="{{ field.help|tu|e('html') }}">{{ field.label|tu|raw }}</span>
{% endif %}
{% else %}
{% if field.markdown %}
{{ field.label|tu|markdown(false)|raw }}
{% else %}
{{ field.label|tu|raw }}
{% endif %}
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
{% endblock %}
</label>
{% if field.sublabel %}
<div class="form-sublabel">
{% if field.markdown %}
{{ field.sublabel|tu|markdown(false)|raw }}
{% else %}
{{ field.sublabel|tu|raw }}
{% endif %}
</div>
{% endif %}
</div>
<div class="form-data{% if not vertical %} block size-2-3{% endif %}"
{% block global_attributes %}
data-grav-field="{{ field.type }}"
data-grav-disabled="{{ toggleableChecked }}"
data-grav-default="{{ field.default|json_encode|e('html_attr') }}"
{% endblock %}
>
{% block group %}
{% block input %}
<div class="form-input-wrapper {{ field.size }} {{ field.wrapper_classes }}">
{% block prepend %}{% endblock prepend %}
<input
{# required attribute structures #}
name="{{ field_name }}"
value="{{ value|join(',') }}"
{% if field.key %}
data-key-observe="{{ (scope ~ field_name)|fieldName }}"
{% endif %}
{# input attribute structures #}
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.placeholder %}placeholder="{{ field.placeholder|tu }}"{% endif %}
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
{% if field.autocomplete is defined %}autocomplete="{{ field.autocomplete }}"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.validate.pattern %}pattern="{{ field.validate.pattern }}"{% endif %}
{% if field.validate.message %}title="{{ field.validate.message|e|tu }}"
{% elseif field.title is defined %}title="{{ field.title|e|tu }}" {% endif %}
{% endblock %}
/>
{% block append %}{% endblock append %}
</div>
{% endblock %}
{% endblock %}
{% if field.description %}
<div class="form-extra-wrapper {{ field.wrapper_classes }}">
<span class="form-description">
{% if field.markdown %}
{{ field.description|tu|markdown(false)|raw }}
{% else %}
{{ field.description|tu|raw }}
{% endif %}
</span>
</div>
{% endif %}
</div>
{% endblock %}
</div>
{% endblock %}
{% endif %}
@@ -0,0 +1,96 @@
{% extends "forms/field.html.twig" %}
{% macro renderer(key, text, field, scope) %}
{% if text is not iterable %}
<div class="form-row{% if field.value_only %} array-field-value_only{% endif %}"
data-grav-array-type="row">
<span data-grav-array-action="sort" class="fa fa-bars"></span>
{% if field.value_only != true %}
{% if key == '0' and text == '' %}
{% set key = '' %}
{% endif %}
<input
data-grav-array-type="key"
type="text" value="{{ key }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
placeholder="{{ field.placeholder_key|e|tu }}" />
{% endif %}
{% if field.value_type == 'textarea' %}
<textarea
data-grav-array-type="value"
name="{{ ((scope ~ field.name)|fieldName) ~ '[' ~ key ~ ']' }}"
placeholder="{{ field.placeholder_value|e|tu }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}>{{ text }}</textarea>
{% else %}
<input
data-grav-array-type="value"
type="text"
name="{{ ((scope ~ field.name)|fieldName) ~ '[' ~ key ~ ']' }}"
placeholder="{{ field.placeholder_value|e|tu }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
value={% if text == 'true' %}true{% elseif text == 'false' %}false{% else %}"{{ text|join(', ')|e }}"{% endif %} />
{% endif %}
<span data-grav-array-action="rem" class="fa fa-minus"></span>
<span data-grav-array-action="add" class="fa fa-plus"></span>
</div>
{% endif %}
{% endmacro %}
{% import _self as array_field %}
{% block global_attributes %}
data-grav-array-name="{{ (scope ~ field.name)|fieldName }}"
data-grav-array-keyname="{{ field.placeholder_key|e|tu }}"
data-grav-array-valuename="{{ field.placeholder_value|e|tu }}"
data-grav-array-textarea="{{ field.value_type == 'textarea' }}"
{{ parent() }}
{% endblock %}
{% block input %}
<div class="{{ field.size }}" data-grav-array-type="container"{% if field.value_only %} data-grav-array-mode="value_only"{% endif %}{{ value|length <= 1 ? ' class="one-child"' : '' }}>
{% if value|length %}
{% for key, text in value -%}
{% if text is not iterable %}
{{ array_field.renderer(key, text, field, scope) }}
{% else %}
{# Backward compatibility for nested arrays (metas) which are not supported anymore #}
{% for subkey, subtext in text -%}
{{ array_field.renderer(key ~ '[' ~ subkey ~ ']', subtext, field, scope) }}
{% endfor %}
{% endif %}
{% endfor %}
{%- else -%}
{# Empty value, mock the entry field#}
<div class="form-row" data-grav-array-type="row">
<span data-grav-array-action="sort" class="fa fa-bars"></span>
{% if field.value_only != true %}
<input
data-grav-array-type="key"
type="text"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
placeholder="{{ field.placeholder_key|e|tu }}" />
{% endif %}
{% if field.value_type == 'textarea' %}
<textarea
data-grav-array-type="value"
name="{{ (scope ~ field.name)|fieldName }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
placeholder="{{ field.placeholder_value|e|tu }}"></textarea>
{% else %}
<input
data-grav-array-type="value"
type="text"
name="{{ (scope ~ field.name)|fieldName }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
placeholder="{{ field.placeholder_value|e|tu }}" />
{% endif %}
<span data-grav-array-action="rem" class="fa fa-minus"></span>
<span data-grav-array-action="add" class="fa fa-plus"></span>
</div>
{%- endif %}
</div>
{% endblock %}
@@ -0,0 +1,32 @@
{% set delete_url = uri.addNonce(base_url_relative ~ "/backup.json/backup:%BACKUP_FILE/task" ~ config.system.param_sep ~ 'backupDelete', 'admin-form', 'admin-nonce') %}
<table class="backups-history noflex">
<thead>
<tr>
<th>#</th>
<th>{{ "PLUGIN_ADMIN.BACKUP_DATE"|tu }}</th>
<th>{{ "PLUGIN_ADMIN.NAME"|tu }}</th>
<th class="right pad">{{ "PLUGIN_ADMIN.SIZE"|tu }}</th>
<th class="right pad">{{ "PLUGIN_ADMIN.ACTION"|tu }}</th>
</tr>
</thead>
<tbody>
{% for backup in backups|default([]) %}
{% set encoded_name = backup.filename|base64_encode|url_encode %}
{% set backup_delete = delete_url|replace({'%BACKUP_FILE': encoded_name}) %}
<tr>
<td>{{ loop.index }}</td>
<td> <i class="fa fa-clock-o"></i> {{ backup.date|date }}</td>
<td>{{ backup.title }}</td>
<td class="right pad">{{ backup.size|nicefilesize }}</td>
<td class="right pad nowrap" >
<a class="button button-small hint--bottom" href="{{ grav.backups.getBackupDownloadUrl(backup.path, admin.base) }}" data-hint="Download"><i class="fa fa-download"></i></a>
<span class="button button-small danger hint--bottom" data-hint="Delete" data-backup data-ajax="{{ backup_delete }}"><i class="fa fa-close"></i></span>
</td>
</tr>
{% else %}
<tr>
<td colspan="5" class="error" style="text-align: center;">{{ "PLUGIN_ADMIN.BACKUPS_NOT_GENERATED"|tu }}</td>
</tr>
{% endfor %}
</tbody>
</table>
@@ -0,0 +1,12 @@
{% extends "forms/field.html.twig" %}
{% block field %}
<input
data-grav-field="hidden"
data-grav-disabled="false"
type="hidden"
class="input"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ blueprints.name }}" />
{% endblock %}
@@ -0,0 +1,38 @@
{% extends "forms/field.html.twig" %}
{% set originalValue = originalValue is defined ? originalValue : value %}
{% set value = (value is null ? field.default : value) %}
{% set pattern = '^#([a-fA-F0-9]{6})|(rgba\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*((0.[0-9]+)|(1.00)|1.0|1)\\s*\\))$' %}
{% block input %}
<div class="form-list-wrapper {{ field.size }}" data-type="collection">
<div class="g-colorpicker">
<input
data-grav-colorpicker="{{ {update: '.g-colorpicker-preview-wrap .g-colorpicker-preview'}|json_encode|e('html_attr') }}"
{# required attribute structures #}
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ value|raw|join(', ') }}"
type="text"
{# input attribute structures #}
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.disabled %}disabled="disabled"{% endif %}
{% if field.placeholder %}placeholder="{{ field.placeholder }}"{% endif %}
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
{% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
pattern="{{ field.validate.pattern|default(pattern)|raw }}"
{% if field.validate.message %}title="{{ field.validate.message|e|t }}"
{% elseif field.title is defined %}title="{{ field.title|e|t }}" {% endif %}
{% endblock %}
/>
<div class="g-colorpicker-preview-wrap">
<div class="g-colorpicker-preview" style="background-color: {{ value|e }}"></div>
</div>
</div>
</div>
{% endblock %}
@@ -0,0 +1,14 @@
{% extends "forms/field.html.twig" %}
{% block field %}
{% if field.fields %}
<div class="form-column block pure-u-1-{{ cols }}">
{% for child in field.fields %}
{% if child.type and not child.validate.ignore %}
{% set value = child.name ? data.value(child.name) : data.toArray %}
{% include ["forms/fields/#{child.type}/#{child.type}.html.twig", 'forms/fields/text/text.html.twig'] with {field: child} %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endblock %}
@@ -0,0 +1,12 @@
{% extends "forms/field.html.twig" %}
{% block field %}
<div class="form-columns grid pure-g">
{% if field.fields %}
{% set cols = field.fields|length %}
{% for child in field.fields %}
{% include ["forms/fields/#{child.type}/#{child.type}.html.twig", 'forms/fields/column/column.html.twig'] with {field: child, cols: cols} %}
{% endfor %}
{% endif %}
</div>
{% endblock %}
@@ -0,0 +1,6 @@
{% extends "forms/field.html.twig" %}
{% block input %}
<input type="hidden" class="input" name="{{ (scope ~ field.name)|fieldName }}" value="{{ value|join(', ') }}" />
<div class="cron-selector"></div>
{% endblock %}
@@ -0,0 +1,71 @@
{% set jobs = grav.scheduler.getAllJobs() %}
{% set job_states = grav.scheduler.getJobStates().content() %}
<table class="cron-status noflex">
<thead>
<tr>
<th style="flex:3;">Job ID</th>
<th style="flex:3;">Run</th>
<th>Status</th>
<th class="right pad">State</th>
</tr>
</thead>
<tbody>
{% for job in jobs %}
{% set job_status = attribute(data.status,job.id) %}
{% set job_enabled = job_status is defined and job_status == 'disabled' ? 0 : 1 %}
{% set job_id = job.id %}
{% set job_id_md5 = job_id|md5 %}
{% set job_state = attribute(job_states, job_id) %}
{% set job_at = job.getAt|default('* * * * *') %}
{% set job_backlink = job.backlink %}
<tr>
<td style="flex:3;overflow:hidden;">
{% if job_backlink %}
<a href="{{ base_url_relative ~ job_backlink }}"><kbd>{{ job.id }}</kbd></a>
{% else %}
<kbd>{{ job.id }}</kbd>
{% endif %}
</td>
<td style="flex:3;" class="cron-at">
{% if job_enabled %}
<span class="hint--bottom" data-hint="next run: {{ cron(job_at).getNextRunDate()|date(config.date_format.default) }}">{{ job_at|nicecron }}</span>
{% else %}
{{ job_at|nicecron }}
{% endif %}
</td>
<td>
{% if job_state.state == 'failure' %}
{% set run_type = 'error' %}
{% set run_hint = job_state.error %}
{% set run_text = "<i class=\"fa fa-warning\"></i> Failure" %}
{% else %}
{% set run_type = 'info' %}
{% if job_state.state is not defined %}
{% set run_hint = "not run yet" %}
{% set run_text = "<i class=\"fa fa-check\"></i> Ready" %}
{% else %}
{% set run_hint = "last run: " ~ attribute(job_state,'last-run')|date(config.date_format.default) %}
{% set run_text = "<i class=\"fa fa-check\"></i> Success" %}
{% endif %}
{% endif %}
<span class="hint--bottom" data-hint="{{ run_hint }}">
<span class="badge {{ run_type }}">{{ run_text|raw }}</span>
</span>
</td>
<td class="right pad">
<div class="form-data" data-grav-field="toggle" data-grav-disabled="" data-grav-default="null" data-grav-field-name="data[status][{{ job_id }}]">
<div class="switch-toggle switch-grav switch-2 ">
<input type="radio" value="enabled" id="toggle_status.{{ job_id_md5 }}1" name="data[status][{{ job_id }}]" class="highlight" {% if job_enabled %}checked="checked"{% endif %}>
<label for="toggle_status.{{ job_id_md5 }}1">Enabled</label>
<input type="radio" value="disabled" id="toggle_status.{{ job_id_md5 }}0" name="data[status][{{ job_id }}]" class="" {% if not job_enabled %}checked="checked"{% endif %}>
<label for="toggle_status.{{ job_id_md5 }}0">Disabled</label>
</div>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
@@ -0,0 +1,24 @@
{% extends "forms/field.html.twig" %}
{% block global_attributes %}
data-grav-selectize="{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}"
data-grav-field="select"
{{ parent() }}
{% endblock %}
{% block input %}
<div class="form-select-wrapper {{ field.size }}">
<select class="{{ field.classes }}" name="{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}"
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.multiple in ['on', 'true', 1] %}multiple="multiple"{% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.form %}form="{{ field.form }}"{% endif %}
>
{% for key, text in field.options %}
<option {% if key == value or text in value %}selected="selected"{% endif %} value="{{ field.multiple ? text : key }}">{{ key is empty ? text : "now"|date(key)|e }}</option>
{% endfor %}
</select>
</div>
{% endblock %}
@@ -0,0 +1,26 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default : value) %}
{% set default_php_dateformat = admin.guessDateFormat(value) %}
{% set php_dateformat = field.format ?: admin.page.dateformat ?: config.system.pages.dateformat.default ?: default_php_dateformat %}
{% set js_dateformat = admin.dateformatToMomentJS(php_dateformat) %}
{% set value = (value is null ? value : value|date(php_dateformat)) %}
{% block input %}
<div class="form-input-wrapper datetime-picker-wrapper {{ field.size }}">
<input
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ value|raw|join(', ') }}"
{% block input_attributes %}
type="text"
data-grav-datetime="{{ {'format': js_dateformat} | json_encode | e('html_attr') }}"
{% if field.validate.min %}min="{{ (field.validate.min is null ? field.validate.min : field.validate.min|date(php_dateformat)) }}"{% endif %}
{% if field.validate.max %}max="{{ (field.validate.max is null ? field.validate.max : field.validate.max|date(php_dateformat)) }}"{% endif %}
{{ parent() }}
{% endblock %}
/>
<span class="field-icons">
<i class="fa fa-fw fa-calendar"></i>
</span>
</div>
{% endblock %}
@@ -0,0 +1,53 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default|tu : value) %}
{% if not codemirrorOptions %}
{% set codemirrorOptions = {'mode': 'gfm', 'ignore': ['code', 'preview']}|merge(field.codemirror|default({})) %}
{% endif %}
{% block field %}
{% block label %}
{% if field.label %}
{% 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 }}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</div>
{% endif %}
{% endblock %}
<div class="form-field {{ field.classes|default('') }}">
<div class="form-data grav-editor">
<div class="grav-editor-content is-active">
<textarea
data-grav-editor="{{ {'codemirror': codemirrorOptions} | json_encode|e('html_attr') }}"
data-grav-editor-mode="editor"
name="{{ (scope ~ field.name)|fieldName }}"
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.placeholder %}placeholder="{{ field.placeholder|tu }}"{% endif %}
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if 'preview' not in codemirrorOptions.ignore %}data-grav-urlpreview="{{ base_url }}/media/{{ admin.route|trim('/') }}.json"{% endif %}
>{{ value|join("\n")|e('html') }}</textarea>
</div>
{% if field.resizer is not defined or field.resizer not in ['off', 'false', 0] %}<div class="grav-editor-resizer"></div>{% endif %}
{% if field.description %}
<div class="form-extra-wrapper {{ field.size }} {{ field.wrapper_classes }}">
<span class="form-description">
{% if field.markdown %}
{{ field.description|tu|markdown(false)|raw }}
{% else %}
{{ field.description|tu|raw }}
{% endif %}
</span>
</div>
{% endif %}
</div>
</div>
{% endblock %}
@@ -0,0 +1,99 @@
{% extends "forms/field.html.twig" %}
{% block field %}
<div class="form-fieldset{% if vertical %} vertical{% endif %}{% if field.classes is defined %} {{ field.classes }}{% endif %}">
{% block contents %}
<input type="checkbox" class="hidden" id="fieldset_collapsible_{{ field.name }}"{% if not field.collapsible or not field.collapsed %} checked="checked"{% endif %} />
<div class="form-label form-fieldset--label">
<h2>
<label{% if field.collapsible %} for="fieldset_collapsible_{{ field.name }}" class="form-fieldset--cursor"{% endif %}>
{% if field.help %}
<span class="hint--bottom" data-hint="{{ field.help|e|tu }}">
{% endif %}
{% block label %}
{% if field.icon %}
<i class="fa fa-fw fa-{{ field.icon }}"></i>
{% endif %}
{{ field.title|tu }}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
{% if field.info %}
<span class="form-fieldset--info">{{ field.info|tu }}</span>
{% endif %}
{% endblock %}
{% if field.help %}
</span>
{% endif %}
{# Actions panel #}
<span class="actions">
{% block actions %}
{% if field.collapsible %}
<span class="form-fieldset--collapsible">
<i class="fa fa-chevron-down open"></i>
<i class="fa fa-chevron-up close"></i>
</span>
{% endif %}
{% endblock %}
</span>
</label>
</h2>
</div>
<div class="form-data"
{#{% block global_attributes %}
data-grav-field="{{ field.type }}"
data-grav-disabled="{{ originalValue is null ? 'true' : 'false' }}"
data-grav-default="{{ field.default|json_encode()|e('html_attr') }}"
{% endblock %}#}
>
{% block group %}
{% 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 %}
{% for childName, child in field.fields %}
{%- if childName == 'value' -%}
{% set childKey = '' %}
{% set childName = itemName -%}
{%- elseif childName starts with '.' -%}
{% set childKey = childName|trim('.') %}
{% set childName = itemName ~ childName %}
{% else %}
{% set childKey = childName %}
{% set childName = childName|replace({'*': key}) %}
{% endif %}
{% set child = child|merge({ name: childName }) %}
{% if child.type == 'key' %}
{%
include 'forms/fields/key/key.html.twig'
with { field: child, value: key }
%}
{% elseif child.key == true %}
{% include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/key/key.html.twig'
] with { field: child, value: key }
%}
{% elseif child.type %}
{% set originalValue = data.value(child.name) %}
{%
include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/text/text.html.twig'
] with { field: child, value: data.value(child.name) }
%}
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
@@ -0,0 +1,116 @@
{% extends "forms/field.html.twig" %}
{% macro bytesToSize(bytes) -%}
{% spaceless %}
{% set kilobyte = 1024 %}
{% set megabyte = kilobyte * 1024 %}
{% set gigabyte = megabyte * 1024 %}
{% set terabyte = gigabyte * 1024 %}
{% if bytes < kilobyte %}
{{ bytes ~ ' B' }}
{% elseif bytes < megabyte %}
{{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }}
{% elseif bytes < gigabyte %}
{{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }}
{% elseif bytes < terabyte %}
{{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }}
{% else %}
{{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }}
{% endif %}
{% endspaceless %}
{%- endmacro %}
{% macro preview(path, value, global) %}
{% if value %}
{% set uri = global.grav.uri %}
{% set files = global.files %}
{% set config = global.grav.config %}
{% set route = global.context.route() %}
{% set type = global.blueprint_type ? global.blueprint_type : global.admin.location ? global.admin.location : 'config' %}
{% set blueprint_name = global.blueprints.getFilename %}
{% if type == 'pages' %}
{% set blueprint_name = type ~ '/' ~ blueprint_name %}
{% endif %}
{% set blueprint = base64_encode(blueprint_name) %}
{% set real_path = value.thumb ?? global.context.media[path].relativePath ?? global.form.getPagePathFromToken(path) ?? global.admin.getPagePathFromToken(path) %}
{% set remove = global.file_task_remove ? global.file_url_remove : uri.addNonce(
global.file_url_remove ~
'/media.json' ~
'/route' ~ config.system.param_sep ~ base64_encode(global.base_path ~ '/' ~ real_path) ~
'/task' ~ config.system.param_sep ~ 'removeFileFromBlueprint' ~
'/proute' ~ config.system.param_sep ~ base64_encode(route) ~
'/blueprint' ~ config.system.param_sep ~ blueprint ~
'/type' ~ config.system.param_sep ~ type ~
'/field' ~ config.system.param_sep ~ files.name ~
'/path' ~ config.system.param_sep ~ base64_encode(value.path), 'admin-form', 'admin-nonce') %}
{% set file = value|merge({remove: remove, path: value.thumb_url ?? (uri.rootUrl == '/' ? '/' : uri.rootUrl ~ '/' ~ real_path) }) %}
<div class="hidden" data-file="{{ file|json_encode|e('html_attr') }}"></div>
{% endif %}
{% endmacro %}
{% import _self as macro %}
{% set defaults = config.plugins.form %}
{% set files = defaults.files|merge(field|default([])) %}
{% set limit = not field.multiple ? 1 : files.limit %}
{% block input %}
{% set page_can_upload = exists or (type == 'page' and not exists and not (field.destination starts with '@self' or field.destination starts with 'self@')) %}
{% if form or (type is not defined or page_can_upload) %}
{% block prepend %}{% endblock %}
{% set settings = {name: field.name, paramName: (scope ~ field.name)|fieldName ~ (files.multiple ? '[]' : ''), limit: limit, filesize: form_max_filesize, accept: files.accept, resolution: files.resolution, resizeWidth: files.resizeWidth, resizeHeight: files.resizeHeight, resizeQuality: files.resizeQuality } %}
{% set dropzoneSettings = field.dropzone %}
{% if form.getMediaTaskRoute() %}
{% set file_url_add = base_url_relative ~ form.getMediaTaskRoute({}, 'json') %}
{% set file_task_add = {task: 'media.upload', name: field.name, '__form-name__': form.name, '__unique_form_id__': form.uniqueid} %}
{% set file_url_remove = base_url_relative ~ form.getMediaTaskRoute({}, 'json') %}
{% set file_task_remove = {task: 'media.delete', name: field.name, '__form-name__': form.name, '__unique_form_id__': form.uniqueid} %}
{% else %}
{% set file_url_remove = file_url_remove ?: base_url_relative %}
{% endif %}
<div class="{{ form_field_wrapper_classes ?: 'form-input-wrapper' }} {{ field.classes }} dropzone files-upload {% if field.fancy is not same as(false) %}form-input-file{% endif %} {{ field.size }}"
data-grav-file-settings="{{ settings|json_encode|e('html_attr') }}"
data-dropzone-options="{{ dropzoneSettings|json_encode|e('html_attr') }}"
{% if file_task_add and file_task_remove %}
data-file-post-add="{{ file_task_add|json_encode|e('html_attr') }}"
data-file-post-remove="{{ file_task_remove|json_encode|e('html_attr') }}"
data-file-url-add="{{ file_url_add }}"
data-file-url-remove="{{ file_url_remove }}"
{% else %}
{% if file_url_add %}data-file-url-add="{{ file_url_add }}"{% endif %}
{% if file_url_remove %}data-file-url-remove="{{ file_url_remove }}"{% endif %}
{% endif %}
>
{% block file_extras %}{% endblock %}
<input
{# required attribute structures #}
{% block input_attributes %}
type="file"
{% if files.multiple %}multiple="multiple"{% endif %}
{% if files.accept %}accept="{{ files.accept|join(',') }}"{% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.random_name %}random="true"{% endif %}
{% if required %}required="required"{% endif %}
{{ parent() }}
{% endblock %}
/>
{% for path, file in value %}
{{ macro.preview(path, file, _context) }}
{% endfor %}
{% include 'forms/fields/hidden/hidden.html.twig' with {field: {name: '_json.' ~ field.name}, value: (value ?? [])|json_encode} %}
</div>
{% else %}
<span class="note">{{ "PLUGIN_ADMIN.CANNOT_ADD_FILES_PAGE_NOT_SAVED"|tu|raw }}</span>
{% endif %}
{% endblock %}
@@ -0,0 +1,17 @@
{% embed "forms/fields/select/select.html.twig" %}
{% block input %}
{% if not field.options and value %}
{% set field = field|merge({options: {(value): value}}) %}
{% endif %}
{{ parent() }}
{% endblock %}
{% block global_attributes %}
data-grav-filepicker
data-name="{{field.name}}"
{% if field.preview_images %}data-preview-images{% endif %}
data-value="{{value}}"
{{ parent() }}
{% endblock %}
{% endembed %}
@@ -0,0 +1,10 @@
{# Deprecated field. Alias to editor/editor.html.twig #}
{% extends "forms/fields/editor/editor.html.twig" %}
{% set codemirrorOptions = {'mode': 'yaml', 'indentUnit': 4, ignore: ['code'], 'autofocus': true, 'indentWithTabs': false, 'lineNumbers': true, 'gutters': ["CodeMirror-lint-markers"]}|merge(field.codemirror|default({})) %}
{# backward compatibility #}
{% if field.showPreview %}
{% set codemirrorOptions = codemirrorOptions|merge({'ignore': []}) %}
{% endif %}
{# end backward compatibility #}
@@ -0,0 +1,45 @@
{% extends "forms/field.html.twig" %}
{% set originalValue = originalValue is defined ? originalValue : value %}
{% set value = (value is null ? field.default : value) %}
{% block global_attributes %}
data-grav-iconpicker
data-name="{{field.name}}"
data-value="{{value}}"
{{ parent() }}
{% endblock %}
{% block input %}
<div class="form-list-wrapper {{ field.size }}" data-type="collection">
<div class="icon-picker" data-pickerid="fa" data-iconsets='{"fa":"FontAwesome Icons"}'>
<input
{# required attribute structures #}
name="{{ (scope ~ field.name)|fieldName }}"
data-format="{{ field.format == 'short' ? 'short' : 'long' }}"
value="{{ value|raw|join(', ') }}"
type="text"
{# input attribute structures #}
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.disabled %}disabled="disabled"{% endif %}
{% if field.placeholder %}placeholder="{{ field.placeholder }}"{% endif %}
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
{% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% endblock %}
/>
</div>
<div class="fa-set icon-set">
<ul>
{% for icon in fa_icons %}
<li data-code="{{icon.unicode}}" data-class="fa fa-{{icon.id}}" class="fa fa-{{icon.id}}"></li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,195 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default : value) %}
{% set name = field.name %}
{% set btnLabel = field.btnLabel is defined ? field.btnLabel : "PLUGIN_ADMIN.ADD_ITEM" %}
{% set btnSortLabel = field.btnSortLabel is defined ? field.btnSortLabel : "PLUGIN_ADMIN.SORT_BY" %}
{% set fieldControls = field.controls|default('bottom') %}
{% block contents %}
<div class="form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}">
{% if field.toggleable %}
<span class="checkboxes toggleable" data-grav-field="toggleable" data-grav-field-name="{{ (scope ~ field.name)|fieldName }}">
<input type="checkbox"
id="toggleable_{{ field.name }}"
{% if toggleableChecked %}value="1"{% endif %}
name="toggleable_{{ (scope ~ field.name)|fieldName }}"
{% if toggleableChecked %}checked="checked"{% endif %}
>
<label for="toggleable_{{ field.name }}"></label>
</span>
{% endif %}
<label{{ (field.toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
{% if field.help %}
<span class="hint--bottom" data-hint="{{ field.help|e|tu }}">{{ field.label|tu }}</span>
{% else %}
{{ field.label|tu }}
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</label>
</div>
<div class="form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}"
{% block global_attributes %}
data-grav-field="{{ field.type }}"
data-grav-disabled="{{ toggleableChecked }}"
data-grav-default="{{ field.default|json_encode|e('html_attr') }}"
{% endblock %}
>
<div class="form-list-wrapper {{ field.size }}" data-type="collection"
{% if field.selectunique %}
data-select-unique="{{ field.selectunique|json_encode|e('html_attr') }}"
data-max="{{ field.selectunique|length }}"
{% endif %}
{% if field.min is defined %}data-min="{{ field.min }}"{% endif %}
{% if field.max is defined and not field.selectunique %}data-max="{{ field.max }}"{% endif %}
>
{% if fieldControls in ['top', 'both'] %}
<div class="collection-actions">
{% if collapsible %}
<button class="button" type="button" data-action="expand_all"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-down"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|e|tu }}</button>
<button class="button" type="button" data-action="collapse_all"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-right"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|e|tu }}</button>
{% endif %}
{% if field.sortby %}
<button class="button{{ not value|length ? ' hidden' : '' }}" type="button" data-action="sort" data-action-sort="{{ field.sortby }}" data-action-sort-dir="{{ field.sortby_dir|default('asc') }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
{% endif %}
<button class="button" type="button" data-action="add" data-action-add="bottom"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-plus"></i> {{ btnLabel|e|tu }}</button>
</div>
{% endif %}
<ul {% if field.classes is defined %}class="{{ field.classes }}"{% endif %} data-collection-holder="{{ name }}"
{% if field.sort is same as(false) %}
data-collection-nosort
{% endif %}>
{% if field.fields %}
{% set collapsible = field.fields|length > 1 and (field.collapsible is not defined or field.collapsible) %}
{% for key, val in value %}
{% set itemName = name ? name ~ '.' ~ key : key %}
<li data-collection-item="{{ itemName }}" data-collection-key="{{ key }}" class="{{ collapsible and field.collapsed ? 'collection-collapsed' : '' }}">
<div class="collection-sort"><i class="fa fa-fw fa-bars"></i></div>
{% for childName, child in field.fields %}
{% set child = child|merge({ '_list_index': itemName }) %}
{%- if childName == 'value' -%}
{% set childKey = '' %}
{% set childValue = val %}
{% set childName = itemName -%}
{%- elseif childName starts with '.' -%}
{% set childKey = childName|trim('.') %}
{% set childValue = val|nested(childName) %}
{% set childName = itemName ~ childName %}
{% else %}
{% set childKey = childName %}
{% set childValue = data.value(scope ~ childName) %}
{% set childName = childName|replace({'*': key}) %}
{% endif %}
{% set child = child|merge({ name: childName }) %}
{% if child.type == 'key' %}
{%
include 'forms/fields/key/key.html.twig'
with { field: child, value: key }
%}
{% elseif child.key == true and child.type != 'list' %}
{% include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/key/key.html.twig'
] with { field: child, value: key }
%}
{% elseif child.type %}
{% set originalValue = childValue %}
{%
include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/text/text.html.twig'
] with { field: child, value: childValue }
%}
{% endif %}
{% endfor %}
<div class="item-actions">
{% if collapsible %}
<i class="fa fa-chevron-circle-{{ field.collapsed ? 'right' : 'down' }}" data-action="{{ field.collapsed ? 'expand' : 'collapse' }}"></i>
<br />
{% endif %}
<i class="fa fa-trash-o" data-action="delete"></i>
</div>
</li>
{% endfor %}
{% endif %}
</ul>
{% if fieldControls in ['bottom', 'both'] %}
<div class="collection-actions">
{% if collapsible %}
<button class="button" type="button" data-action="expand_all"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-down"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|e|tu }}</button>
<button class="button" type="button" data-action="collapse_all"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-right"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|e|tu }}</button>
{% endif %}
{% if field.sortby %}
<button class="button{{ not value|length ? ' hidden' : '' }}" type="button" data-action="sort" data-action-sort="{{ field.sortby }}" data-action-sort-dir="{{ field.sortby_dir|default('asc') }}"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
{% endif %}
<button class="button" type="button" data-action="add" data-action-add="bottom"
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-plus"></i> {{ btnLabel|e|tu }}</button>
</div>
{% endif %}
{%- set itemName = name ? name ~ '.*' : '*' -%}
<div style="display: none;" data-collection-template="new" data-collection-template-html="{%- filter replace({' ': ' ', '\n': ' '})|e('html_attr') -%}
<li data-collection-item="{{ itemName }}">
{% if field.sort is not same as(false) %}
<div class="collection-sort"><i class="fa fa-fw fa-bars"></i></div>
{% endif %}
{%- if field.fields -%}
{%- for childName, child in field.fields -%}
{%- if childName == 'value' -%}
{%- set childKey = '' -%}
{%- set childName = itemName -%}
{%- elseif childName starts with '.' -%}
{%- set childKey = childName|trim('.') -%}
{%- set childName = itemName ~ childName -%}
{%- else %}
{%- set childKey = childName -%}
{%- set childName = childName|replace({'*': key}) -%}
{%- endif %}
{%- set child = child|merge({ name: childName }) -%}
{%- if child.type == 'key' -%}
{%-
include 'forms/fields/key/key.html.twig'
with { field: child, value: null }
-%}
{%- elseif child.key == true -%}
{%-
include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/key/key.html.twig'
] with { field: child, value: null }
-%}
{%- elseif child.type -%}
{%-
include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/text/text.html.twig'
] with { field: child, value: null }
-%}
{%- endif -%}
{%- endfor %}
<div class="item-actions">
{% if collapsible %}
<i class="fa fa-chevron-circle-down" data-action="collapse"></i>
<br />
{% endif %}
<i class="fa fa-trash-o" data-action="delete"></i>
</div>
{%- endif -%}
</li>
{%- endfilter -%}"></div>
<div style="display: none;" data-collection-config="{{ name }}"></div>
</div>
</div>
{% endblock %}
@@ -0,0 +1,10 @@
{# Deprecated field. Alias to editor/editor.html.twig #}
{% extends "forms/fields/editor/editor.html.twig" %}
{% set codemirrorOptions = {'mode': 'gfm', 'ignore': []}|merge(field.codemirror|default({})) %}
{# backward compatibility #}
{% if field.showPreview %}
{% set codemirrorOptions = codemirrorOptions|merge({'ignore': []}) %}
{% endif %}
{# end backward compatibility #}
@@ -0,0 +1,20 @@
{% extends "forms/fields/text/text.html.twig" %}
{% set originalValue = value %}
{% set value = (value is null ? field.default : value) %}
{% set unique_identifier = random_string() %}
{% block global_attributes %}
{{ parent() }}
data-mediapicker-modal-trigger
data-grav-mediapicker-unique-identifier="{{ unique_identifier }}"
{% endblock %}
{% block contents %}
{{ parent() }}
<div class="remodal remodal-mediapicker" data-remodal-mediapicker data-remodal-unique-identifier="{{ unique_identifier }}" data-remodal-options="hashTracking: false">
{% include 'partials/media-list-wrapper.html.twig' with { is_modal: true } %}
</div>
{% endblock %}
@@ -0,0 +1,120 @@
{% extends "forms/field.html.twig" %}
{% macro renderer(key, content, field, scope, level, parent_key, up_level) %}
{% import _self as self %}
{% macro field(value, key, level, globalvars, disable_name, hidden) %}
{% set name = 'data[' ~ globalvars.field.name|replace({'.': ']['}) ~ ']' ~ key %}
<div class="form-row array-field-value_only js__multilevel-field {{ level == 0 ? 'top' : '' }}"
data-grav-array-type="row" {% if (hidden|default(false) == true) %}style="display: none"{% endif %}>
<input
type="text"
{% if (disable_name != true) %}name="{{ name }}"{% endif %}
data-attr-name="{{ name }}"
placeholder="{{ field.placeholder_value|e|tu }}"
style="margin-left: {{ level * 50 }}px"
value="{{ value }}" />
<span class="fa fa-minus js__remove-item"></span>
<span class="fa fa-plus js__add-sibling hidden" data-level="{{level}}"></span>
<span class="fa fa-plus-circle js__add-children hidden" data-level="{{level}}"></span>
</div>
{% endmacro %}
{% if level == 0 %}
{{ self.field(key, '', level, _context, true, (is_numeric(key) ? true : false)) }}
{% if content is not iterable %}
{% set level2 = level + 1 %}
<div class="children-wrapper">
<div class="element-wrapper">
{{ self.field(content, '[' ~ key ~ ']', level2, _context) }}
</div>
</div>
{% endif %}
{% endif %}
{% if up_level %}
{% set level = level + 1 %}
{% endif %}
<div class="children-wrapper">
{% set unique_child = (is_array(content) and content.length > 1) ? true : false %}
{% for inner_key, inner_content in content -%}
<div class="element-wrapper">
{% if not is_numeric(inner_key) %}
{% if (content|length > 1) %}
{{ self.field(inner_key, parent_key, level, _context, true) }}
{% else %}
{{ self.field(inner_key, parent_key, level, _context) }}
{% endif %}
{% set level2 = level + 1 %}
{% set up_level = true %}
{% else %}
{% set up_level = false %}
{% set level2 = level %}
{% endif %}
{% if inner_content is not iterable %}
{% if not is_numeric(inner_key) %}
<div class="children-wrapper">
<div class="element-wrapper">
{% endif %}
{% set last_key = (is_numeric(inner_key)) ? '' : inner_key %}
{{ self.field(inner_content, parent_key ~ '[' ~ inner_key ~ ']', level2, _context) }}
{% if not is_numeric(inner_key) %}
</div>
</div>
{% endif %}
{% else %}
{% set inner_parent_key = parent_key ~ '[' ~ inner_key ~ ']' %}
{{ self.renderer(inner_key, inner_content, field, scope, level, inner_parent_key, up_level) }}
{% endif %}
</div>
{% endfor %}
</div>
{% endmacro %}
{% import _self as macro %}
{% block global_attributes %}
data-grav-array-name="{{ (scope ~ field.name)|fieldName }}"
data-grav-array-keyname="{{ field.placeholder_key|e|tu }}"
data-grav-array-valuename="{{ field.placeholder_value|e|tu }}"
{{ parent() }}
{% endblock %}
{% block input %}
<div data-id="{{random_string()}}" data-grav-multilevel-field data-grav-array-type="container" data-grav-array-mode="value_only"{{ value|length <= 1 ? ' class="one-child"' : '' }}>
{% if value|length %}
{% for key, content in value -%}
<div class="element-wrapper">
{{ macro.renderer(key, content, field, scope, 0, '[' ~ key ~ ']', true) }}
</div>
{% endfor %}
{%- else -%}
{# Empty value, mock the entry field#}
<div class="element-wrapper">
<div class="form-row array-field-value_only js__multilevel-field"
data-grav-array-type="row">
<input
type="text"
name="{{ (scope ~ field.name)|fieldName }}"
placeholder="Enter value"
value="" />
<span class="fa fa-minus js__remove-item"></span>
<span class="fa fa-plus js__add-sibling hidden" data-level="0" ></span>
<span class="fa fa-plus-circle js__add-children hidden" data-level="0"></span>
</div>
</div>
{%- endif %}
</div>
{% endblock %}
@@ -0,0 +1,55 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default : value) %}
{% set siblings = context.parent.children %}
{% set canOrder = context.order %}
{% set vertical = field.style == 'vertical' %}
{% block field %}
<div class="form-field grid pure-g{% if vertical %} vertical{% endif %}">
<div class="form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}">
<label>
{% if field.help %}
<span class="tooltip" data-asTooltip-position="w" title="{{ field.help|e|tu }}">{{ field.label|tu }}</span>
{% else %}
{{ field.label|tu }}
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</label>
</div>
<div class="form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}">
<div class="form-order-wrapper {{ field.size }}">
<input
type="hidden"
data-order
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
name="{{ (scope ~ field.name)|fieldName }}"
value="" />
{% if not canOrder %}
<div class="notice">{{ "PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_PAGE_NO_PREFIX"|tu|raw }}</div>
{% endif %}
{% if siblings|length < 200 %}
{% set sortable_count = 0 %}
<ul id="ordering" class="orderable {{ field.classes }}">
{% for page in siblings if page.order %}
<li class="drag-handle" data-id="{{ page.slug }}" {{ page.slug == data.slug ? 'data-active-id' : ''}}><span class="page-order">{{ page.order }}</span> {{ page.title|e }} <a href="{{ getPageUrl(page) }}"><i class="fa fa-external-link"></i></a></li>
{% set sortable_count = loop.index %}
{% endfor %}
</ul>
{% if sortable_count < siblings|length %}
<label>{{ "PLUGIN_ADMIN.UNSORTABLE_PAGES"|tu }}</label>
<ul class="orderable disabled">
{% for page in siblings if not page.order %}
<li {{ page.slug == data.slug ? 'data-active-id' : ''}}>{{ page.title|e }} <a href="{{ getPageUrl(page) }}"><i class="fa fa-external-link"></i></a></li>
{% endfor %}
</ul>
{% endif %}
{% else %}
<div class="notice">{{ "PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS"|tu }}</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}
@@ -0,0 +1,58 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default : value) %}
{% block field %}
{% if context.folderExists %}
{% set pagemedia = config.get('plugins.admin.pagemedia') %}
{% set pagemedia_settings = {
resolution: {
min: {
width: pagemedia.res_min_width ?: null,
height: pagemedia.res_min_height ?: null
},
max: {
width: pagemedia.res_max_width ?: null,
height: pagemedia.res_max_height ?: null
}
},
resizeWidth: pagemedia.resize_width ?: null,
resizeHeight: pagemedia.resize_height ?: null,
resizeQuality: pagemedia.resize_quality ?: 0.8
} %}
{% set media_url = form.getMediaTaskRoute() ?: '/media/' ~ admin.route|trim('/') ~ '.json' %}
{% set media_local = form.getMediaRoute() ?: base_url_relative_frontend|rtrim('/') ~ '/' ~ admin.route|trim('/') %}
{% set media_path = url(context.relativePagePath) %}
{% set media_uri = context.mediaUri() %}
{% set dropzone_settings = { maxFilesize: form_max_filesize }|merge(pagemedia_settings) %}
<div class="form-field grid vertical {% if field.classes is defined %}{{ field.classes }}{% endif %}">
<div class="form-label">
<label>{{ field.label|tu }}</label>
</div>
<div class="form-data form-uploads-wrapper">
<div id="grav-dropzone"
class="dropzone"
data-media-url="{{ (base_url ~ media_url)|e('html_attr') }}"
data-media-local="{{ media_local|e('html_attr') }}"
data-media-path="{{ media_path|e('html_attr') }}"
data-media-uri="{{ media_uri|e('html_attr') }}"
data-dropzone-options="{{ dropzone_settings|json_encode|e('html_attr') }}"
data-dropzone-field="{{ (scope ~ field.name)|fieldName }}"></div>
{% if admin.session.expert == '0' %}
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{ value|e }}" />
{% endif %}
</div>
</div>
{% else %}
<div class="form-tab">
<div class="form-field">
<div class="form-label">
{{ "PLUGIN_ADMIN.CANNOT_ADD_MEDIA_FILES_PAGE_NOT_SAVED"|tu }}
</div>
</div>
</div>
{% endif %}
{% endblock %}
@@ -0,0 +1,2 @@
{% extends "forms/fields/filepicker/filepicker.html.twig" %}
@@ -0,0 +1,52 @@
{% extends "forms/field.html.twig" %}
{% macro page_options(globals, pages_list) %}
{% set field = globals.field %}
{% set value = globals.value %}
{% if field.options and depth == 0 %}
{% for key, value in field.options %}
<option value="{{ key|e('html_attr') }}">{{ value|t }}</option>
{% endfor %}
{% endif %}
{% for page_route, option in pages_list %}
<option {% if page_route == value or (field.multiple and page_route in value) %}selected="selected"{% endif %} value="{{ page_route }}">{{ option|raw }}</option>
{% endfor %}
{% endmacro %}
{% import _self as macro %}
{% block global_attributes %}
data-grav-selectize="{{ (field.selectize is defined ? field.selectize : {})|json_encode|e('html_attr') }}"
data-grav-field="select"
data-grav-disabled="{{ originalValue is null ? 'true' : 'false' }}"
data-grav-default="{{ field.default|json_encode|e('html_attr') }}"
{% endblock %}
{% block input %}
{% set start_page = field.start_route ? pages.find(field.start_route) : null %}
{% set show_all = field.show_all is same as(false) ? false : true %}
{% set show_fullpath = field.show_fullpath is same as(true) ? true : false %}
{% set show_slug = field.show_slug is same as(true) ? true : false %}
{% set show_modular = field.show_modular is same as(true) ? true : false %}
{% set limit_levels = field.limit_levels ?: false %}
{% set page_list = grav.pages.getList(start_page, 0, true, show_all, show_fullpath, show_slug, show_modular, limit_levels) %}
<div class="form-select-wrapper {{ field.size }}">
<select class="{{ field.classes }}" name="{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}"
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.multiple in ['on', 'true', 1] %}multiple="multiple"{% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
>
{% if field.show_root %}
<option value="/">/ (root)</option>
{% endif %}
{{ macro.page_options(_context, page_list) }}
</select>
</div>
{% endblock %}
@@ -0,0 +1,26 @@
{% extends "forms/fields/pages/pages.html.twig" %}
{% block input %}
{% set last_page_route = admin.page.getLastPageRoute %}
{% set show_slug_val = true %}
{% set show_fullpath_val = false %}
{% set show_all_val = true %}
{% set show_parents = config.get('plugins.admin.pages.show_parents') %}
{% if show_parents == 'folder' %}
{% set show_slug_val = false %}
{% elseif show_parents == 'fullpath' %}
{% set show_fullpath_val = true %}
{% endif %}
{% set limit_levels_val = config.get('plugins.admin.pages.parents_levels') %}
{% set show_modular_val = config.get('plugins.admin.pages.show_modular', true) %}
{% if show_modular_val == false %}
{% set show_all_val = false %}
{% endif %}
{% set defaults = {show_root:true, show_all:show_all_val, show_modular:show_modular_val, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route, limit_levels:limit_levels_val} %}
{% set field = field|merge(defaults) %}
{{ parent() }}
{% endblock %}
@@ -0,0 +1,70 @@
{% extends "forms/field.html.twig" %}
{% macro spanToggle(input, length) %}
{% set space = repeat('&nbsp;&nbsp;', (length - input|length) / 2) %}
{{ (space ~ input ~ space)|raw }}
{% endmacro %}
{% import _self as macro %}
{% set value = (value is null ? field.default : value) %}
{% set value = (value is same as(false) ? 0 : value) %}
{% block global_attributes %}
data-grav-disabled="{{ originalValue is null ? 'true' : 'false' }}"
data-grav-default="{{ field.default|json_encode()|e('html_attr') }}"
{% endblock %}
{% block input %}
<div class="permissions-container">
{% set permissions = admin.getPermissions %}
{% for index_existing_permission, value_existing_permission in value %}
{% for index_segment1, value_segment1 in value_existing_permission %}
{% set permissions = permissions|merge({ (index_existing_permission ~ "." ~ index_segment1): "boolean"}) %}
{% endfor %}
{% endfor %}
{% for permission, type in permissions %}
<div class="permission-container">
{% set permission_segments = permission|split('.') %}
{% set permission_value = value[permission_segments[0]][permission_segments[1]] %}
{% if permission_value in ['on', 'true', 1] %}
{% set permission_value = 'true' %}
{% endif %}
<input type="text" class="medium permission-value" value="{{ permission }}" />
<div class="switch-toggle switch-grav medium switch-3">
{% set options = { true: 'PLUGIN_ADMIN.YES', false: 'PLUGIN_ADMIN.NO', '': 'PLUGIN_ADMIN.NOT_SET' } %}
{% set maxLen = 0 %}
{% for value, text in options %}
{% set translation = grav.twig.twig.filters['tu'] is defined ? text|tu : text|t %}
{% set maxLen = max(translation|length, maxLen) %}
{% endfor %}
{% for key, text in options %}
{% set id = "toggle_" ~ field.name ~ "." ~ permission ~ key %}
{% set translation = (grav.twig.twig.filters['tu'] is defined ? text|tu : text|t)|trim %}
<input type="radio"
value="{{ key }}"
id="{{ id }}"
name="{{ (scope ~ field.name ~ "." ~ permission)|fieldName }}"
class="{{ 'true' == '' ~ key ? 'highlight' : '' }}"
{% if key|fieldName == '' ~ permission_value|fieldName %}
checked="checked"
{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
/>
<label for="{{ id }}">{{ (macro.spanToggle(translation, maxLen)|trim)|raw }}</label>
{% endfor %}
<a></a>
</div>
</div>
{% endfor %}
</div>
{% endblock %}
@@ -0,0 +1,42 @@
{% extends "forms/field.html.twig" %}
{% block input_attributes %}
type="range"
class="rangefield {% if field.classes is defined %}{{ field.classes }} {% endif %}"
{% if field.validate.min %}min="{{ field.validate.min }}"{% endif %}
{% if field.validate.max %}max="{{ field.validate.max }}"{% endif %}
{% if field.validate.step %}step="{{ field.validate.step }}"{% endif %}
{% if field.id is defined %}
id="range_{{ field.id|e|replace({'.': '_'}) }}"
oninput="number_{{ field.id|e|replace({'.': '_'}) }}_output.value = this.value"
{% else %}
id="range_{{ field.name|e|replace({'.': '_'}) }}"
oninput="number_{{ field.name|e|replace({'.': '_'}) }}_output.value = this.value"
{% endif %}
{{ parent() }}
{% endblock %}
{% block append %}
<input
type="number"
class="rangefield {% if field.classes is defined %}{{ field.classes }} {% endif %}"
{% if field.validate.min %}min="{{ field.validate.min }}"{% endif %}
{% if field.validate.max %}max="{{ field.validate.max }}"{% endif %}
{% if field.validate.step %}step="{{ field.validate.step }}"{% endif %}
{% if value %}
value="{{ value }}"
{% elseif field.default %}
value="{{ field.default }}"
{% else %}
value="0"
{% endif %}
{% if field.id is defined %}
id="number_{{ field.id|e|replace({'.': '_'}) }}_output"
oninput="range_{{ field.id|e|replace({'.': '_'}) }}.value = this.value"
{% else %}
id="number_{{ field.name|e|replace({'.': '_'}) }}_output"
oninput="range_{{ field.name|e|replace({'.': '_'}) }}.value = this.value"
{% endif %}
/>
<span class="range-append">{{ field.append }}</span>
{% endblock append %}
@@ -0,0 +1,26 @@
{% extends "forms/field.html.twig" %}
{% block field %}
{% if field.security is empty or authorize(array(field.security)) %}
{% if field.title or field.underline %}
<h1 class="{{ field.classes }} {{ field.underline ?: 'no_underline' }}">{% if grav.twig.twig.filters['tu'] is defined %}{{ field.title|tu }}{% else %}{{ field.title|t }}{% endif %}</h1>
{% endif %}
{% if field.text %}
<p>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.text|tu|raw }}{% else %}{{ field.text|t|raw }}{% endif %}</p>
{% endif %}
{% if field.fields %}
<div class="form-section {{ field.field_classes }} {{ field.outer_classes }}">
{% for field in field.fields %}
{% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endblock %}
@@ -0,0 +1,19 @@
{% extends "forms/field.html.twig" %}
{% block global_attributes %}
{% if field.selectize is defined %}
{% set fieldSelectize = field.selectize|merge({'create': true}) %}
{% if field.merge_items %}
{% set fieldSelectize = fieldSelectize|merge({'items':value}) %}
{% endif %}
{% else %}
{% set fieldSelectize = {'create': true} %}
{% endif %}
data-grav-selectize="{{ fieldSelectize|json_encode()|e('html_attr') }}"
{{ parent() }}
{% endblock %}
{% block input_attributes %}
type="text"
{{ parent() }}
{% endblock %}
@@ -0,0 +1,42 @@
{% extends "forms/field.html.twig" %}
{% block global_attributes %}
data-grav-selectize="{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}"
data-grav-field="select"
{{ parent() }}
{% endblock %}
{% block input %}
<div class="form-input-wrapper {{ field.size }}">
<select
value="{{ value|raw|join(', ') }}"
name="{{ (scope ~ field.name)|fieldName }}"
data-select-observe
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.placeholder %}placeholder="{{ field.placeholder }}"{% endif %}
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
{% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.validate.pattern %}pattern="{{ field.validate.pattern }}"{% endif %}
{% if field.validate.message %}title="{{ field.validate.message|e|t }}"
{% elseif field.title is defined %}title="{{ field.title|e|t }}" {% endif %}
{% endblock %}
>
{% if field.placeholder %}<option value="" disabled selected>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.placeholder|tu|raw }}{% else %}{{ field.placeholder|t|raw }}{% endif %}</option>{% endif %}
{% if value is defined %}
<option selected="selected" value="{{ value }}">{{ value }}</option>
{% endif %}
</select>
{% if field.default %}
<div><p class="notice warning">It is advised not to use a <strong>default</strong> option with the selectunique field. Currently default value set to `{{ field.default }}`</p></div>
{% endif %}
</div>
{% endblock %}
@@ -0,0 +1,30 @@
{% extends "forms/field.html.twig" %}
{% block field %}
{% set taxonomies = (taxonomies is null ? (field.taxonomies ? field.taxonomies : admin.data('config/site').taxonomies) : taxonomies) %}
{% set parentname = field.name %}
{% set options = field.options %}
{% set default = field.default %}
{% for name in taxonomies %}
{% set value = array(data.value('header.taxonomy.' ~ name)|default(default[name] ?? [])) %}
{% set sub_taxonomies = attribute(grav.taxonomy.taxonomy, name)|default([])|keys %}
{% set list = (options[name] ?? [])|merge(sub_taxonomies)|merge(value)|array_unique %}
{% set field = {
type: 'select',
classes: 'fancy create',
label: name|capitalize,
name: parentname ~ '.' ~ name,
multiple: true,
options: list,
style: field.style,
selectize: {
create: true
}
} %}
{% include ['forms/fields/select/select.html.twig'] %}
{% endfor %}
{% endblock %}
@@ -0,0 +1,31 @@
{% extends "forms/field.html.twig" %}
{% set options = {} %}
{% for slug, package in admin.themes %}
{% set option = {(slug): package.toArray().name} %}
{% set options = options|merge(option) %}
{% endfor %}
{% block global_attributes %}
data-grav-selectize="{{ (field.selectize is defined ? field.selectize : {})|json_encode()|e('html_attr') }}"
data-grav-field="select"
data-grav-disabled="{{ originalValue is null ? 'true' : 'false' }}"
data-grav-default="{{ field.default|json_encode()|e('html_attr') }}"
{% endblock %}
{% block input %}
<div class="form-select-wrapper {{ field.size }}">
<select class="{{ field.classes }}" name="{{ (scope ~ field.name)|fieldName ~ (field.multiple ? '[]' : '') }}"
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
{% if field.multiple in ['on', 'true', 1] %}multiple="multiple"{% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}>
{% for key, text in options %}
<option {% if key == value or text in value %}selected="selected"{% endif %} value="{{ field.multiple ? text : key }}">{{ text }}</option>
{% endfor %}
</select>
</div>
{% endblock %}
@@ -0,0 +1,19 @@
{% extends "forms/field.html.twig" %}
{% block field %}
<div class="form-field grid user-details">
<div class="form-label block size-1-3">
{% include 'partials/userinfo-avatar.html.twig' %}
</div>
<div class="form-data block size-2-3">
<h2>{{ data.fullname }}</h2>
<h5>
<a href="mailto:{{ data.email }}">{{ data.email }}</a>
{% if data.title %}
- {{ data.title }}
{% endif %}
</h5>
{% include 'partials/userinfo-avatar-credit.html.twig' %}
</div>
</div>
{% endblock %}
@@ -0,0 +1,6 @@
{% set xss_header = data.value('header')|array %}
{% set xss_content = data.value('content') %}
{% set xss_status = xss({header: xss_header, content: xss_content}) %}
{% if xss_status is not empty %}
<div class="notice alert">{{ "PLUGIN_ADMIN.XSS_ISSUE"|tu([xss_status])|raw }}</div>
{% endif %}
@@ -0,0 +1,13 @@
{% extends 'partials/base.html.twig' %}
{% block messages %}{% endblock %}
{% block content %}
<div class="admin-block">
<h1>
{{ "PLUGIN_ADMIN.INSTALLER"|tu }}
</h1>
{% include 'partials/messages.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,11 @@
{% set user = grav.user %}
{% if user.username and user.authenticated %}
{% if not user.authorized and user.twofa_enabled %}
{% include 'partials/login-twofa.html.twig' %}
{% else %}
{% include 'partials/login-logout.html.twig' %}
{% endif %}
{% else %}
{% include 'partials/login-form.html.twig' %}
{% endif %}
@@ -0,0 +1,19 @@
{% set index = uri.param('index') %}
{% for file in admin.files(true, index) %}
{% set the_file = file.file %}
{% if the_file.exists and the_file.display() is not empty %}
<div class="card-item">
<div class="admin-media-details">
<a href="{% if is_modal %}#{% else %}{{ base_url_relative }}/media-manager/{{base64_encode(the_file.filepath)}}{% endif %}" class="js__media-element" data-file-url="{{ file.page_route ~ '/' ~ file.title }}">
{% set thumbnail = the_file.display(the_file.extension == 'svg' ? 'source' : 'thumbnail') %}
{% if thumbnail %}
<img src="{{thumbnail.cropZoom(250, 250).url}}" />
<h4 class="admin-media-title">{{ file.title }}</h4>
{% endif %}
</a>
</div>
</div>
{% endif %}
{% endfor %}
@@ -0,0 +1,448 @@
{% extends 'partials/base.html.twig' %}
{% macro spanToggle(input, length) %}
{{ (repeat('&nbsp;&nbsp;', (length - input|length) / 2) ~ input ~ repeat('&nbsp;&nbsp;', (length - input|length) / 2))|raw }}
{% endmacro %}
{% macro loop(page, depth, twig_vars) %}
{% import _self as self %}
{% set config = twig_vars['config'] %}
{% set separator = config.system.param_sep %}
{% set display_field = config.plugins.admin.pages_list_display_field %}
{% set base_url = twig_vars['base_url_relative'] %}
{% set base_url_relative_frontend = twig_vars['base_url_relative_frontend'] %}
{% set base_url_simple = twig_vars['base_url_simple'] %}
{% set admin_route = twig_vars['admin_route'] %}
{% set admin_lang = twig_vars['admin_lang'] %}
{% set warn = twig_vars['warn'] %}
{% set uri = twig_vars['uri'] %}
{% if page.header.admin.children_display_order == 'collection' and page.header.content.order.by %}
{% if page.header.content.order.custom %}
{% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc'), page.header.content.order.custom) %}
{% else %}
{% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc')) %}
{% endif %}
{% else %}
{% set pcol = page.children() %}
{% endif %}
{% for p in pcol %}
{% set description = (not p.page ? "PLUGIN_ADMIN.FOLDER"|tu ~ ' &bull; ' : "PLUGIN_ADMIN.PAGE"|tu ~ ' &bull; ') ~
(p.modular ? "PLUGIN_ADMIN.MODULAR"|tu ~ ' &bull; ' : '') ~
(p.routable ? "PLUGIN_ADMIN.ROUTABLE"|tu ~ ' &bull; ' : "PLUGIN_ADMIN.NON_ROUTABLE"|tu ~ ' &bull; ') ~
(p.visible ? "PLUGIN_ADMIN.VISIBLE"|tu ~ ' &bull; ' : "PLUGIN_ADMIN.NON_VISIBLE"|tu ~ ' &bull; ') ~
(p.published ? "PLUGIN_ADMIN.PUBLISHED"|tu ~ ' &bull; ' : "PLUGIN_ADMIN.NON_PUBLISHED"|tu ~ ' &bull; ') %}
{% set page_url = getPageUrl(p) %}
<li class="page-item" data-nav-id="{{ p.route }}">
<div class="row page-item__row">
<span class="page-item__toggle" {{ p.children(0).count > 0 ? 'data-toggle="children"' : ''}}>
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.modular ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
</span>
<div class="page-item__content">
<div class="page-item__content-name">
<span data-hint="{{ description|trim(' &bull; ')|raw }}" class="hint--top page-item__content-hint">
{% set page_label = attribute(p.header, display_field)|defined(attribute(p, display_field))|defined(p.title)|default(p.slug|titleize) %}
<a href="{{ page_url }}" class="page-edit">{{ page_label|e }}</a>
</span>
{% if p.language %}
<span class="badge lang {% if p.language == admin_lang %}info{% endif %}">{{p.language}}</span>
{% endif %}
{% if p.home %}
<span class="page-home"><i class="fa fa-home"></i></span>
{% endif %}
</div>
<p class="page-route">{{ p.header.routes.default ?: p.route }} <span class="spacer"><i class="fa fa-long-arrow-right"></i></span> {{ p.template() }}</p>
</div>
<span class="page-item__tools">
{% if config.plugins.admin.frontend_preview_target != 'inline' %}
{% set preview_target = config.plugins.admin.frontend_preview_target %}
{% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (p.home ? '' : p.route)) ?: '/' %}
{% set preview_link = p.routable ? '<a class="page-view" target="' ~ preview_target ~ '" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye"></i></a>' : '' %}
{% else %}
{% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (p.home ? '' : p.route)) ?: '/' %}
{% set preview_link = p.routable ? '<a class="page-view" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye"></i></a>' : '' %}
{% endif %}
{{ preview_link|raw }}
{% if warn %}
<a href="#delete" data-remodal-target="delete" data-delete-url="{{ uri.addNonce(page_url ~ '/task' ~ separator ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
{% else %}
<a href="{{ uri.addNonce(page_url ~ '/task' ~ separator ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
{% endif %}
</span>
</div>
{% if p.children().count > 0 %}
<ul class="depth-{{ depth + 1 }}" style="display:none;">
{{ self.loop(p, depth + 1, twig_vars) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
{% import _self as macro %}
{% if admin.route %}
{% set context = admin.page(true) %}
{% endif %}
{% if uri.param('new') %}
{% set mode = 'new' %}
{% elseif context %}
{% set mode = 'edit' %}
{% if context.exists %}
{% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %}
{% set exists = true %}
{% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %}
{% else %}
{% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %}
{% endif %}
{% else %}
{% set mode = 'list' %}
{% set title = "PLUGIN_ADMIN.PAGES"|tu %}
{% endif %}
{% 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' %}
{% block stylesheets %}
{% if mode == 'edit' %}
{% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %}
{% endif %}
{{ parent() }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% endblock %}
{% if config.plugins.admin.frontend_preview_target != 'inline' %}
{% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %}
{% set preview_target = config.plugins.admin.frontend_preview_target %}
{% set preview_link = context.routable ? '<a class="button" target="' ~ preview_target ~ '" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
{% else %}
{% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (context.home ? '' : context.route)) ?: '/' %}
{% set preview_link = context.routable ? '<a class="button" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
{% endif %}
{% block titlebar %}
<div class="button-bar">
{% if mode == 'list' %}
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
{% for key, add_modal in config.plugins.admin.add_modals %}
{% if add_modal.show_in|defined('bar') == 'bar' %}
<a class="button {{ add_modal.link_classes }}" href="#modal-add_modal-{{ key }}" data-remodal-target="modal-add_modal-{{ key }}"><i class="fa fa-plus"></i> {{ add_modal.label|tu }}</a>
{% endif %}
{% endfor %}
<div class="button-group">
<button type="button" class="button disabled" href="#modal" data-remodal-target="modal">
<i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}
</button>
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu">
<li><a class="button" href="#modal" data-remodal-target="modal">{{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a></li>
<li><a class="button" href="#modal-folder" data-remodal-target="modal-folder">{{ "PLUGIN_ADMIN.ADD_FOLDER"|tu }}</a></li>
{% if admin.modularTypes is not empty %}
<li><a class="button" href="#modular" data-remodal-target="modular">{{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a></li>
{% endif %}
{% for key, add_modal in config.plugins.admin.add_modals %}
{% if add_modal.show_in|defined('bar') == 'dropdown' %}
<li><a class="button {{ add_modal.link_classes }}" href="#modal-add_modal-{{ key }}" data-remodal-target="modal-add_modal-{{ key }}">{{ add_modal.label|tu }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
{% if admin.multilang %}
<div class="button-group">
<button type="button" class="button disabled">
<i class="fa fa-flag-o"></i>
{% set langName = admin.siteLanguages[admin_lang] %}
{{ langName[:1]|upper ~ langName[1:] }}
</button>
{% if admin.languages_enabled|length > 1 %}
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu language-switcher">
{% for langCode in admin.languages_enabled %}
{% set langName = admin.siteLanguages[langCode] %}
{% if langCode != admin_lang %}
<li><a href="{{ uri.addNonce(base_url_relative ~ theme.slug ~ '/pages/task' ~ config.system.param_sep ~ 'switchlanguage/lang' ~ config.system.param_sep ~ langCode, 'admin-form', 'admin-nonce') }}">{{ langName[:1]|upper ~ langName[1:] }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% elseif mode == 'edit' %}
{{ preview_link|raw }}
<a class="button" href="{{ base_url }}/pages" title="{{ "PLUGIN_ADMIN.BACK"|tu }}"><i class="fa fa-reply"></i></a>
{% set siblings = context.parent().children() %}
{% if not siblings.isFirst(context.path) %}
{% set sib = siblings.nextSibling(context.path) %}
{% set sib_url = base_url ~ '/pages' ~ (sib.header.routes.default ?: sib.rawRoute) %}
<a class="button hidden-mobile" href="{{ sib_url }}" title="{{ "PLUGIN_ADMIN.PREVIOUS"|tu }}"><i class="fa fa-chevron-left"></i></a>
{% endif %}
{% if not siblings.isLast(context.path) %}
{% set sib = siblings.prevSibling(context.path) %}
{% set sib_url = base_url ~ '/pages' ~ (sib.header.routes.default ?: sib.rawRoute) %}
<a class="button hidden-mobile" href="{{ sib_url }}" title="{{ "PLUGIN_ADMIN.NEXT"|tu }}"><i class="fa fa-chevron-right"></i></a>
{% endif %}
{% if exists %}
<div class="button-group">
<button type="button" class="button disabled" href="#modal" data-remodal-target="modal">
<i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}
</button>
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu">
<li><a class="button" href="#modal" data-remodal-target="modal">{{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a></li>
<li><a class="button" href="#modal-folder" data-remodal-target="modal-folder">{{ "PLUGIN_ADMIN.ADD_FOLDER"|tu }}</a></li>
{% if admin.modularTypes is not empty %}
<li><a class="button" href="#modular" data-remodal-target="modular">{{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a></li>
{% endif %}
</ul>
</div>
<a class="button disable-after-click" href="{{ uri.addNonce(page_url ~ '/task' ~ config.system.param_sep ~ 'copy', 'admin-form', 'admin-nonce') }}" class="page-copy" ><i class="fa fa-copy"></i> {{ "PLUGIN_ADMIN.COPY"|tu }}</a>
<a class="button" href="#" data-remodal-target="move"><i class="fa fa-arrows"></i> {{ "PLUGIN_ADMIN.MOVE"|tu }}</a>
{% if config.plugins['admin-pro'].enabled %}
<a class="button" href="#" data-remodal-target="revisions"><i class="fa fa-history"></i> {{ "PLUGIN_ADMIN_PRO.REVISIONS"|tu }}</a>
{% endif %}
{% if warn %}
<a class="button" href="#delete" data-remodal-target="delete" data-delete-url="{{ uri.addNonce(page_url ~ '/task' ~ config.system.param_sep ~ 'delete', 'admin-form', 'admin-nonce') }}"><i class="fa fa-close"></i> {{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
{% else %}
<a class="button disable-after-click" href="{{ uri.addNonce(uri.route(true) ~ '/task' ~ config.system.param_sep ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
{% endif %}
{% endif %}
<div class="button-group">
<button class="button" name="task" value="save" form="blueprints" type="submit"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
{% if exists and admin.multilang %}
{% if context.untranslatedLanguages %}
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu lang-switcher">
{% for langCode in context.untranslatedLanguages %}
{% set langName = admin.siteLanguages[langCode] %}
{% if langCode != page_lang %}
<li><button class="button task" name="task" value="saveas" lang="{{langCode}}" form="blueprints" type="submit">{{ "PLUGIN_ADMIN.SAVE_AS"|tu }} {{ langName[:1]|upper ~ langName[1:] }}</button></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
{% if mode == 'new' %}
<h1><i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</h1>
{% elseif mode == 'edit' %}
<h1><i class="fa fa-fw fa-file-text-o"></i>
{{ context.title }}
</h1>
{% else %}
<h1><i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}</h1>
{% endif %}
{% endblock %}
{% block content %}
<div class="clear admin-pages">
{% if mode == 'new' %}
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/page'), data: context } %}
{% elseif mode == 'edit' %}
<div class="admin-form-wrapper">
<div id="admin-topbar">
{% if admin.multilang and page_lang %}
<div id="admin-lang-toggle" class="button-group">
<button type="button" class="button disabled">
{% if exists %}
{{ page_lang }}
{% else %}
{{ admin_lang }}
{% endif %}
</button>
{% if exists and context.translatedLanguages|length > 1 %}
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu language-switcher">
{% for language, route in context.translatedLanguages %}
{% if language != page_lang %}
<li><button class="task" name="task" value="switchlanguage" lang="{{language}}" redirect="{{context.rawRoute|trim('/')}}" form="blueprints">{{ language }}</button></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% if context.blueprints.fields %}
{% set normalText = "PLUGIN_ADMIN.NORMAL"|tu %}
{% set expertText = "PLUGIN_ADMIN.EXPERT"|tu %}
{% set maxLen = max([normalText|length, expertText|length]) %}
{% set normalText = macro.spanToggle(normalText, maxLen) %}
{% set expertText = macro.spanToggle(expertText, maxLen) %}
<form id="admin-mode-toggle">
<div class="switch-toggle switch-grav">
<input type="radio" value="normal" data-leave-url="{{ base_url }}/pages/{{ admin.route|trim('/') }}/mode{{ config.system.param_sep }}normal" id="normal" name="mode-switch" class="highlight" {% if admin.session.expert == '0' %} checked="checked"{% endif %}>
<label for="normal">{{ normalText|raw }}</label>
<input type="radio" value="expert" data-leave-url="{{ base_url }}/pages/{{ admin.route|trim('/') }}/mode{{ config.system.param_sep }}expert" id="expert" name="mode-switch" class="highlight" {% if admin.session.expert == '1' %} checked="checked"{% endif %}>
<label for="expert">{{ expertText|raw }}</label>
<a></a>
</div>
</form>
{% endif %}
</div>
{# Set current form data back into page content #}
{% if current_form_data %}
{% do context.header(current_form_data.header) %}
{% do context.content(current_form_data.content) %}
{% endif %}
{% if context.blueprints.fields and admin.session.expert == '0' %}
{% include 'partials/blueprints.html.twig' with { blueprints: context.blueprints, data: context } %}
{% else %}
{% include 'partials/blueprints-raw.html.twig' with { blueprints: admin.blueprints('admin/pages/'~modular~'raw'), data: context } %}
{% endif %}
</div>
{% else %}
<form id="page-filtering">
<div class="page-filters">
<input type="text" data-filter-labels="{{ [{'id': 'mode', 'name': 'PLUGIN_ADMIN.PAGE_MODES'|tu}, {'id': 'type', 'name': 'PLUGIN_ADMIN.PAGE_TYPES'|tu}, {'id': 'access', 'name': 'PLUGIN_ADMIN.ACCESS_LEVELS'|tu}] |json_encode|e('html_attr')}}" data-filter-types="{{ admin.types|merge(admin.modularTypes)|json_encode|e('html_attr') }}" data-filter-access-levels="{{ admin.accessLevels|json_encode|e('html_attr') }}" placeholder="{{ "PLUGIN_ADMIN.ADD_FILTERS"|tu }}" class="page-filter" name="page-filter" />
</div>
<div class="page-search">
<input type="text" placeholder="{{ "PLUGIN_ADMIN.SEARCH_PAGES"|tu }}" name="page-search" />
</div>
<div class="page-shortcuts">
<span class="button button-x-small" data-page-toggleall="expand"><i class="fa fa-fw fa-plus-circle"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|tu }}</span>
<span class="button button-x-small" data-page-toggleall="collapse"><i class="fa fa-fw fa-minus-circle"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|tu }}</span>
</div>
</form>
<div class="pages-list">
<ul class="depth-0">
{{ macro.loop(pages, 0, _context) }}
</ul>
{% include 'partials/page-legend.html.twig' %}
</div>
{% endif %}
</div>
{% if context %}
{% set obj_data = clone(context) %}
{% if mode == 'edit' %}
{% do obj_data.folder('') %}
{% endif %}
{% endif %}
{% if mode == 'list' or mode == 'edit' %}
<div class="remodal" data-remodal-id="modal" data-remodal-options="hashTracking: false">
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/new'), data: obj_data, form_id:'new-page' } %}
</div>
<div class="remodal" data-remodal-id="modal-folder" data-remodal-options="hashTracking: false">
{% include 'partials/blueprints-new-folder.html.twig' with { blueprints: admin.blueprints('admin/pages/new_folder'), data: obj_data, form_id:'new-folder' } %}
</div>
<div class="remodal" data-remodal-id="modular" data-remodal-options="hashTracking: false">
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/modular_new'), data: obj_data, form_id:'new-modular' } %}
</div>
{% for key, add_modal in config.plugins.admin.add_modals %}
<div class="remodal {{ add_modal.modal_classes|defined('') }}" data-remodal-id="modal-add_modal-{{ key }}" data-remodal-options="hashTracking: false">
{% include add_modal.template|defined('partials/blueprints-new.html.twig') with { blueprints: admin.blueprints(add_modal.blueprint), data: context, form_id:'add-modal' }|merge(add_modal.with|defined({})) %}
</div>
{% endfor %}
{% endif %}
{% if mode == 'edit' %}
<div class="remodal" data-remodal-id="move" data-remodal-options="hashTracking: false">
{% include 'partials/page-move.html.twig' with { blueprints: admin.blueprints('admin/pages/move'), data: context } %}
</div>
<div class="remodal" data-remodal-id="revisions" data-remodal-options="hashTracking: false">
{% include ['partials/page-revisions.html.twig', 'empty.html.twig'] ignore missing with { data: context } %}
</div>
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
<div class="remodal" data-remodal-id="delete" data-remodal-options="hashTracking: false">
<form>
<h1>{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE"|tu }}</h1>
<p class="bigger">
{% if context %}
<strong>{{ "PLUGIN_ADMIN.PAGE"|tu }}: {{ context.title }}</strong>
{% endif %}
</p>
<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>
{% 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>
{% include 'partials/admin-pro-pages-addons.html.twig' ignore missing %}
{% endblock %}
{% block bottom %}
{{ 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 %}
@@ -0,0 +1,21 @@
<div class="button-group">
{% set profiles = grav.backups.getBackupProfiles() %}
{% set backup_url = uri.addNonce(base_url_relative ~ "/backup.json/id" ~ config.system.param_sep ~ "%BACKUP_ID/task" ~ config.system.param_sep ~ "backup", 'admin-form', 'admin-nonce') %}
<button class="button" data-backup data-ajax="{{ backup_url|replace({'%BACKUP_ID':'0'}) }}">
<i class="fa fa-life-ring"></i> {{ "PLUGIN_ADMIN.BACKUP_NOW"|tu }}
</button>
<button type="button" class="button dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu">
{% for id, profile in profiles %}
<li>
<a data-backup data-ajax="{{ backup_url|replace({'%BACKUP_ID':id}) }}" class="button">{{ profile.name }}</a>
</li>
{% endfor %}
<li>
<a href="{{ base_url ~ '/tools/backups' }}" class="button">Backups Manager</a>
</li>
</ul>
</div>
@@ -0,0 +1,137 @@
{% if uri.extension() == 'json' %}{% include 'default.json.twig' %}{% else %}
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{% if title %}{{ title }} | {% else %}{% if header.title %}{{ header.title }} | {% endif %}{% endif %}{{ site.title }}</title>
{% if header.description %}
<meta name="description" content="{{ header.description }}">
{% else %}
<meta name="description" content="{{ site.description }}">
{% endif %}
{% if header.robots %}
<meta name="robots" content="{{ header.robots }}">
{% else %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="{{ base_url_simple }}{{ theme_url }}/images/favicon.png">
{% block stylesheets %}
{% include 'partials/stylesheets.html.twig' %}
{% endblock %}
{% include 'partials/javascript-config.html.twig' %}
{% block javascripts %}
{% include 'partials/javascripts.html.twig' %}
{% endblock %}
{% endblock %}
{% block assets deferred %}
{{ assets.css()|raw }}
{{ assets.js()|raw }}
{% endblock %}
</head>
{% block body %}
<body class="ga-theme-17x {{ config.plugins.admin.sidebar.size == 'small' ? 'sidebar-closed' : '' }} {{ config.plugins.admin.body_classes }} {{ body_classes }}">
{% if not authorize(['admin.login']) %}
{% include 'partials/messages.html.twig' %}
{% else %}
{% block noscript %}
{% include 'partials/noscript.html.twig' %}
{% endblock noscript %}
{% block page %}
<div class="remodal-bg">
{% block navigation %}
{% include 'partials/nav.html.twig' %}
{% endblock %}
<main id="admin-main" >
{% include 'partials/nav-toggle.html.twig' %}
<div id="titlebar" class="titlebar">
{% block titlebar %}{% endblock %}
</div>
{% block content_wrapper %}
<div class="content-wrapper">
<div class="{% if config.plugins.admin.content_padding %}content-padding{% endif %}">
{% block messages %}
{% include 'partials/messages.html.twig' %}
{% endblock %}
{% block widgets %}{% endblock %}
<div class="default-box-shadow">
{% block content_top %}{% endblock %}
<div class="admin-block">
{%- block content %}{% endblock -%}
</div>
{% if config.plugins.admin.show_github_msg %}
<div class="notice alert"><i class="fa fa-github"></i> <a href="https://github.com/getgrav/grav-plugin-admin/issues" target="_blank" rel="noopener noreferrer">{{ 'PLUGIN_ADMIN.ADMIN_REPORT_ISSUE'|tu }}</a></div>
{% endif %}
{% block content_bottom %}{% endblock %}
</div>
{% block footer %}
<footer id="footer">
{% include 'partials/footer.html.twig' %}
</footer>
{% endblock %}
</div>
</div>
{% endblock %}
{% block modals %}
<div class="remodal" data-remodal-id="generic" data-remodal-options="hashTracking: false">
<form>
<h1>{{ "PLUGIN_ADMIN.ERROR"|tu }}</h1>
<div class="error-content"></div>
<div class="button-bar">
<a class="button remodal-cancel" data-remodal-action="cancel" href="#">{{ "PLUGIN_ADMIN.CLOSE"|tu }}</a>
</div>
</form>
</div>
<div class="remodal" data-remodal-id="metadata" data-remodal-options="hashTracking: false">
<form>
<h1><span>{{ "PLUGIN_ADMIN.METADATA"|tu }} for</span> <strong></strong></h1>
<div class="metadata-preview">
<div class="meta-preview"></div>
<div class="meta-content"></div>
</div>
<div class="button-bar">
<a class="button remodal-cancel" data-remodal-action="cancel" href="#">{{ "PLUGIN_ADMIN.CLOSE"|tu }}</a>
</div>
</form>
</div>
<div class="remodal" data-remodal-id="delete-media" data-remodal-options="hashTracking: false">
<form>
<h1>{{ "PLUGIN_ADMIN.MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_TITLE"|tu }}</h1>
<p class="bigger">
{{ "PLUGIN_ADMIN.MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_DESC"|tu }}
</p>
<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>
<button data-remodal-action="confirm" class="button remodal-confirm disable-after-click"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
</div>
</form>
</div>
{% endblock %}
</main>
<div id='overlay'></div>
</div>
{% endblock page %}
{% endif %}
{% block bottom %}
{{ assets.js('bottom')|raw }}
{% endblock %}
</body>
{% endblock body %}
</html>
{% endif %}
@@ -0,0 +1 @@
{% extends 'partials/base-root.html.twig' %}
@@ -0,0 +1,21 @@
{% set form_id = form_id ? form_id : 'blueprints' %}
{% set scope = scope ?: 'data.' %}
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
{% for field in blueprints.fields %}
{% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
<div class="block block-{{field.type}}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
<input type="hidden" name="task" value="saveNewFolder" />
<div class="button-bar">
<button class="button primary">{{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
</div>
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</form>
@@ -0,0 +1,21 @@
{% set form_id = form_id ? form_id : 'blueprints' %}
{% set scope = scope ?: 'data.' %}
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
{% for field in blueprints.fields %}
{% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
<div class="block block-{{field.type}}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
<input type="hidden" name="task" value="continue" />
<div class="button-bar">
<button class="button primary">{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
</div>
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</form>
@@ -0,0 +1,17 @@
{% set form_id = form_id ? form_id : 'blueprints' %}
{% set scope = scope ?: 'data.' %}
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
{% for field in blueprints.fields %}
{% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
<div class="block block-{{ field.type }}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</form>
@@ -0,0 +1,35 @@
{% set form_id = form_id ? form_id : 'blueprints' %}
{% set scope = scope ?: 'data.' %}
{% if admin.findFormFields('file', blueprints.fields) %}
{% set multipart = ' enctype="multipart/form-data"' %}
{% endif %}
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true"{{ multipart|raw }}>
{% for field in blueprints.fields %}
{% if field.type %}
{% set value = field.name ? (form.value(field.name) ?? data.value(field.name)) : data.toArray %}
<div class="block block-{{ field.type }}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
{% if data.extra %}
{% for name, value in data.extra %}
{% if name not in ['_json','task','admin-nonce'] %}
{% set field = {name: '_json.' ~ name} %}
{% set value = value|raw|json_encode %}
{% include 'forms/fields/hidden/hidden.html.twig' %}
{% endif %}
{% endfor %}
{% endif %}
{% if form %}
{% include "forms/fields/formname/formname.html.twig" %}
{% include 'forms/fields/uniqueid/uniqueid.html.twig' %}
{{ nonce_field(form.getNonceAction(), form.getNonceName())|raw }}
{% else %}
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
{% endif %}
</form>
@@ -0,0 +1,14 @@
<div id="news-feed" class="dashboard-item admin-block default-box-shadow">
<h1>
{{ "PLUGIN_ADMIN.NEWS_FEED"|tu }}
<span class="right">
<a href="#" class="button button-small" data-refresh="feed"><i class="fa fa-refresh"></i></a>
</span>
</h1>
<div class="widget-content">
<div class="widget-loader"><i class="fa fa-refresh fa-spin"></i></div>
<ul></ul>
</div>
</div>
@@ -0,0 +1,33 @@
{% if authorize(['admin.maintenance', 'admin.super']) %}
{% set backup = admin.lastBackup() %}
<div id="updates" class="dashboard-item dashboard-left">
<div class="secondary-accent default-box-shadow">
<h1>{{ "PLUGIN_ADMIN.MAINTENANCE"|tu }}</h1>
<div class="admin-update-charts">
<div class="updates-chart" data-chart-name="updates" data-chart-type="pie" data-chart-data="{{ {'series': [100, 0]}|json_encode|e('html_attr') }}">
<div class="chart-wrapper">
<div class="ct-chart chart-loader"><i class="fa fa-refresh fa-spin"></i></div>
<span class="numeric hidden"><span>-</span><em>{{ "PLUGIN_ADMIN.UPDATED"|tu|lower }}</em></span>
</div>
<p class="js__updates-available-description">&nbsp;</p>
</div>
<div class="backups-chart" data-chart-name="backups" data-chart-type="pie" data-chart-data="{{ {'series': [backup.chart_fill, backup.chart_empty]}|json_encode|e('html_attr') }}">
<div class="chart-wrapper">
<div class="ct-chart chart-loader"><i class="fa fa-refresh fa-spin"></i></div>
<span class="numeric hidden">{{ backup.days|raw }}<em>{{ "PLUGIN_ADMIN.DAYS"|tu|lower }}</em></span>
</div>
<p class="hidden">{{ "PLUGIN_ADMIN.LAST_BACKUP"|tu }}</p>
</div>
</div>
<div class="flush-bottom button-bar">
<a class="button hidden" href="#" data-update-packages data-remodal-target="update-packages" data-plugin-action="start-packages-update"><i class="fa fa-cloud-download"></i> {{ "PLUGIN_ADMIN.UPDATE"|tu }}</a>
{% include 'partials/backups-button.html.twig' %}
</div>
</div>
</div>
{% include 'partials/modal-update-packages.html.twig' with { type: 'plugin' } %}
{% endif %}
@@ -0,0 +1,13 @@
<div id="notifications" class="dashboard-item admin-block default-box-shadow">
<h1>
{{ "PLUGIN_ADMIN.NOTIFICATIONS"|tu }}
<span class="right">
<a href="#" class="button button-small" data-refresh="notifications"><i class="fa fa-refresh"></i></a>
</span>
</h1>
<div class="widget-content">
<div class="widget-loader"><i class="fa fa-refresh fa-spin"></i></div>
<ul></ul>
</div>
</div>
@@ -0,0 +1,19 @@
{% if authorize(['admin.pages', 'admin.super']) %}
<div id="latest">
<div class="button-bar">
<a class="button" href="{{ base_url_relative }}/pages"><i class="fa fa-fw fa-file-text-o"></i>{{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}</a>
</div>
<h1>{{ "PLUGIN_ADMIN.LATEST_PAGE_UPDATES"|tu }}</h1>
<table>
{% for latest in admin.latestPages if admin.latestPages %}
<tr>
<td class="triple page-title">
<a href="{{ base_url }}/pages/{{ latest.route|trim('/') }}"><i class="fa fa-fw fa-file-text-o"></i> {{ latest.title|e }}</a></td>
<td class="triple page-route">{{ latest.route }}</td><td>{{ latest.modified|adminNicetime }}</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
<div class="padding">You don't have sufficient access to view the dashboard...</div>
{% endif %}
@@ -0,0 +1,24 @@
{% if authorize(['admin.statistics', 'admin.super']) %}
<div id="popularity" class="dashboard-item dashboard-right" data-chart-name="popularity" data-chart-type="bar" data-chart-data="{{ {'series': [popularity.getDailyChartData['data']], 'labels': popularity.getDailyChartData['labels']}|json_encode|e('html_attr') }}">
<div class="primary-accent default-box-shadow">
<h1>{{ "PLUGIN_ADMIN.STATISTICS"|tu }}</h1>
<div class="admin-statistics-chart">
<div class="ct-chart chart-loader"><i class="fa fa-refresh fa-spin"></i></div>
<div class="flush-bottom button-bar stats-bar">
<span class="stat">
<b>{{ popularity.getDailyTotal }}</b>
<i>{{ "PLUGIN_ADMIN.TODAY"|tu }}</i>
</span>
<span class="stat">
<b>{{ popularity.getWeeklyTotal }}</b>
<i>{{ "PLUGIN_ADMIN.WEEK"|tu }}</i>
</span>
<span class="stat">
<b>{{ popularity.getMonthlyTotal }}</b>
<i>{{ "PLUGIN_ADMIN.MONTH"|tu }}</i>
</span>
</div>
</div>
</div>
</div>
{% endif %}
@@ -0,0 +1,3 @@
{% for entry in feed %}
<li><span class="date">{{ entry.nicetime }}</span> <a href="{{ entry.url }}" target="_blank" title="{{ entry.title|striptags|e('html_attr') }}">{{ entry.title }}</a>
{% endfor %}
@@ -0,0 +1,5 @@
{% if custom_admin_footer %}
{{ custom_admin_footer|raw }}
{% else %}
<a href="http://getgrav.org" target="_blank" rel="noopener noreferrer">Grav</a> v<span class="grav-version">{{ constant('GRAV_VERSION') }}</span> - Admin v{{ admin_version }} - {{ "PLUGIN_ADMIN.WAS_MADE_WITH"|tu|lower }} <i class="fa fa-heart-o pulse"></i> {{ "PLUGIN_ADMIN.BY"|tu|lower }} <a href="https://trilby.media" target="_blank" rel="noopener noreferrer">Trilby Media</a>.
{% endif %}
@@ -0,0 +1,11 @@
<nav id="nav">
<ul>
{% for page in pages %}
{% if page.visible %}
<li>
<a href="{{ page.url }}">{{ page.menu }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
@@ -0,0 +1,43 @@
{% if authorize(['admin.login', 'admin.super']) %}
{% set notifications = (config.plugins.admin.widgets['dashboard-notifications'] or config.plugins.admin.notifications.dashboard or config.plugins.admin.notifications.plugins or config.plugins.admin.notifications.themes) ? 1 : 0 %}
{% switch template_route %}
{% case 'dashboard' %}
{% set notifications_filters = "['feed', 'dashboard', 'top']" %}
{% case 'plugins' %}
{% set notifications_filters = "['plugins', 'top']" %}
{% case 'themes' %}
{% set notifications_filters = "['themes', 'top']" %}
{% default %}
{% set notifications_filters = "['top']" %}
{% endswitch %}
<script type="text/javascript">
window.GravAdmin = window.GravAdmin || {};
window.GravAdmin.config = {
current_url: '{{ uri.route(true) }}',
base_url_relative: '{{ base_url_relative }}',
base_url_simple: '{{ base_url_simple }}',
route: '{{ admin.route|trim('/') }}',
param_sep: '{{ config.system.param_sep }}',
{% if authorize(['admin.maintenance', 'admin.super']) %}
enable_auto_updates_check: '{{ config.plugins.admin.enable_auto_updates_check }}',
{% endif %}
admin_timeout: '{{ config.plugins.admin.session.timeout ?: 1800 }}',
admin_nonce: '{{ admin.getNonce }}',
language: '{{ grav.user.language|default('en') }}',
pro_enabled: '{{ config.plugins["admin-pro"].enabled }}',
notifications: {
enabled: {{ notifications }},
filters: {{ notifications_filters|raw }}
},
local_notifications: '{{ config.system.local_notifications|default(false) }}',
site: {
delimiter: '{{ config.site.summary.delimiter|default('===') }}'
}
};
window.GravAdmin.uri_params = {};
{% for param, value in grav.uri.params(null, true) %}
window.GravAdmin.uri_params.{{param}} = "{{value|replace({'\\': '/'})}}";
{% endfor %}
</script>
{% endif %}
@@ -0,0 +1,11 @@
{% do assets.add('jquery',101) %}
{% if authorize(['admin.login', 'admin.super']) %}
{% do assets.addJs(theme_url~'/js/vendor.min.js', { 'loading':'defer' }) %}
{% do assets.addJs(theme_url~'/js/admin.min.js' , { 'loading':'defer' }) %}
{% if browser.getBrowser == 'msie' or browser.getBrowser == 'edge' %}
{% do assets.addJs(theme_url~'/js/form-attr.polyfill.js') %}
{% endif %}
{% include 'partials/javascripts-extra.html.twig' ignore missing %}
{% endif %}
@@ -0,0 +1,12 @@
<div class="sort-actions" data-grav-selectize="true">
<select>
<option value="name" selected>{{ "PLUGIN_ADMIN.NAME"|tu }}</option>
<option value="author">{{ "PLUGIN_ADMIN.AUTHOR"|tu }}</option>
<option value="official">GravTeam</option>
<option value="release-date">{{ "PLUGIN_ADMIN.RELEASE_DATE"|tu }}</option>
{% if list_view == 'plugins' and not installing %}<option value="enabled">{{ "PLUGIN_ADMIN.ENABLED"|tu }}</option>{% endif %}
{% if not installing %}<option value="updatable">{{ "PLUGIN_ADMIN.UPDATES_AVAILABLE"|tu }}</option>{% endif %}
{% if config.system.gpm.releases == 'testing' %}<option value="testing">{{ "PLUGIN_ADMIN.TESTING"|tu }}</option>{% endif %}
</select>
<div class="sort-icon"><i class="fa fa-fw fa-sort-amount-asc"></i></div>
</div>
@@ -0,0 +1,31 @@
{% embed 'partials/login.html.twig' with {title: 'Grav Admin Login'} %}
{% block integration %}
{# NEW WAY OF INCLUDING 3RD PARTY LOGIN OPTIONS #}
{% for template in grav.login.getProviderLoginTemplates %}
{% include template %}
{% endfor %}
{% endblock %}
{% block form %}
{% set form = forms['login'] %}
{% for field in form.fields %}
{% set value = field.name == 'username' ? username : '' %}
{% if field.type %}
<div>
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
<div class="form-actions primary-accent">
<a class="button secondary" href="{{ base_url_relative }}/forgot"><i class="fa fa-exclamation-circle"></i> {{ 'PLUGIN_ADMIN.LOGIN_BTN_FORGOT'|tu }}</a>
<button type="submit" class="button primary" name="task" value="login"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_ADMIN.LOGIN_BTN'|tu }}</button>
</div>
{% endblock %}
{% endembed %}
@@ -0,0 +1,14 @@
{% if config.plugins.admin.logo_text %}
<h1 class="text-logo">
{{ config.plugins.admin.logo_text }}
</h1>
{% else %}
<h1 class="{{ custom_login_logo ? 'custom-logo' : 'default-logo' }}">
{{ title }}
{% if custom_login_logo %}
<img src="{{ url(custom_login_logo) }}" title="Login" />
{% else %}
{% include('@admin-images/logo.svg') %}
{% endif %}
</h1>
{% endif %}
@@ -0,0 +1,15 @@
{% embed 'partials/login.html.twig' with {title:'Grav Admin Logout'} %}
{% block integration %}
{% endblock %}
{% block form %}
<div class="form-actions primary-accent">
<a class="button secondary" onclick="window.history.back()"><i class="fa fa-reply"></i> {{ 'PLUGIN_ADMIN.BACK'|tu }}</a>
<button type="submit" class="button primary" name="task" value="logout"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_ADMIN.LOGOUT'|tu }}</button>
</div>
{% endblock %}
{% endembed %}
@@ -0,0 +1,26 @@
{% embed 'partials/login.html.twig' with {title:'Grav 2-Factor Authentication', redirect: admin.session.redirect} %}
{% block integration %}
{% endblock %}
{% block form %}
{% set form = forms['login-twofa'] %}
{% for field in form.fields %}
{% if field.type %}
<div>
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
<div class="{{ form_button_outer_classes ?: 'form-actions primary-accent' }}">
<div class="form-actions primary-accent">
<button type="submit" class="button primary" name="task" value="twofa"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_LOGIN.BTN_LOGIN'|t }}</button>
</div>
</div>
{% endblock %}
{% endembed %}
@@ -0,0 +1,34 @@
{% extends 'partials/base.html.twig' %}
{% set scope = scope ?: 'data.' %}
{% block messages %}{% endblock %}
{% block body %}
<body id="admin-login-wrapper">
<section id="admin-login" class="login-box-shadow {{ classes }}">
{% include 'partials/login-logo.html.twig' %}
{% include 'partials/messages.html.twig' %}
{% block instructions %}{% endblock %}
{% block integration %}{% endblock %}
{% set redirect = redirect ?: uri.path ~ uri.params ~ (uri.query ? '?' ~ uri.query : '') %}
<form method="post" action="{{ base_url_relative }}">
<div class="padding">
{% block form %}{% endblock %}
<input type="hidden" name="redirect" value="{{ redirect }}" />
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</div>
</form>
<script>
$(document).ready( function() {
$('#messages').delay(5000).animate({ height: 'toggle', opacity: 'toggle' }, 'slow');
});
</script>
</section>
</body>
{% endblock %}
@@ -0,0 +1,20 @@
{% if config.plugins.admin.logo_text %}
<h3>
<a href="{{ base_url_relative }}">
{{ config.plugins.admin.logo_text }}
</a>
<a class="front-end hint--left" data-hint="{{ "PLUGIN_ADMIN.VIEW_SITE_TIP"|tu }}" target="_blank" href="{{ base_url_relative_frontend }}"> <i class="fa fa-external-link"></i></a>
</h3>
{% else %}
<div class="admin-logo {{ custom_admin_logo ? 'custom-logo' : 'default-logo' }}">
<a href="{{ base_url_relative }}">
{% if custom_admin_logo %}
<img src="{{ url(custom_admin_logo) }}" title="{{ site.title }}" />
{% else %}
{% include('@admin-images/grav-small.svg') %}
{% include('@admin-images/grav-regular.svg') %}
{% endif %}
</a>
<a class="front-end hint--left" data-hint="{{ "PLUGIN_ADMIN.VIEW_SITE_TIP"|tu }}" target="_blank" href="{{ base_url_relative_frontend }}"> <i class="fa fa-external-link"></i></a>
</div>
{% endif %}
@@ -0,0 +1,32 @@
<div class="grid media-container {% if is_modal %}in-modal{% endif %}">
{% set default_site_lang = grav.config.system.languages|first|first %}
{% if not route %}
{% include 'partials/media-list-wrapper__sidebar.html.twig' %}
{% endif %}
{% if is_modal %}
<div class="thumbs-list-container block size-3-4">
{% include 'partials/media-list-wrapper__list__filters.html.twig' %}
<h5 class="media-list-title"><span class="page-indicator">All Pages</span> <a class="hidden js__reset-pages-filter" href="#"><i class="fa fa-fw fa-times"></i></a></h5>
<div class="mediapicker-scroll">
{% include 'partials/media-list-wrapper__list.html.twig' with { is_modal: is_modal } %}
</div>
<input name="thumb-size" class="media-range" type="range" min="50" max="250" value="100" />
</div>
{% else %}
<div class="thumbs-list-container block {% if not route %}size-2-3{% endif %} ">
{% if not route %}
{% include 'partials/media-list-wrapper__list__filters.html.twig' %}
<h5 class="media-list-title"><span class="page-indicator">All Pages</span> <a class="hidden js__reset-pages-filter" href="#"><i class="fa fa-fw fa-times"></i></a></h5>
{% include 'partials/media-list-wrapper__list.html.twig' with { is_modal: is_modal } %}
{% else %}
{% include 'partials/media-list-wrapper__details.html.twig' %}
{% endif %}
</div>
{% endif %}
</div>
@@ -0,0 +1,23 @@
<div id="admin-media" class="files js__files card-row grid fixed-blocks pure-g">
{% if not is_modal %}
{% include 'partials/media-list-wrapper__list__dropzone.html.twig' ignore missing %}
{% endif %}
{% if admin.files is empty %}
<div class="empty-state">
{% if (uri.param('type') or uri.param('date')) %}
<h2>Filtering by {{ uri.param('type') }} {{ uri.param('date') }}</h2>
{% endif %}
<h2>No media files found</h2>
<p>You need to add media to a page in order to display it here.</p>
</div>
{% else %}
{% include 'media-list-content.html.twig' with { is_modal: is_modal } %} {# not a partial as used by AJAX #}
{% endif %}
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</div>
{% include 'partials/spinning-wheel.html.twig' %}
@@ -0,0 +1,28 @@
<div>
<div class="filter-wrapper filter-type">
<select class="filter js__filter" data-name="type" data-grav-selectize>
<option value="*" {% if not grav.uri.param('type') %}selected{% endif %}>All Files</option>
<option value="images" {% if grav.uri.param('type') == 'images' %}selected{% endif %}>Images</option>
<option value="videos"{% if grav.uri.param('type') == 'videos' %}selected{% endif %}>Videos</option>
<option value="audios"{% if grav.uri.param('type') == 'audios' %}selected{% endif %}>Audio</option>
<option value="files"{% if grav.uri.param('type') == 'files' %}selected{% endif %}>Files</option>
</select>
</div>
<div class="filter-wrapper filter-date">
<select class="filter js__filter" data-name="date" data-grav-selectize>
<option value="*">All Dates</option>
{% set theDate = date() %}
{% for year, months in admin.filesDates %}
<optgroup label="{{year}}">
{% for month, number in months %}
<option value="{{year}}-{{month}}" {% if grav.uri.param('date') == year~'-'~month %}selected{% endif %}>
{{theDate.setDate(theDate.format('Y'), month, theDate.format('d'))|date('M')}}
({{number}})</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
</div>
@@ -0,0 +1,50 @@
{% macro loop(page, depth, twig_vars) %}
{% import _self as self %}
{% set separator = twig_vars['config'].system.param_sep %}
{% set base_url = twig_vars['base_url_relative'] %}
{% set base_url_simple = twig_vars['base_url_simple'] %}
{% set admin_route = twig_vars['admin_route'] %}
{% set admin_lang = twig_vars['admin_lang'] %}
{% set warn = twig_vars['warn'] %}
{% for p in page.children() %}
{% set page_route = p.rawRoute|trim('/') %}
{% if p.language and p.language != admin_lang %}
{% set page_url = base_url_simple ~ '/' ~ p.language ~ '/' ~ admin_route ~ '/pages/' ~ page_route %}
{% else %}
{% set page_url = base_url ~ '/pages/' ~ page_route %}
{% endif %}
<li class="page-item" data-nav-id="{{ p.route }}">
<div class="row">
<span {{ p.children(0).count > 0 ? 'data-toggle="children"' : ''}} class="hint--bottom">
<i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.modular ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
</span>
<span data-hint="{{ p.header.routes.default ?: p.route }}" class="hint--bottom">
<a data-page="{{ p.route }}" class="js__page-link page-link" href="#">{{ p.title }}</a>
</span>
<span class="page-home">{{ p.home ? '<i class="fa fa-home"></i>' }}</span>
</div>
{% if p.children().count > 0 %}
<ul class="depth-{{ depth + 1 }}" style="display:none;">
{{ self.loop(p, depth + 1, twig_vars) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
{% import _self as macro %}
<div class="pages-list-container clear block size-1-4">
<h5>{{ "PLUGIN_ADMIN.PAGES"|tu|e }}</h5>
<div class="mediapicker-scroll">
<ul class="pages-list depth-0">
{{ macro.loop(pages, 0, _context) }}
</ul>
</div>
</div>
@@ -0,0 +1,14 @@
{% set admin_messages = admin.messages|merge(admin.getTempMessages()) %}
{% set form_message = form.message %}
<div id="messages" class="top-notifications-container{{ admin_messages|length or form_message ? ' default-box-shadow' : '' }}">
<div class="single-notification info alert hidden" data-gpm-grav></div>
{%- for message in admin_messages -%}
<div class="{{ message.scope|e }} alert">{{ message.message|raw }}</div>
{%- endfor -%}
{%- if form_message -%}
<div class="error alert">{{ form_message|raw }}</div>
{%- endif -%}
{%- for message in plugin_messages -%}
<div class="{{ message.scope|e }} alert">{{ message.message|raw }}</div>
{%- endfor -%}
</div>
@@ -0,0 +1,89 @@
<div class="remodal"
data-packages-modal
data-remodal-id="add-package"
data-remodal-options="hashTracking: false">
<form>
<div class="add-package-installing">
<h1>{{ "PLUGIN_ADMIN.INSTALLING"|tu }}</h1>
<div class="loading">
<p>
{{ "PLUGIN_ADMIN.LOADING"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
</div>
<div class="install-dependencies-package-container hidden">
<p><strong>{{ "PLUGIN_ADMIN.DEPENDENCIES_NOT_MET_MESSAGE"|tu }}</strong></p>
<div class="type-install hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_NOT_INSTALLED"|tu }}:</p>
<ul></ul>
</div>
<div class="type-update hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_NEED_UPDATE"|tu }}:</p>
<ul></ul>
</div>
<div class="type-ignore hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_SUGGESTED_UPDATE"|tu }}:</p>
<ul></ul>
</div>
<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 data-{{ type }}-action="install-dependencies-and-package" class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</div>
<div class="install-package-container hidden">
<p>
{{ "PLUGIN_ADMIN.READY_TO_INSTALL_PACKAGES"|tu }}
</p>
<ul class="packages-names-list"></ul>
<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 data-{{ type }}-action="install-package" class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</div>
<div class="install-package-error hidden">
<p>
{{ "PLUGIN_ADMIN.ERROR_INSTALLING_PACKAGES"|tu }}
</p>
<ul class="packages-names-list"></ul>
<div class="button-bar">
<button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CLOSE"|tu }}</button>
</div>
</div>
<div class="installing-dependencies hidden">
<p>
{{ "PLUGIN_ADMIN.INSTALLING_DEPENDENCIES"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
</div>
<div class="installing-package hidden">
<p>
{{ "PLUGIN_ADMIN.INSTALLING_PACKAGES"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
<ul class="packages-names-list"></ul>
</div>
<div class="installation-complete hidden">
<p>
{{ "PLUGIN_ADMIN.PACKAGES_SUCCESSFULLY_INSTALLED"|tu }}
</p>
<ul class="packages-names-list"></ul>
</div>
</div>
</form>
</div>
@@ -0,0 +1,13 @@
<div class="remodal" data-remodal-id="changes">
<form>
<h1>{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_TITLE"|tu }}</h1>
<p class="bigger">
{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|tu }}
</p>
<br>
<div class="button-bar">
<a class="button secondary" data-leave-action="cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
<a class="button" data-leave-action="continue" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</form>
</div>
@@ -0,0 +1,38 @@
<div class="remodal"
data-remodal-id="reinstall-package"
data-remodal-options="hashTracking: false">
<form>
<div class="reinstall-package-confirm">
<h1>{{ "PLUGIN_ADMIN.REINSTALL_THE"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu])|e }}</h1>
<p class="bigger">
{{ "PLUGIN_ADMIN.CONFIRM_REINSTALL"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu])|e }}
</p>
<p class="bigger hidden warning-reinstall-not-latest-release">
{{ "PLUGIN_ADMIN.WARNING_REINSTALL_NOT_LATEST_RELEASE"|tu|e }}
</p>
<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|e }}</button>
<button data-{{ type|e }}-action="reinstall-package"
data-package-slug="{{ package.slug|e }}"
data-package-type="{{ package.package_type |e }}"
data-package-name="{{ package.name|e }}"
data-package-current-version="{{ package.version|e }}"
class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu|e }}</button>
<div class="spinning-wheel hidden">
{{ "PLUGIN_ADMIN.INSTALLING"|tu|e }}.. <i class="fa fa-spinner fa-spin"></i>
</div>
</div>
</div>
<div class="reinstall-package-done hidden">
<h1>{{ "PLUGIN_ADMIN.REINSTALLED_SUCCESSFULLY"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu])|e }}</h1>
</div>
<div class="reinstall-package-error hidden">
<h1>{{ "PLUGIN_ADMIN.ERROR_REINSTALLING_THE"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu])|e }}</h1>
</div>
</form>
</div>
@@ -0,0 +1,44 @@
<div class="remodal"
data-remodal-id="remove-package"
data-remodal-options="hashTracking: false">
<form>
<div class="remove-package-confirm">
<h1>{{ "PLUGIN_ADMIN.REMOVE_THE"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}</h1>
<p class="bigger">
{{ "PLUGIN_ADMIN.CONFIRM_REMOVAL"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}
</p>
<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-{{ type }}-action="remove-package" data-packages-slugs="{{ package.slug }}" class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
</div>
</div>
<div class="remove-package-dependencies hidden">
<h1>{{ "PLUGIN_ADMIN.REMOVED_SUCCESSFULLY"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}</h1>
<p>
{{ "PLUGIN_ADMIN.ADDITIONAL_DEPENDENCIES_CAN_BE_REMOVED"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}
</p>
<div>
<ul class="package-dependencies-container"></ul>
</div>
<div class="button-bar">
<a href="{{ base_url_relative ~ '/' ~ type ~ 's' }}" class="button secondary"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CLOSE"|tu }}</a>
</div>
</div>
<div class="remove-package-done hidden">
<h1>{{ "PLUGIN_ADMIN.REMOVED_SUCCESSFULLY"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}</h1>
<div class="button-bar">
<a href="{{ base_url_relative ~ '/' ~ type ~ 's' }}" class="button secondary"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CLOSE"|tu }}</a>
</div>
</div>
<div class="remove-package-error hidden">
<h1>{{ "PLUGIN_ADMIN.ERROR_REMOVING_THE"|tu([("PLUGIN_ADMIN." ~ type|upper)|tu]) }}</h1>
<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>
</div>
</div>
</form>
</div>
@@ -0,0 +1,89 @@
<div class="remodal"
data-packages-modal
data-remodal-id="update-packages"
data-remodal-options="hashTracking: false">
<form>
<div class="add-package-installing">
<h1>{{ "PLUGIN_ADMIN.UPDATING"|tu }}</h1>
<div class="loading">
<p>
{{ "PLUGIN_ADMIN.LOADING"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
</div>
<div class="install-dependencies-package-container hidden">
<p><strong>{{ "PLUGIN_ADMIN.DEPENDENCIES_NOT_MET_MESSAGE"|tu }}</strong></p>
<div class="type-install hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_NOT_INSTALLED"|tu }}:</p>
<ul></ul>
</div>
<div class="type-update hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_NEED_UPDATE"|tu }}:</p>
<ul></ul>
</div>
<div class="type-ignore hidden">
<p>{{ "PLUGIN_ADMIN.PACKAGES_SUGGESTED_UPDATE"|tu }}:</p>
<ul></ul>
</div>
<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 data-{{ type }}-action="install-dependencies-and-package" class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</div>
<div class="install-package-container hidden">
<p>
{{ "PLUGIN_ADMIN.READY_TO_UPDATE_PACKAGES"|tu }}
</p>
<ul class="packages-names-list"></ul>
<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 data-{{ type }}-action="install-package" class="button"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</div>
<div class="install-package-error hidden">
<p>
{{ "PLUGIN_ADMIN.ERROR_UPDATING_PACKAGES"|tu }}
</p>
<ul class="packages-names-list"></ul>
<div class="button-bar">
<button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CLOSE"|tu }}</button>
</div>
</div>
<div class="installing-dependencies hidden">
<p>
{{ "PLUGIN_ADMIN.INSTALLING_DEPENDENCIES"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
</div>
<div class="installing-package hidden">
<p>
{{ "PLUGIN_ADMIN.UPDATING_PACKAGES"|tu }}
<span class="fa fa-spin fa-spinner"></span>
</p>
<ul class="packages-names-list"></ul>
</div>
<div class="installation-complete hidden">
<p>
{{ "PLUGIN_ADMIN.PACKAGES_SUCCESSFULLY_UPDATED"|tu }}
</p>
<ul class="packages-names-list"></ul>
</div>
</div>
</form>
</div>
@@ -0,0 +1,40 @@
{% set clear_cache_url = base_url_relative ~ '/cache.json/task' ~ config.system.param_sep ~ 'clearCache'|e('html_attr') %}
<ul id="admin-nav-quick-tray">
{% if authorize(['admin.maintenance', 'admin.super', 'admin.cache']) %}
<li class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}">
<a data-clear-cache-type="" data-clear-cache="{{ uri.addNonce(clear_cache_url, 'admin-form', 'admin-nonce') }}">
<i class="fa fa-trash"></i>
</a>
</li>
{% endif %}
{% if grav.twig.plugins_quick_tray %}
{% for label, item in grav.twig.plugins_quick_tray %}
{% if authorize((item.authorize is defined and item.authorize is iterable) ? item.authorize : [item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %}
{% set data_tags = '' %}
{% if (item.data) %}
{% for key, value in item.data %}
{% set data_tags = data_tags ~ ' data-' ~ key ~ '="' ~ value ~ '"' %}
{% endfor %}
{% endif %}
<li class="{{ item.class }} hint--bottom" data-hint="{{ item.hint }}" {{ data_tags|raw }}>
{% if item.route %}
<a href="{{ url(item.route) }}" {% if item.target %}target="{{ item.target }}"{% endif %}>
<i class="fa fa-fw {{ item.icon }}"></i>
</a>
{% else %}
<i class="fa fa-fw {{ item.icon }}"></i>
{% endif %}
</li>
{% endif %}
{% endfor %}
{% else %}
{% if authorize(['admin.maintenance', 'admin.super']) %}
<li class="hint--bottom" data-hint="Add the 'quick-tray-links' plugin for more...">
<a href="{{ base_url_relative ~ '/plugins/install' }}">
<i class="fa fa-plus"></i>
</a>
</li>
{% endif %}
{% endif %}
</ul>
@@ -0,0 +1,3 @@
<button class="lines-button x" type="button" role="button" aria-label="Toggle Navigation" data-sidebar-mobile-toggle>
<span class="lines"></span>
</button>
@@ -0,0 +1,2 @@
{% set user_avatar = admin.user.getAvatarUrl() %}
<img src="{{ ('?' not in user_avatar) and (not user_avatar starts with 'data:') ? user_avatar ~ '?s=80' : user_avatar }}" />
@@ -0,0 +1,19 @@
<div id="offline-status">
<span><i class="fa fa-fw fa-plane"></i> You are offline</span>
</div>
{% set user = admin.user %}
{% set route = grav['flex_objects'] is defined ? grav['flex_objects'].adminRoute(user) : '' %}
{% if route == '' %}
{% set route = '/user/' ~ user.username %}
{% endif %}
<div id="admin-user-details">
<a href="{{ base_url_relative ~ route }}">
{% include 'partials/nav-user-avatar.html.twig' %}
<div class="admin-user-names">
<h4>{{ user.fullname|e }} {% if user.twofa_enabled and config.plugins.admin.twofa_enabled %}<span class="badge">2FA</span>{% endif %}</h4>
<h5>{{ user.title|e }}</h5>
</div>
</a>
</div>
@@ -0,0 +1,96 @@
{% set nav_hover = config.plugins.admin.sidebar.activate == 'hover' %}
{% if authorize(['admin.login', 'admin.super']) %}
<nav id="admin-sidebar" data-quickopen="{{ config.plugins.admin.sidebar.activate == 'hover' ? 'true' : 'false' }}" data-quickopen-delay="{{ config.plugins.admin.sidebar.hover_delay }}">
<div id="admin-logo" class="{{ nav_hover ? 'nav-hover' }}">
{% if not nav_hover %}
<div id="open-handle" data-sidebar-toggle><i class="fa fa-angle-right"></i></div>
{% endif %}
{% include 'partials/logo.html.twig' %}
</div>
{% include 'partials/nav-user-details.html.twig' %}
{% include 'partials/nav-quick-tray.html.twig' %}
<div class="admin-menu-wrapper">
<ul id="admin-menu">
<li class="{{ (location == 'dashboard') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}"><i class="fa fa-fw fa-th"></i><em>{{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</em></a>
</li>
{% if authorize(['admin.configuration', 'admin.super']) %}
<li class="{{ (location == 'system' or location == 'site' or location == 'config') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/config/{{ authorize(['admin.configuration_system']) ? 'system' : 'site' }}"><i class="fa fa-fw fa-wrench"></i><em>{{ "PLUGIN_ADMIN.CONFIGURATION"|tu }}</em></a>
</li>
{% endif %}
{% if authorize(['admin.pages', 'admin.super']) %}
<li class="{{ (location == 'pages') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/pages">
<i class="fa fa-fw fa-file-text-o"></i>
<em>{{ "PLUGIN_ADMIN.PAGES"|tu }}</em>
<span class="badges">
<span class="badge count">{{ admin.pagesCount }}</span>
</span>
</a>
</li>
{% endif %}
{% if grav.twig.plugins_hooked_nav %}
{% for label, item in grav.twig.plugins_hooked_nav %}
{% if authorize((item.authorize is defined and item.authorize is iterable) ? item.authorize : [item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %}
<li class="{{ (location == (item.location ?: item.route)) ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/{{ item.route ?: item.location }}">
<i class="fa fa-fw {{ item.icon }}"></i>
<em>{{ label|tu }}</em>
{% if item.badge %}
<span class="badges {% if item.badge.updates is defined %}with-updates{% endif %}">
{% if item.badge.updates is defined %}<span class="badge updates">{{ item.badge.updates }}</span>{% endif %}
<span class="badge count">{{ item.badge.count }}</span>
</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% if authorize(['admin.plugins', 'admin.super']) %}
<li class="{{ (location == 'plugins') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/plugins">
<i class="fa fa-fw fa-plug"></i>
<em>{{ "PLUGIN_ADMIN.PLUGINS"|tu }}</em>
<span class="badges">
<span class="badge updates"></span>
<span class="badge count">{{ admin.plugins|length }}</span>
</span>
</a>
</li>
{% endif %}
{% if authorize(['admin.themes', 'admin.super']) %}
<li class="{{ (location == 'themes') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/themes">
<i class="fa fa-fw fa-tint"></i>
<em>{{ "PLUGIN_ADMIN.THEMES"|tu }}</em>
<span class="badges">
<span class="badge updates"></span>
<span class="badge count">{{ admin.themes|length }}</span>
</span>
</a>
</li>
{% endif %}
{% if authorize(admin.toolsPermissions) %}
<li class="{{ (location == 'tools') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/tools">
<i class="fa fa-fw fa-briefcase"></i>
<em>{{ "PLUGIN_ADMIN.TOOLS"|tu }}</em>
</a>
</li>
{% endif %}
{% include 'partials/nav-pro.html.twig' ignore missing %}
<li>
<a href="{{ uri.addNonce(base_url_relative ~ '/task' ~ config.system.param_sep ~ 'logout', 'logout-form', 'logout-nonce') }}"><i class="fa fa-fw fa-sign-out"></i><em>{{ "PLUGIN_ADMIN.LOGOUT"|tu }}</em></a>
</li>
</ul>
</div>
</nav>
{% endif %}
@@ -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>
@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-dashboard">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}
@@ -0,0 +1,3 @@
{% for entry in notifications %}
<li class="single-notification {{ entry.type }}-notification"><span class="badge alert {{ entry.type }}">{{ entry.type|capitalize }}</span><a target="_blank" href="{{ entry.link }}" title="{{ entry.message|striptags|e('html_attr') }}">{{ entry.message|raw }}</a></li>
{% endfor %}
@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-plugins">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}
@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-themes">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}
@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-top">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}
@@ -0,0 +1,11 @@
<ul class="grav-menu">
{% for page in pages.children %}
<li class="{{ (admin.route and page.route == context.route) ? 'Selected' : '' }} {{ page.children.count > 0 ? 'hasChildren' : '' }}">
<a href="{{ base_url_relative }}/pages/{{ page.route|trim('/') }}"><em class="status {{ page.visible ? 'visible' : '' }}"></em>{{ page.menu }}</a>
{% if page.children.count > 0 %}
{% include 'partials/page-children.html.twig' with {pages: page} %}
{% endif %}
</li>
{% endfor %}
</ul>
@@ -0,0 +1,11 @@
{% set legend = {'VISIBLE':'', 'NON_ROUTABLE':'not-routable', 'NON_VISIBLE':'not-visible', 'MODULAR':'modular'} %}
<div id="pages-legend">
<strong>{{ 'PLUGIN_ADMIN.LEGEND'|tu }}:</strong>
<ul>
{% for key, class in legend %}
<li><i class="page-icon fa fa-fw fa-circle-o {{ class }}"></i> {{ ('PLUGIN_ADMIN.'~key)|tu }}</li>
{% endfor %}
</ul>
</div>
@@ -0,0 +1,20 @@
{% set form_id = form_id ? form_id : 'page-move' %}
{% set scope = scope ?: 'data.' %}
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-page-move>
{% for field in blueprints.fields %}
{% if field.type %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
<div class="block block-{{field.type}}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endfor %}
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
<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 class="button primary" name="task" value="save">{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
</div>
</form>
@@ -0,0 +1,63 @@
<table>
{% if plugin.author %}
<tr>
<td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
<td class="double">
{% if plugin.author.url %}
<a href="{{ plugin.author.url }}" target="_blank" rel="noopener noreferrer">{{ plugin.author.name }}</a>
{% else %}
{{ plugin.author.name }}
{% endif %}
{% if plugin.author.email %}
- <a href="mailto:{{ plugin.author.email }}">{{ plugin.author.email }}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% if plugin.homepage %}
<tr>
<td>{{ "PLUGIN_ADMIN.HOMEPAGE"|tu }}:</td>
<td class="double"><a href="{{ plugin.homepage }}" target="_blank" rel="noopener noreferrer">{{ plugin.homepage }}</a></td>
</tr>
{% endif %}
{% if plugin.demo %}
<tr>
<td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
<td class="double"><a href="{{ plugin.demo }}" target="_blank" rel="noopener noreferrer">{{ plugin.demo }}</a></td>
</tr>
{% endif %}
{% if plugin.bugs %}
<tr>
<td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
<td class="double"><a href="{{ plugin.bugs }}" target="_blank" rel="noopener noreferrer">{{ plugin.bugs }}</a></td>
</tr>
{% endif %}
{% if plugin.keywords %}
<tr>
<td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
<td class="double">{{ plugin.keywords|join(', ') }}</td>
</tr>
{% endif %}
{% if plugin.license %}
<tr>
<td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
<td class="double">{{ plugin.license }}</td>
</tr>
{% endif %}
{% if plugin.description %}
<tr>
<td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
<td class="double">{{ plugin.description_html|raw }}</td>
</tr>
{% endif %}
{% if plugin.readme or plugin.homepage %}
{% set readme_link = plugin.readme ?: plugin.docs|default(plugin.homepage ~ '/blob/master/README.md') %}
<tr>
<td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
<td class="double"><a href="{{ readme_link }}" target="_blank" rel="noopener noreferrer">{{ readme_link }}</a></td>
</tr>
{% endif %}
</table>
@@ -0,0 +1,62 @@
{% set gpm = admin.gpm() %}
{% set installed = gpm.isPluginInstalled(admin.route) %}
{% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
{% set gumroad_loaded = false %}
<div class="grav-update plugin" data-gpm-plugin="{{ admin.route }}">
</div>
<h1>
{{ plugin.name|e }}
{% if admin.isTeamGrav(plugin) %}
<small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_PLUGIN"|tu }}"></i></span></small>
{% endif %}
{% if admin.isPremiumProduct(plugin) %}
<small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
{% endif %}
{% if plugin.symlink %}
<small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.PLUGIN_SYMBOLICALLY_LINKED"|tu }}">
<i class="fa fa-fw fa-link"></i>
</small>
{% endif %}
<small>{{ plugin.version ? 'v' ~ plugin.version|e }}</small>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</h1>
<div class="gpm-item-info">
<i class="gpm-item-icon fa fa-fw fa-{{ plugin.icon }}"></i>
{% include 'partials/plugin-data.html.twig' with { plugin: plugin } %}
</div>
{% if (installed) %}
{% set data = admin.data('plugins/' ~ admin.route) %}
{% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
{% if (plugin.form.fields.enabled.type != 'hidden' and plugin.form.fields.tabs.fields.login.fields.enabled.type != 'hidden') %}
<div class="button-bar danger">
<span class="danger-zone"></span>
{% if not plugin.symlink %}
<a class="button button-reinstall-package hidden" href="#" data-remodal-target="reinstall-package"><i class="fa fa-fw fa-repeat"></i> {{ "PLUGIN_ADMIN.REINSTALL_PLUGIN"|tu }}</a>
{% endif %}
<a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_PLUGIN"|tu }}</a>
</div>
{% endif %}
{% else %}
<div class="button-bar success">
{% if (plugin.premium and not admin.license(plugin.slug)) %}
{% if not gumroad_loaded %}
{% set gumroad_loaded = true %}
<script src="//gumroad.com/js/gumroad.js"></script>
{% endif %}
<a class="gumroad-button button" href="https://gum.co/{{ plugin.premium.permalink }}" target="_blank" data-gumroad-single-product="true"><i class="fa fa-shopping-cart"></i> {{ "Buy Now"|tu }}</a>
{% else %}
<a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ plugin.slug }}" data-plugin-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL_PLUGIN"|tu }}</a>
{% endif %}
</div>
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% include 'partials/modal-add-package.html.twig' with { type: 'plugin' } %}
{% include 'partials/modal-update-packages.html.twig' with { type: 'plugin' } %}
{% include 'partials/modal-remove-package.html.twig' with { type: 'plugin', package: plugin } %}
{% include 'partials/modal-reinstall-package.html.twig' with { type: 'plugin', package: plugin } %}
@@ -0,0 +1,74 @@
{% set gumroad_loaded = false %}
<div class="grav-update plugins"></div>
{% if installing %}
{% include 'partials/release-toggle.html.twig' %}
{% endif %}
{% include 'partials/list-sort.html.twig' with { list_view: 'plugins' } %}
<h1>
{{ installing ? "PLUGIN_ADMIN.AVAILABLE_PLUGINS"|tu : "PLUGIN_ADMIN.INSTALLED_PLUGINS"|tu }}
</h1>
<form>
<div class="gpm-search">
<input type="text" placeholder="{{ "PLUGIN_ADMIN.RESOURCE_FILTER"|tu }}" data-gpm-filter>
</div>
</form>
<table>
{% for slug, plugin in admin.plugins(not installing).toArray|ksort %}
{% set data = admin.data('plugins/' ~ slug) %}
{% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
{% set releaseDate = plugin.date ?: admin.gpm.findPackage(slug, true).date %}
<tr data-gpm-plugin="{{ slug|url_encode }}" data-gpm-name="{{ plugin.name }}" data-gpm-release-date="{{ releaseDate }}" data-gpm-author="{{ plugin.author.name }}" data-gpm-official="{{ admin.isTeamGrav(plugin) ? '1' : '2' }}" data-gpm-updatable="{{ admin.gpm.isUpdatable(slug) ? '1' : '2' }}" data-gpm-enabled="{{ data.get('enabled') ? '1' : '2' }}" data-gpm-testing="{{ isTestingRelease ? '1' : '2' }}">
<td class="gpm-name quadruple">
<i class="fa fa-fw fa-{{ plugin.icon }}"></i>
<a href="{{ base_url_relative }}/plugins/{{ slug|url_encode }}">{{ plugin.name }}</a>
{% if admin.isTeamGrav(plugin) %}
<small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_PLUGIN"|tu }}"></i></span></small>
{% endif %}
{% if admin.isPremiumProduct(plugin) %}
{% if not gumroad_loaded %}
{% set gumroad_loaded = true %}
<script src="//gumroad.com/js/gumroad.js"></script>
{% endif %}
<small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
{% endif %}
{% if plugin.symlink %}
<span class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.PLUGIN_SYMBOLICALLY_LINKED"|tu }}">
<i class="fa fa-fw fa-link"></i>
</span>
{% endif %}
<span class="gpm-version">v{{ plugin.version }}</span>
{% 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')) %}
<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>
{% elseif (installing) %}
{% if (plugin.premium and not admin.license(plugin.slug)) %}
{% if not gumroad_loaded %}
{% set gumroad_loaded = true %}
<script src="//gumroad.com/js/gumroad.js"></script>
{% endif %}
<a class="gumroad-button button" href="https://gum.co/{{ plugin.premium.permalink }}" target="_blank" data-gumroad-single-product="true"><i class="fa fa-shopping-cart"></i> {{ "Buy Now"|tu }}</a>
{% else %}
<a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ plugin.slug }}" data-plugin-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL"|tu }}</a>
{% endif %}
{% endif %}
<span class="gpm-details-expand"><i class="fa fa-chevron-down"></i></span>
</td>
<td class="gpm-details">
<div class="table-wrapper">
{% include 'partials/plugin-data.html.twig' with { plugin: plugin } %}
</div>
</td>
</tr>
{% else %}
<tr><td>{{ "PLUGIN_ADMIN.OFFLINE_WARNING"|tu }}</td></tr>
{% endfor %}
</table>
{% include 'partials/modal-add-package.html.twig' with { type: 'plugin' } %}
{% include 'partials/modal-update-packages.html.twig' with { type: 'plugin' } %}

Some files were not shown because too many files have changed in this diff Show More