first commit

This commit is contained in:
2018-08-01 16:00:05 +02:00
commit 944fd76206
3205 changed files with 356767 additions and 0 deletions
@@ -0,0 +1,86 @@
{% 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 %}
{% 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 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 %}
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
{% endif %}
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% endblock %}
@@ -0,0 +1,69 @@
{% 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>
</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,108 @@
{% set originalValue = originalValue is defined ? originalValue : value %}
{% set toggleableChecked = field.toggleable and (originalValue is not null and originalValue is not empty) %}
{% set isDisabledToggleable = field.toggleable and not toggleableChecked %}
{% set value = (value is null ? field.default : value) %}
{% set vertical = field.style == 'vertical' %}
{% set field_name = (scope ~ field.name)|fieldName %}
{% if (field.yaml or field.validate.type == 'yaml') and value is iterable%}
{% set value = value|toYaml %}
{% endif %}
{% 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 in ['on', 'off', 'new-password'] %}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.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>
{% endblock %}
</div>
{% endblock %}
@@ -0,0 +1,78 @@
{% extends "forms/field.html.twig" %}
{% 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 %}
{% 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 %}
<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 %} />
<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 %}
{% block input %}
{% import _self as array_field %}
<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 %}
<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 }}" />
<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,8 @@
<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 }}" />
@@ -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,10 @@
{% if field.fields %}
<div class="form-column block pure-u-1-{{ cols }}">
{% 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 %}
@@ -0,0 +1,9 @@
<div class="form-columns grid pure-g">
{% if field.fields %}
{% set cols = field.fields|length %}
{% for field in field.fields %}
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/column/column.html.twig'] with {'cols':cols} %}
{% endfor %}
{% endif %}
</div>
@@ -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,46 @@
{% 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 label %}
{% if field.label %}
{% set hint = field.help ? 'data-hint="' ~ field.help|tu|raw ~ '"': '' %}
<div class="form-label form-field hint--bottom" {{ hint }}>{{ field.label|tu|raw }}</div>
{% endif %}
{% endblock %}
{% block field %}
<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,96 @@
{% extends "forms/field.html.twig" %}
{% block field %}
<div class="form-fieldset{% if vertical %} vertical{% 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 %}
<p>{% if grav.twig.twig.filters['tu'] is defined %}{{ field.text|tu }}{% else %}{{ field.text|t }}{% endif %}
<p>
{% 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,89 @@
{% extends "forms/field.html.twig" %}
{% set defaults = config.plugins.form %}
{% set files = defaults.files|merge(field|default([])) %}
{% set limit = not field.multiple ? 1 : files.limit %}
{% 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 = global.admin.getPagePathFromToken(path) %}
{% set remove = global.file_url_remove ? global.file_url_remove : (global.base_url_relative ~ '/media.json') %}
{% set remove = uri.addNonce(
remove ~
'/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: (uri.rootUrl == '/' ? '/' : uri.rootUrl ~ '/' ~ real_path) }) %}
<div class="hidden" data-file="{{ file|json_encode|e('html_attr') }}"></div>
{% endif %}
{% endmacro %}
{% block input %}
{% set upload_limit = config.system.media.upload_limit / 1024 / 1024 %}
{% 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 type is not defined or page_can_upload %}
{% set settings = {name: field.name, paramName: (scope ~ field.name)|fieldName ~ (files.multiple ? '[]' : ''), limit: limit, filesize: upload_limit, accept: files.accept, resolution: files.resolution, resizeWidth: files.resizeWidth, resizeHeight: files.resizeHeight, resizeQuality: files.resizeQuality } %}
<div class="form-input-wrapper dropzone files-upload {% if field.fancy is not same as(false) %}form-input-file{% endif %} {{ field.size|default('xlarge') }}" data-grav-file-settings="{{ settings|json_encode|e('html_attr') }}" {% if file_url_add %}data-file-url-add="{{ file_url_add }}"{% endif %} {% if file_url_remove %}data-file-url-remove="{{ file_url_remove }}"{% endif %}>
<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 %}
{{ parent() }}
{% endblock %}
/>
{% for path, file in value %}
{{ _self.preview(path, file, _context) }}
{% endfor %}
{% include 'forms/fields/hidden/hidden.html.twig' with {field: {name: '_json.' ~ field.name}, value:value|raw|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,26 @@
{% extends "forms/field.html.twig" %}
{% block input %}
<div class="form-input-wrapper {{ field.size }}">
<input
type="text"
value="{{ value|e('html_attr')|join(', ') }}"
data-key-observe="{{ (scope ~ field.name)|fieldName }}"
{% 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 %}
/>
</div>
{% endblock %}
@@ -0,0 +1,194 @@
{% 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 %}
{%- if childName == 'value' -%}
{% set childKey = '' %}
{% set childValue = val %}
{% set childName = itemName -%}
{%- elseif childName starts with '.' -%}
{% set childKey = childName|trim('.') %}
{% set childValue = val[childName[1:]] %}
{% 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 %}
{% 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,116 @@
{% extends "forms/field.html.twig" %}
{% 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 %}
{% macro renderer(key, content, field, scope, level, parent_key, up_level) %}
{% 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 %}
{% 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">
{{ _self.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,51 @@
{% set value = (value is null ? field.default : value) %}
{% set siblings = data.parent.children %}
{% set canOrder = data.order %}
{% set vertical = field.style == 'vertical' %}
<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>
@@ -0,0 +1,49 @@
{% set value = (value is null ? field.default : value) %}
{% 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
} %}
{% if context.folderExists %}
<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">
{% set uploadLimit = grav.config.system.media.upload_limit / 1024 / 1024 %}
{% set dropzoneSettings = { maxFileSize: uploadLimit }|merge(pagemedia_settings) %}
<div id="grav-dropzone"
class="dropzone"
data-media-url="{{ base_url }}/media/{{ admin.route|trim('/') }}.json"
data-media-local="{{ base_url_relative_frontend|rtrim('/') }}/{{ admin.route|trim('/') }}"
data-media-path="{{ url(context.relativePagePath) }}"
data-media-uri="{{ context.mediaUri }}"
data-dropzone-options="{{ dropzoneSettings|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 %}
@@ -0,0 +1,2 @@
{% extends "forms/fields/filepicker/filepicker.html.twig" %}
@@ -0,0 +1,50 @@
{% 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 %}
{% 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 %}
{{ _self.page_options(_context, page_list) }}
</select>
</div>
{% endblock %}
@@ -0,0 +1,20 @@
{% 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_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 defaults = {show_root:true, show_all:true, 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,68 @@
{% extends "forms/field.html.twig" %}
{% 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 %}
{% macro spanToggle(input, length) %}
{% set space = repeat('&nbsp;&nbsp;', (length - input|length) / 2) %}
{{ (space ~ input ~ space)|raw }}
{% endmacro %}
{% 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 }}">{{ (_self.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,22 @@
{% if field.security is empty or authorize(array(field.security)) %}
{% if field.title or field.underline %}
<h1 {% if not field.underline %}class="no_underline"{% endif %}>{% 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 }}">
{% 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 %}
@@ -0,0 +1,11 @@
{% extends "forms/field.html.twig" %}
{% block global_attributes %}
data-grav-selectize="{{ (field.selectize is defined ? field.selectize|merge({'create': true}) : {'create': true})|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,10 @@
{% if field.fields %}
<div class="form-tab">
{% 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 %}
@@ -0,0 +1,44 @@
<div class="form-tabs {{ field.class }} {{ field.classes }}">
{% if field.fields %}
{% set tabsKey = field.fields|keys|join('.') %}
{% set storedValue = get_cookie('grav-tabs-state')|default('{}')|json_decode %}
{% set storedTab = attribute(storedValue, 'tab-' ~ tabsKey) %}
{% if storedTab is empty %}
{% if uri.params.tab %}
{% set active = uri.params.tab %}
{% elseif field.active %}
{% set active = field.active %}
{% else %}
{% set active = 1 %}
{% endif %}
{% endif %}
<div class="tabs-nav">
{% for tab in field.fields %}
{% if tab.type == 'tab' and (tab.security is empty or authorize(array(tab.security))) %}
<a class="tab__link {{ (storedTab == scope ~ tab.name) or active == loop.index ? 'active' : '' }}" data-tabid="tab-{{ tabsKey ~ loop.index }}" data-tabkey="tab-{{ tabsKey }}" data-scope="{{ scope ~ tab.name }}">
<span>
{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}
</span>
</a>
{% endif %}
{% endfor %}
</div>
<div class="tabs-content">
{% for field in field.fields %}
{% if field.type == 'tab' %}
{% if field.security is empty or authorize(array(field.security)) %}
{% set value = field.name ? data.value(field.name) : data.toArray %}
<div id="tab-{{ tabsKey ~ loop.index }}" class="tab__content {{ (storedTab == scope ~ field.name) or active == loop.index ? 'active' : '' }}">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
@@ -0,0 +1,26 @@
{% 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 %}
@@ -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,60 @@
{% extends "forms/field.html.twig" %}
{% set value = (value is null ? field.default : value) %}
{% set value = (value is same as(false) ? 0 : value) %}
{% set has_hidden = false %}
{% for key, text in field.options %}
{% if key is empty %}
{% set has_hidden = true %}
{% endif %}
{% endfor %}
{% block global_attributes %}
{{ parent() }}
data-grav-field-name="{{ (scope ~ field.name)|fieldName }}"
{% endblock %}
{% macro spanToggle(input, length) %}
{% set space = repeat('&nbsp;&nbsp;', (length - input|length) / 2) %}
{{ (space ~ input ~ space)|raw }}
{% endmacro %}
{% block input %}
<div class="switch-toggle switch-grav {{ field.size }} switch-{{ field.options|length }} {{ field.classes }}">
{% set maxLen = 0 %}
{% for text in field.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 field.options %}
{% set id = "toggle_" ~ field.name ~ 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)|fieldName }}"
{% if field.highlight is defined %}
class="{{ field.highlight == '' ~ key ? 'highlight' : '' }}"
{% endif %}
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
{% if field.toggleable %}
{% if '' ~ key == '' ~ value %}
checked="checked"
{% elseif value is defined and (key == 1 or key == '1') %}
checked="checked"
{% endif %}
{% else %}
{% if '' ~ key == '' ~ value %}
checked="checked"
{% endif %}
{% endif %}
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
/>
<label for="{{ id }}">{{ (_self.spanToggle(translation, maxLen)|trim)|raw }}</label>
{% endfor %}
</div>
{% endblock %}
@@ -0,0 +1,15 @@
<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>
@@ -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,416 @@
{% 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 %}
{% 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 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 %}
{% macro loop(page, depth, twig_vars) %}
{% 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) %}
<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 %}
{% 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>
{% 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.menu }}
</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>
{% 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 = _self.spanToggle(normalText, maxLen) %}
{% set expertText = _self.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>
{% 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">
{{ _self.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>
<br>
<div class="button-bar">
<button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</button>
<a class="button disable-after-click" data-delete-action href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</form>
</div>
{% include 'partials/admin-pro-pages-addons.html.twig' ignore missing %}
{% endblock %}
{% block bottom %}
<script>
{{ parent() }}
$('.admin-pages .form-tabs .tabs-nav').css('margin-right', ($('#admin-topbar').width() + 20) + 'px');
</script>
{% endblock %}
@@ -0,0 +1,123 @@
{% if uri.extension() == 'json' %}{% include 'default.json.twig' %}{% else %}
{% set icon_style = config.plugins.admin.admin_icons %}
<!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' %}
{{ assets.css()|raw }}
{% endblock %}
{% include 'partials/javascript-config.html.twig' %}
{% block javascripts %}
{% include 'partials/javascripts.html.twig' %}
{{ assets.js()|raw }}
{% endblock %}
{% endblock %}
</head>
{% block body %}
<body class="ga-theme-17x {{ config.plugins.admin.sidebar.size == 'small' ? 'sidebar-closed' : '' }} {{ config.plugins.admin.body_classes }} {{ body_classes }}">
{% 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">{{ 'PLUGIN_ADMIN.ADMIN_REPORT_ISSUE'|tu }}</a></div>
{% endif %}
{% block content_bottom %}{% endblock %}
</div>
{% block footer %}
<footer id="footer">
<a href="http://getgrav.org">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">Trilby Media</a>.
</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 %}
{% 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,29 @@
{% 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 ? 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 %}
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</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>
<button data-ajax="{{ uri.addNonce(base_url_relative ~ '/backup.json/task' ~ config.system.param_sep ~ 'backup', 'admin-form', 'admin-nonce') }}" class="button"><i class="fa fa-database"></i> {{ "PLUGIN_ADMIN.BACKUP"|tu }}</button>
</div>
</div>
</div>
{% include 'partials/modal-update-packages.html.twig' with { type: 'plugin' } %}
{% endif %}
@@ -0,0 +1,12 @@
<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,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,30 @@
{% 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 %}
<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: {{ notifications }},
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,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 secondary-accent' }}">
<div class="form-actions primary-accent">
<button type="submit" class="button primary" name="task" value="twofa">{{ 'PLUGIN_LOGIN.BTN_LOGIN'|t }}</button>
</div>
</div>
{% endblock %}
{% endembed %}
@@ -0,0 +1,35 @@
{% 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 }}">
<h1>
{{ title }}
</h1>
{% include 'partials/messages.html.twig' %}
{% block instructions %}{% endblock %}
{% block integration %}{% endblock %}
{% set redirect = redirect ?: uri.path %}
<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-bookmark-o"></i></a>
</h3>
{% else %}
<div class="admin-logo">
<a href="{{ base_url_relative }}">
<svg id="grav-logo-small" class="grav-logo" width="100%" height="100%" viewBox="0 0 91 103" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g transform="matrix(1,0,0,1,-411.231,-328.021)"><path d="M498.522,382.22L487.883,382.22C486.266,382.22 484.953,383.536 484.953,385.158L484.953,405.594L484.744,405.77C478.482,411.052 470.564,413.956 462.45,413.956C443.311,413.956 427.739,398.384 427.739,379.241C427.739,360.097 443.311,344.527 462.45,344.527C469.893,344.527 477.01,346.883 483.034,351.344C484.203,352.21 485.825,352.091 486.856,351.064L494.441,343.477C495.034,342.888 495.342,342.07 495.294,341.235C495.248,340.4 494.847,339.627 494.189,339.106C485.176,331.956 473.905,328.021 462.45,328.021C434.21,328.021 411.232,350.998 411.232,379.241C411.232,407.485 434.21,430.46 462.45,430.46C477.032,430.46 490.979,424.187 500.713,413.242C501.191,412.705 501.455,412.014 501.455,411.295L501.455,385.158C501.455,383.536 500.142,382.22 498.522,382.22" style="fill-rule:nonzero;"/></g></svg>
<svg id="grav-logo-large" class="grav-logo" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" viewBox="0 0 444 103" clip-rule="evenodd"><path d="M87.3 54.2H76.64c-1.6 0-2.93 1.3-2.93 2.94v20.43l-.2.18c-6.27 5.28-14.2 8.2-22.3 8.2-19.14-.02-34.7-15.6-34.7-34.73 0-19.14 15.56-34.7 34.7-34.7 7.44 0 14.56 2.34 20.58 6.8 1.17.87 2.8.75 3.83-.28l7.58-7.58c.6-.6.9-1.4.86-2.25-.04-.82-.44-1.6-1.1-2.12C73.94 3.94 62.66 0 51.22 0 22.98 0 0 22.98 0 51.22s22.98 51.22 51.22 51.22c14.58 0 28.53-6.27 38.26-17.22.48-.54.74-1.23.74-1.95V57.14c0-1.63-1.3-2.94-2.93-2.94M443.24 4.7c-.54-.8-1.47-1.3-2.45-1.3h-11.6c-1.16 0-2.22.68-2.68 1.76l-32.65 75.8-33.22-75.82c-.47-1.06-1.53-1.75-2.7-1.75h-11.6c-1 0-1.92.5-2.46 1.32-.55.83-.65 1.87-.24 2.78l40.24 91.8c.47 1.08 1.53 1.77 2.7 1.77h14.65c1.17 0 2.23-.7 2.7-1.77L443.5 7.48c.37-.9.28-1.95-.26-2.77"/><path d="M291.1 5.14c-.48-1.06-1.53-1.75-2.7-1.75h-14.65c-1.17 0-2.23.68-2.7 1.76l-39.53 91.8c-.4.92-.3 1.96.24 2.78.54.83 1.46 1.33 2.45 1.33h11.6c1.16 0 2.22-.7 2.7-1.77l32.62-75.8 33.23 75.8c.47 1.08 1.52 1.77 2.68 1.77h11.63c1 0 1.92-.5 2.45-1.33.56-.83.64-1.88.25-2.8L291.1 5.15zM185.1 67.48l.65-.3c11.56-5.6 19.03-17.45 19.03-30.23 0-18.5-15.05-33.56-33.56-33.56h-42.5c-1.6 0-2.92 1.3-2.92 2.92v91.8c0 1.63 1.3 2.95 2.93 2.95h10.64c1.62 0 2.93-1.3 2.93-2.94V19.9h28.92c9.4 0 17.06 7.64 17.06 17.05 0 7.85-5.33 14.65-12.97 16.55-1.36.34-2.74.52-4.08.52h-10.64c-1.1 0-2.1.62-2.6 1.6-.5 1-.42 2.17.24 3.07l30.16 41.17c.55.75 1.42 1.2 2.36 1.2h13.22c1.1 0 2.12-.62 2.6-1.6.52-1 .42-2.18-.24-3.07l-21.2-28.92z"/></svg>
</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,46 @@
<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">
{{ _self.loop(pages, 0, _context) }}
</ul>
</div>
</div>
{% macro loop(page, depth, twig_vars) %}
{% 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 %}
@@ -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) }}">
<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 @@
<img src="{{ admin.user.avatarUrl() }}?s=47" />
@@ -0,0 +1,13 @@
<div id="offline-status">
<span><i class="fa fa-fw fa-plane"></i> You are offline</span>
</div>
<div id="admin-user-details">
<a href="{{ base_url_relative }}/user/{{ admin.user.username|e }}">
{% include 'partials/nav-user-avatar.html.twig' %}
<div class="admin-user-names">
<h4>{{ admin.user.fullname|e }} {% if admin.user.twofa_enabled %}<span class="badge">2FA</span>{% endif %}</h4>
<h5>{{ admin.user.title|e }}</h5>
</div>
</a>
</div>
@@ -0,0 +1,95 @@
{% 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 }}">
{% if config.plugins.admin.sidebar.activate != 'hover' %}
<div id="open-handle" data-sidebar-toggle><i class="fa fa-angle-right"></i></div>
{% endif %}
<div id="admin-logo">
{% 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/system"><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.tools', 'admin.super']) %}
<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,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">{{ 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">{{ 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">{{ 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">{{ 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">{{ 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.product_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.product_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' } %}
@@ -0,0 +1,24 @@
{% extends 'partials/base.html.twig' %}
{% set scope = scope ?: 'data.' %}
{% block body %}
<body id="admin-login-wrapper">
<section id="admin-login" class="default-glow-shadow {{ classes }}">
<h1>
{{ title }}
</h1>
{% include 'partials/messages.html.twig' %}
{% block instructions %}{% endblock %}
<form method="post" action="{{ base_url_relative }}">
<div class="padding">
{% block form %}{% endblock %}
{{ nonce_field('form', 'form-nonce')|raw }}
</div>
</form>
</section>
</body>
{% endblock %}
@@ -0,0 +1,9 @@
<form id="gpm-release-toggle">
<div class="switch-toggle switch-grav" data-url="{{ base_url }}/ajax.json/task:gpmRelease">
<input type="radio" value="stable" id="stable" name="channel-switch" class="highlight" {% if config.system.gpm.releases == 'stable' %} checked="checked"{% endif %}>
<label for="stable">{{ "PLUGIN_ADMIN.STABLE"|tu }}</label>
<input type="radio" value="testing" id="testing" name="channel-switch" class="highlight" {% if config.system.gpm.releases == 'testing' %} checked="checked"{% endif %}>
<label for="testing">{{ "PLUGIN_ADMIN.TESTING"|tu }}</label>
<a></a>
</div>
</form>
@@ -0,0 +1,3 @@
<div class="spinning-wheel" style="display: none">
{{ "PLUGIN_ADMIN.LOADING"|tu|e }} <i class="fa fa-spinner fa-spin"></i>
</div>
@@ -0,0 +1,17 @@
{% do assets.addCss(theme_url~'/css-compiled/nucleus.css') %}
{% do assets.addCss(theme_url~'/css-compiled/template.css') %}
{% do assets.addCss(theme_url~'/css-compiled/preset.css') %}
{% if config.plugins.admin.google_fonts %}
{% do assets.addCss(theme_url~'/css-compiled/fonts.css') %}
{% else %}
{% do assets.addCss(theme_url~'/css-compiled/simple-fonts.css') %}
{% endif %}
{% do assets.addCss(theme_url~'/css/'~icon_style~'.min.css') %}
{% do assets.addCss(theme_url~'/css/chartist.min.css') %}
{% do assets.addCss(theme_url~'/css/selectize.min.css') %}
{% do assets.addCss(theme_url~'/css/hint.base.min.css') %}
{% do assets.addCss(theme_url~'/css/iconpicker.css') %}
{% if browser.getBrowser == 'msie' and browser.getVersion >= 8 and browser.getVersion <= 9 %}
{% do assets.addCss(theme_url~'/css/nucleus-ie9.css') %}
{% do assets.addCss(theme_url~'/css/pure-0.5.0/grids-min.css') %}
{% endif %}
@@ -0,0 +1,13 @@
{% set theme = admin.themes[admin.route] %}
{% set blueprints = theme.blueprints() %}
<h1>
{{ blueprints.get('name')|e }}
<small>{{ blueprints.get('version') ? 'v' ~ blueprints.get('version')|e }}</small>
</h1>
{% include 'partials/messages.html.twig' %}
<p>{{ blueprints.get('description') }}</p>
{% include 'partials/blueprints.html.twig' with { data: theme } %}
@@ -0,0 +1,120 @@
{% set gpm = admin.gpm() %}
{% set installed = gpm.isThemeInstalled(admin.route) %}
{% set isTestingRelease = gpm.isTestingRelease(plugin.slug) %}
<div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
</div>
<h1>
{{ theme.name|e }}
{% if admin.isTeamGrav(theme) %}
<small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|tu }}"></i></span></small>
{% endif %}
{% if admin.isPremiumProduct(theme) %}
<small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
{% endif %}
{% if theme.symlink %}
<small class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|tu }}">
<i class="fa fa-fw fa-link"></i>
</small>
{% endif %}
<small>{{ theme.version ? 'v' ~ theme.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-{{ theme.icon }}"></i>
<table>
{% if theme.version %}
<tr>
<td>{{ "PLUGIN_ADMIN.VERSION"|tu }}:</td>
<td class="double">{{ theme.version }}</td>
</tr>
{% endif %}
{% if theme.author %}
<tr>
<td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
<td class="double">
{% if theme.author.url %}
<a href="{{ theme.author.url }}" target="_blank">{{ theme.author.name }}</a>
{% else %}
{{ theme.author.name }}
{% endif %}
{% if theme.author.email %}
- <a href="mailto:{{ theme.author.email }}">{{ theme.author.email }}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% if theme.homepage %}
<tr>
<td>{{ "PLUGIN_ADMIN.HOMEPAGE"|tu }}:</td>
<td class="double"><a href="{{ theme.homepage }}" target="_blank">{{ theme.homepage }}</a></td>
</tr>
{% endif %}
{% if theme.demo %}
<tr>
<td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
<td class="double"><a href="{{ theme.demo }}" target="_blank">{{ theme.demo }}</a></td>
</tr>
{% endif %}
{% if theme.bugs %}
<tr>
<td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
<td class="double"><a href="{{ theme.bugs }}" target="_blank">{{ theme.bugs }}</a></td>
</tr>
{% endif %}
{% if theme.keywords %}
<tr>
<td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
<td class="double">
{{ theme.keywords|join(', ') }}
</td>
</tr>
{% endif %}
{% if theme.license %}
<tr>
<td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
<td class="double">{{ theme.license }}</td>
</tr>
{% endif %}
{% if theme.description %}
<tr>
<td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
<td class="double">{{ theme.description_html|raw }}</td>
</tr>
{% endif %}
{% if theme.readme or theme.homepage %}
{% set readme_link = theme.readme ?: theme.homepage ~ '/blob/master/README.md' %}
<tr>
<td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
<td class="double"><a href="{{ readme_link }}" target="_blank">{{ readme_link }}</a></td>
</tr>
{% endif %}
</table>
</div>
{% if (installed) %}
{% set data = admin.data('themes/' ~ admin.route) %}
{% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %}
{% if (config.get('system.pages.theme') != admin.route) %}
<div class="button-bar danger">
<span class="danger-zone"></span>
{% if not theme.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_THEME"|tu }}</a>
{% endif %}
<a class="button" href="#" data-remodal-target="remove-package"><i class="fa fa-fw fa-warning"></i> {{ "PLUGIN_ADMIN.REMOVE_THEME"|tu }}</a>
</div>
{% endif %}
{% else %}
<div class="button-bar success">
<a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ theme.slug }}" data-theme-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL_THEME"|tu }}</a>
</div>
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% include 'partials/modal-remove-package.html.twig' with { type: 'theme', package: theme } %}
{% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
{% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}
{% include 'partials/modal-reinstall-package.html.twig' with { type: 'theme', package: theme } %}
@@ -0,0 +1,82 @@
<div class="grav-update themes"></div>
{% if installing %}
{% include 'partials/release-toggle.html.twig' %}
{% endif %}
{% include 'partials/list-sort.html.twig' with { list_view: 'themes' } %}
<h1>
{{ installing ? "PLUGIN_ADMIN.AVAILABLE_THEMES"|tu : "PLUGIN_ADMIN.INSTALLED_THEMES"|tu }}
</h1>
<form>
<div class="gpm-search">
<input type="text" placeholder="{{ "PLUGIN_ADMIN.RESOURCE_FILTER"|tu }}" data-gpm-filter>
</div>
</form>
<div class="themes card-row grid fixed-blocks pure-g">
{% for slug, theme in admin.themes(not installing).toArray|ksort %}
{% set state = 'inactive' %}
{% if (installing) %}{% set state = 'installing' %}{% endif %}
{% if (config.get('system.pages.theme') == slug) %}{% set state = 'active' %}{% endif %}
{% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
{% set releaseDate = theme.date ?: admin.gpm.findPackage(slug, true).date %}
<div class="theme card-item pure-u-1-3 {{ state }}-theme" data-gpm-theme="{{ slug|url_encode }}" data-gpm-name="{{ theme.name }}" data-gpm-release-date="{{ releaseDate }}" data-gpm-author="{{ theme.author.name }}" data-gpm-official="{{ admin.isTeamGrav(theme) ? '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' }}">
<div class="gpm-name">
<i class="fa fa-fw fa-{{ theme.icon }}"></i>
<a href="{{ base_url_relative }}/themes/{{ slug|url_encode }}">{{ theme.name }}</a>
{% if admin.isTeamGrav(theme) %}
<small><span class="info-reverse"><i class="fa fa-check-circle" title="{{ "PLUGIN_ADMIN.GRAV_OFFICIAL_THEME"|tu }}"></i></span></small>
{% endif %}
{% if admin.isPremiumProduct(theme) %}
<small><span class="badge warning premium"><i class="fa fa-star-o"></i> {{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|tu }}</span></small>
{% endif %}
{% if theme.symlink %}
<span class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.THEME_SYMBOLICALLY_LINKED"|tu }}">
<i class="fa fa-fw fa-link"></i>
</span>
{% endif %}
<span class="gpm-version">v{{ theme.version }}</span>
{% if isTestingRelease %}<span class="gpm-testing">test release</span>{% endif %}
</div>
<div class="gpm-screenshot">
{% set thumb = installing ? '//getgrav.org/images/' ~ theme.screenshot : theme.thumbnail %}
<a href="{{ base_url_relative }}/themes/{{ slug|url_encode }}"><img src="{{ thumb }}" /></a>
</div>
{% if (state == 'installing') %}
<div class="gpm-actions">
<a class="button" href="#" data-remodal-target="add-package" data-packages-slugs="{{ slug }}" data-theme-action="start-package-installation"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.INSTALL"|tu }}</a>
</div>
{% elseif state == 'active' %}
<div class="gpm-actions">
<i class="fa fa-star"></i> {{ "PLUGIN_ADMIN.ACTIVE_THEME"|tu }}
</div>
{% else %}
<a data-remodal-target="theme-switch-warn" href="{{ uri.addNonce(base_url_relative ~ '/themes/' ~ slug ~ '/task' ~ config.system.param_sep ~ 'activate', 'admin-form', 'admin-nonce') }}" class="gpm-actions">
{{ "PLUGIN_ADMIN.ACTIVATE"|tu }}
</a>
{% endif %}
</div>
{% else %}
<tr><td>{{ "PLUGIN_ADMIN.OFFLINE_WARNING"|tu }}</td></tr>
{% endfor %}
</div>
<div class="remodal theme-switcher" data-remodal-id="theme-switch-warn" data-remodal-options="hashTracking: false">
<form>
<h1>{{ "PLUGIN_ADMIN.SWITCHING_TO"|tu }} <strong>{theme_name}</strong></h1>
<p class="bigger">
{{ "PLUGIN_ADMIN.SWITCHING_TO_DESCRIPTION"|tu }}
</p>
<p class="bigger">
{{ "PLUGIN_ADMIN.SWITCHING_TO_CONFIRMATION"|tu }} <strong>{theme_name}</strong>?
</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>
<a class="button continue" href="#"><i class="fa fa-fw fa-check"></i>{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
</div>
</form>
</div>
{% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
{% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}
@@ -0,0 +1,30 @@
<h1>{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_TITLE"|tu }}</h1>
<div class="direct-install-content">
<h2>{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_UPLOAD_TITLE"|tu }}</h2>
<p>{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_UPLOAD_DESC"|tu|raw }}</p>
<form action="{{ base_url_relative }}/tools/task:directInstall" method="post" enctype="multipart/form-data">
<input type="file" name="uploaded_file" id="uploaded_file" required accept="application/zip, application/octet-stream">
<input type="submit" value="{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_UPLOAD_BUTTON"|tu }}" name="submit" class="button">
<input type="hidden" name="task" value="directInstall" />
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</form>
<h2>{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_URL_TITLE"|tu }}</h2>
<p>{{ "PLUGIN_ADMIN.TOOLS_DIRECT_INSTALL_URL_DESC"|tu|raw }}</p>
<form action="{{ base_url_relative }}/tools/task:directInstall" method="post">
<input type="text" name="file_path" class="large" required />
<input type="submit" value="{{ "PLUGIN_ADMIN.INSTALL"|tu }}" name="submit" class="button">
<input type="hidden" name="task" value="directInstall" />
{{ nonce_field('admin-form', 'admin-nonce')|raw }}
</form>
</div>
@@ -0,0 +1 @@
<p class="gravatar">{{ "PLUGIN_ADMIN.AVATAR_BY"|tu }} <a href="https://gravatar.com" target="_blank">gravatar.com</a>. {{ "PLUGIN_ADMIN.AVATAR_UPLOAD_OWN"|tu }}</p>

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