import from la bonne adresse and first refactoring for ouidade.com
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{% if admin.json_response %}
|
||||
{{ admin.json_response|json_encode }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if admin.json_response %}
|
||||
{{ admin.json_response|json_encode }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,151 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
{% if authorize(['admin.maintenance', 'admin.super']) %}
|
||||
<div class="button-group">
|
||||
<button data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache" 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="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}all" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ALL_CACHE"|tu }}</a></li>
|
||||
<li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}assets-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_ASSETS_ONLY"|tu }}</a></li>
|
||||
<li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}images-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_IMAGES_ONLY"|tu }}</a></li>
|
||||
<li><a data-clear-cache="{{ base_url_relative }}/cache.json/task{{ config.system.param_sep }}clearCache/cleartype{{ config.system.param_sep }}cache-only" href="#">{{ "PLUGIN_ADMIN.CLEAR_CACHE_CACHE_ONLY"|tu }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<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 messages %}{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
|
||||
{% set gpm = admin.gpm() %}
|
||||
{% set updatable = gpm.getUpdatablePlugins() %}
|
||||
{% set backup = admin.lastBackup() %}
|
||||
|
||||
<div id="admin-dashboard">
|
||||
{% if authorize(['admin.maintenance', 'admin.super']) %}
|
||||
<div id="updates" class="dashboard-item dashboard-left">
|
||||
<div class="tertiary-accent default-box-shadow">
|
||||
<h1>{{ "PLUGIN_ADMIN.MAINTENANCE"|tu }}</h1>
|
||||
<div class="admin-update-charts">
|
||||
<div class="updates-chart">
|
||||
<div class="chart-wrapper">
|
||||
<div class="ct-chart"></div>
|
||||
<span class="numeric hidden"><span>-</span><em>{{ "PLUGIN_ADMIN.UPDATED"|tu|lower }}</em></span>
|
||||
</div>
|
||||
<p class="js__updates-available-description"> </p>
|
||||
</div>
|
||||
<div class="backups-chart">
|
||||
<div class="chart-wrapper">
|
||||
<div class="ct-chart"></div>
|
||||
<script>
|
||||
var data = {
|
||||
series: [{{ backup.chart_fill }}, {{ backup.chart_empty }}]
|
||||
};
|
||||
var options = {
|
||||
donut: true,
|
||||
donutWidth: 10,
|
||||
startAngle: 0,
|
||||
total: 100,
|
||||
showLabel: false,
|
||||
height: 150,
|
||||
chartPadding: !isFirefox ? 5 : 10
|
||||
};
|
||||
Chartist.Pie('.backups-chart .ct-chart', data, options);
|
||||
</script>
|
||||
<span class="numeric">{{ backup.days }}<em>{{ "PLUGIN_ADMIN.DAYS"|tu|lower }}</em></span>
|
||||
</div>
|
||||
<p>{{ "PLUGIN_ADMIN.LAST_BACKUP"|tu }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flush-bottom button-bar">
|
||||
<button data-maintenance-update="{{ base_url_relative }}/update.json/task{{ config.system.param_sep }}update" class="button"><i class="fa fa-cloud-download"></i> {{ "PLUGIN_ADMIN.UPDATE"|tu }}</button>
|
||||
<button data-ajax="{{ base_url_relative }}/backup.json/task{{ config.system.param_sep }}backup" class="button"><i class="fa fa-database"></i> {{ "PLUGIN_ADMIN.BACKUP"|tu }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if authorize(['admin.statistics', 'admin.super']) %}
|
||||
<div id="popularity" class="dashboard-item dashboard-right">
|
||||
<div class="secondary-accent default-box-shadow">
|
||||
<h1>{{ "PLUGIN_ADMIN.STATISTICS"|tu }}</h1>
|
||||
<div class="ct-chart"></div>
|
||||
<script>
|
||||
var data = {
|
||||
labels: {{ popularity.getDailyChartData['labels'] }},
|
||||
series: [
|
||||
{{ popularity.getDailyChartData['data'] }}
|
||||
]
|
||||
};
|
||||
var options = {
|
||||
height: 164,
|
||||
chartPadding: !isFirefox ? 5 : 25,
|
||||
|
||||
axisX: {
|
||||
showGrid: false,
|
||||
labelOffset: {
|
||||
x: 0,
|
||||
y: 5
|
||||
}
|
||||
},
|
||||
axisY: {
|
||||
offset: 15,
|
||||
showLabel: true,
|
||||
showGrid: true,
|
||||
labelOffset: {
|
||||
x: 5,
|
||||
y: 5
|
||||
},
|
||||
scaleMinSpace: 20
|
||||
}
|
||||
};
|
||||
Chartist.Bar('#popularity .ct-chart', data, options);
|
||||
</script>
|
||||
<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>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
{% if config.plugins.admin.show_beta_msg %}
|
||||
<div class="error alert"><i class="fa fa-exclamation-circle"></i> {{ 'PLUGIN_ADMIN.ADMIN_BETA_MSG'|tu }}</div>
|
||||
{% endif %}
|
||||
{% if authorize(['admin.pages', 'admin.super']) %}
|
||||
<div id="latest">
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ uri.route(true) }}/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 %}
|
||||
<tr><td class="double page-title"><a href="{{ base_url }}/pages/{{ latest.route|trim('/') }}"><i class="fa fa-fw fa-file-o"></i> {{ latest.title }}</a></td><td class="double page-route">{{ latest.route }}</td><td><b class="last-modified">{{ latest.modified|nicetime }}</b></td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% 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="{{ base_url_relative }}/task{{ config.system.param_sep }}logout">{{ "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 }}
|
||||
</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 }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- /footer -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends 'email/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<p>Dear {{ name }},</p>
|
||||
|
||||
<p>To reset your password, follow <a href="{{ reset_link }}">this link</a> or copy the following URL into your browser's address bar: {{ reset_link }}.</p>
|
||||
|
||||
<p>
|
||||
Kind regards<br />
|
||||
{{ author }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content_full %}
|
||||
<div class="error">
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
{{ content }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer_section %}
|
||||
<br /><br /><br />
|
||||
{% endblock %}
|
||||
@@ -0,0 +1 @@
|
||||
{{ content|json_encode }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% embed 'partials/login.html.twig' with {title:'Grav Forgot Password'} %}
|
||||
|
||||
{% block form %}
|
||||
{% for field in page.header.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 secondary-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,72 @@
|
||||
{% set originalValue = originalValue is defined ? originalValue : value %}
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
{% set vertical = field.style == 'vertical' %}
|
||||
|
||||
{% if field.yaml and value is iterable %}
|
||||
{% set value = value|toYaml %}
|
||||
{% endif %}
|
||||
|
||||
{% block field %}
|
||||
<div class="form-field grid{% if vertical %} vertical{% endif %}">
|
||||
{% 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|fieldName }}">
|
||||
<input type="checkbox"
|
||||
id="toggleable_{{ field.name }}"
|
||||
{% if originalValue is not null and originalValue is not empty %}value="1"{% endif %}
|
||||
name="toggleable_{{ (scope ~ field.name)|fieldName }}"
|
||||
{% if originalValue is not null and originalValue is not empty %}checked="checked"{% endif %}
|
||||
>
|
||||
<label for="toggleable_{{ field.name }}"></label>
|
||||
</span>
|
||||
{% endif %}
|
||||
<label class="{{ field.toggleable ? 'toggleable' : '' }}">
|
||||
{% block label %}
|
||||
{% 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>' }}
|
||||
{% endblock %}
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-data{% if not vertical %} block size-2-3{% endif %}"
|
||||
{% 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 %}
|
||||
{% block input %}
|
||||
<div class="form-input-wrapper {{ field.size }}">
|
||||
<input
|
||||
{# required attribute structures #}
|
||||
name="{{ (scope ~ field.name)|fieldName }}"
|
||||
value="{{ value|e('html_attr')|join(', ') }}"
|
||||
{# 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|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'] %}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 %}
|
||||
/>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,60 @@
|
||||
{% extends "forms/field.html.twig" %}
|
||||
|
||||
{% block global_attributes %}
|
||||
data-grav-array-name="{{ field.name|fieldName }}"
|
||||
data-grav-array-keyname="{{ field.placeholder_key|e|tu }}"
|
||||
data-grav-array-valuename="{{ field.placeholder_value|e|tu }}"
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block input %}
|
||||
<div data-grav-array-type="container"{% if field.value_only %} data-grav-array-mode="value_only"{% endif %}>
|
||||
{% if value|length %}
|
||||
{% for key, text in value -%}
|
||||
<div class="form-row{% if field.value_only %} array-field-value_only{% endif %}" data-grav-array-type="row">
|
||||
|
||||
{% if text is iterable %}
|
||||
<div class="grid" style="display: flex">
|
||||
<div class="block size-1-4">
|
||||
<input data-grav-array-type="keyArray" type="text" value="{{ key }}" placeholder="{{ field.placeholder_key|e|tu }}" style="float: none; width: 90%" />
|
||||
</div>
|
||||
|
||||
<div class="block size-3-4">
|
||||
{% for subkey, subtext in text -%}
|
||||
<div class="form-row" data-grav-array-type="subrow">
|
||||
<input data-grav-array-type="keyArraySubelement" type="text" value="{{ subkey }}" />
|
||||
<input data-grav-array-type="value" type="text" subkey="{{ subkey }}" name="{{ (field.name|fieldName) ~ '[' ~ key ~ '][' ~ subkey ~ ']' }}" value="{{ subtext|join(', ') }}" />
|
||||
|
||||
<span data-grav-array-action="remArrayItem" class="fa fa-minus-square"></span>
|
||||
<span data-grav-array-action="addArrayItem" class="fa fa-plus-square"></span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="form-row{% if field.value_only %} array-field-value_only{% endif %}" data-grav-array-type="subrow">
|
||||
<span data-grav-array-action="rem" class="fa fa-minus"></span>
|
||||
<span data-grav-array-action="add" class="fa fa-plus"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if field.value_only != true %}
|
||||
<input data-grav-array-type="key" type="text" value="{{ key }}" placeholder="{{ field.placeholder_key|e|tu }}" />
|
||||
{% endif %}
|
||||
|
||||
<input data-grav-array-type="value" type="text" name="{{ (field.name|fieldName) ~ '[' ~ key ~ ']' }}" value="{{ text|join(', ') }}" 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>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{%- else -%}
|
||||
<div class="form-row" data-grav-array-type="row">
|
||||
<input data-grav-array-type="key" type="text" placeholder="{{ field.placeholder_key|e|tu }}" />
|
||||
<input data-grav-array-type="value" type="text" 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 @@
|
||||
<input data-grav-field="hidden" data-grav-disabled="false" type="hidden" class="input" name="{{ (scope ~ field.name)|fieldName }}" value="{{ blueprints.name }}" />
|
||||
@@ -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 = data.value(field.name) %}
|
||||
{% 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,23 @@
|
||||
{% 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.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,67 @@
|
||||
{% 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 field in field.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
|
||||
<div class="form-field">
|
||||
<div class="form-label">
|
||||
<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">
|
||||
<div class="form-frontmatter-wrapper {{ field.size }}">
|
||||
<textarea name="{{ (scope ~ field.name)|fieldName }}" id="frontmatter">{{ value|join("\n") }}</textarea>
|
||||
<div class="dragbar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
((function(){
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById('frontmatter'), {
|
||||
mode: 'yaml',
|
||||
theme: 'paper',
|
||||
{% if field.autofocus %}
|
||||
autofocus: true,
|
||||
{% endif %}
|
||||
indentUnit: 4,
|
||||
indentWithTabs: false,
|
||||
extraKeys: {Tab: function(cm) { cm.replaceSelection(" ", "end"); }}
|
||||
});
|
||||
editor.on('change', editor.save);
|
||||
|
||||
$('.dragbar').mousedown(function(e){
|
||||
e.preventDefault();
|
||||
var parentOffset = $(this).parent().offset();
|
||||
$(document).mousemove(function(e){
|
||||
$('.form-frontmatter-wrapper .CodeMirror').css('height',e.pageY - parentOffset.top);
|
||||
})
|
||||
});
|
||||
$(document).mouseup(function(e){
|
||||
$(document).unbind('mousemove');
|
||||
});
|
||||
})());
|
||||
</script>
|
||||
@@ -0,0 +1,110 @@
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
{% set name = scope ~ field.name %}
|
||||
{% set array = field.array is defined ? field.array : true %}
|
||||
{% set lastKey = null %}
|
||||
|
||||
<div class="form-field grid pure-g">
|
||||
<div class="form-label block size-1-4 pure-u-1-4">
|
||||
<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 block size-3-4 pure-u-3-4">
|
||||
<div class="form-list-wrapper {{ field.size }}" data-type="collection">
|
||||
<ul data-collection-holder="{{ name }}">
|
||||
{% if field.fields %}
|
||||
{% for key, val in value %}
|
||||
{% if array and (key matches '/^\\d+$/') == 0 %}
|
||||
{% set array = false %}
|
||||
{% set lastKey = -1 %}
|
||||
{% elseif array %}
|
||||
{% set lastKey = key %}
|
||||
{% endif %}
|
||||
{% set itemName = name ~ '.' ~ key %}
|
||||
<li data-collection-item="{{ itemName }}" data-collection-key="{{ key }}">
|
||||
{% for childName, child in field.fields %}
|
||||
{% if 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/text/text.html.twig'
|
||||
with { field: child, value: key }
|
||||
%}
|
||||
{% elseif child.type %}
|
||||
{%
|
||||
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">
|
||||
<i class="fa fa-bars"></i>
|
||||
<br />
|
||||
<i class="fa fa-trash-o" data-action="delete"></i>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="collection-actions">
|
||||
{% set lastKey = lastKey + 1 %}
|
||||
<button class="button" type="button" data-action="add" data-key-index="{{ lastKey }}"><i class="fa fa-plus"></i> Add item</button>
|
||||
</div>
|
||||
|
||||
<script type="text/html" data-collection-template="new">
|
||||
<li data-collection-item="{{ name ~ '.*' }}">
|
||||
{% if field.fields %}
|
||||
{% set itemName = name ~ '.*' %}
|
||||
{% for childName, child in field.fields %}
|
||||
{% if 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/text/text.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">
|
||||
<i class="fa fa-bars"></i>
|
||||
<br />
|
||||
<i class="fa fa-trash-o" data-action="delete"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<div style="display: none;" data-collection-config="{{ name }}" data-collection-array="{{ array ? 'true' : 'false' }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
|
||||
<div class="form-field">
|
||||
<div class="form-data form-markdown-wrapper cm-s-paper">
|
||||
<textarea data-grav-mdeditor="{{ { 'markdown': true }|json_encode|e('html_attr') }}" name="{{ (scope ~ field.name)|fieldName }}" data-grav-urlpreview="{{ base_url }}/media/{{ admin.route|trim('/') }}.json">{{ value|join("\n")|e('html') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
{% set siblings = data.parent.children.visible %}
|
||||
|
||||
|
||||
<div class="form-field grid pure-g">
|
||||
<div class="form-label block size-1-3 pure-u-1-3">
|
||||
<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 block size-2-3 pure-u-2-3">
|
||||
<div class="form-order-wrapper {{ field.size }}">
|
||||
<input type="hidden" data-order name="{{ (scope ~ field.name)|fieldName }}" value="{{ value }}" />
|
||||
{% if data.parent.header.content.items %}
|
||||
<span class="note">Parent setting order, ordering disabled</span>
|
||||
{% elseif not data.visible %}
|
||||
<span class="note">Page is not visible, ordering disabled</span>
|
||||
{% endif %}
|
||||
|
||||
{% if siblings|length < 200 %}
|
||||
<ul id="ordering" class="{{ field.classes }}">
|
||||
{% for page in siblings %}
|
||||
<li class="{% if page.order == value %}drag-handle{% else %}ignore{% endif %}" data-id="{{ page.slug }}">{{ page.title() }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<span class="note">Ordering via the admin is unsupported because there are more than 200 siblings</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function(){
|
||||
var el = jQuery('#ordering');
|
||||
new Sortable(el[0], {
|
||||
filter: ".ignore",
|
||||
onUpdate: function(evt){
|
||||
var index = el.children().index(jQuery(evt.item)) + 1;
|
||||
jQuery('[data-order]').val(index);
|
||||
}
|
||||
// draggable: ".drag-handle"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,160 @@
|
||||
{% set value = (value is null ? field.default : value) %}
|
||||
|
||||
{% if exists %}
|
||||
<div class="form-field">
|
||||
<div class="form-data form-uploads-wrapper">
|
||||
<h3>{{ field.label|tu }}</h3>
|
||||
<div id="gravDropzone" class="dropzone"></div>
|
||||
<span>{{ value|join("\n") }}</span>
|
||||
<script>
|
||||
$(function(){
|
||||
var URI = $('[data-media-url]').data('media-url'), thisDropzone,
|
||||
modalError = function(args){
|
||||
if (args.data.status == 'error' || args.data.status == 'unauthorized'){
|
||||
|
||||
if (args.mode == 'addBack'){
|
||||
// let's add back the file
|
||||
if (args.file instanceof File) this.addFile(args.file);
|
||||
else {
|
||||
this.files.push(args.file);
|
||||
this.options.addedfile.call(this, args.file);
|
||||
this.options.thumbnail.call(this, args.file, args.file.extras.url);
|
||||
}
|
||||
} else if (args.mode == 'removeFile') {
|
||||
args.file.rejected = true;
|
||||
this.removeFile(args.file);
|
||||
}
|
||||
|
||||
// fire up the modal
|
||||
var modalContainer = $('[data-remodal-id=generic]');
|
||||
modalContainer.find('.error-content').html(args.msg);
|
||||
$.remodal.lookup[modalContainer.data('remodal')].open();
|
||||
}
|
||||
};
|
||||
Dropzone.autoDiscover = false;
|
||||
Dropzone.confirm = function(question, accepted, rejected) {
|
||||
var modalContainer = $('[data-remodal-id=delete-media]'),
|
||||
acceptHandler = function () {
|
||||
if (accepted) {
|
||||
accepted();
|
||||
}
|
||||
$(document).off('confirm', '[data-remodal-id=delete-media]', acceptHandler);
|
||||
$(document).off('cancel', '[data-remodal-id=delete-media]', rejectHandler);
|
||||
},
|
||||
rejectHandler = function () {
|
||||
if (rejected) {
|
||||
rejected();
|
||||
}
|
||||
$(document).off('confirm', '[data-remodal-id=delete-media]', acceptHandler);
|
||||
$(document).off('cancel', '[data-remodal-id=delete-media]', rejectHandler);
|
||||
};
|
||||
|
||||
$.remodal.lookup[modalContainer.data('remodal')].open();
|
||||
$(document).on('confirm', '[data-remodal-id=delete-media]', acceptHandler);
|
||||
$(document).on('cancel', '[data-remodal-id=delete-media]', rejectHandler);
|
||||
};
|
||||
Dropzone.options.gravDropzone = {
|
||||
addRemoveLinks: false,
|
||||
dictRemoveFileConfirmation: '[placeholder]',
|
||||
acceptedFiles: $('[data-media-types]').data('media-types'),
|
||||
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-details\">\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n <div class=\"dz-size\" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-success-mark\"><span>✔</span></div>\n <div class=\"dz-error-mark\"><span>✘</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>Delete</a>\n<a class=\"dz-insert\" href=\"javascript:undefined;\" data-dz-insert>Insert</a>\n</div>",
|
||||
init: function() {
|
||||
thisDropzone = this;
|
||||
$.get(URI + '/task{{ config.system.param_sep }}listmedia', function(data) {
|
||||
|
||||
$.proxy(modalError, this, {
|
||||
data: data,
|
||||
msg: '<p>An error occurred while trying to list files</p><pre>'+data.message+'</pre>'
|
||||
})();
|
||||
|
||||
if (data.results) {
|
||||
$.each(data.results, function(filename, data){
|
||||
var mockFile = { name: filename, size: data.size, accepted: true, extras: data };
|
||||
thisDropzone.files.push(mockFile);
|
||||
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
|
||||
|
||||
if (filename.match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, data.url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.dz-preview').prop('draggable', 'true');
|
||||
});
|
||||
|
||||
this.on("complete", function(file) {
|
||||
if (file.accepted) {
|
||||
$('.dz-preview').prop('draggable', 'true');
|
||||
return;
|
||||
}
|
||||
var data = {status: 'error', message: 'Unsupported file type: ' + file.name.match(/\..+/).join('')};
|
||||
$.proxy(modalError, this, {
|
||||
file: file,
|
||||
data: data,
|
||||
mode: 'removeFile',
|
||||
msg: '<p>An error occurred while trying to add the file <strong>'+file.name+'</strong></p><pre>'+data.message+'</pre>'
|
||||
})();
|
||||
});
|
||||
|
||||
this.on('success', function(file, response){
|
||||
thisDropzone = this;
|
||||
$.proxy(modalError, this, {
|
||||
file: file,
|
||||
data: response,
|
||||
mode: 'removeFile',
|
||||
msg: '<p>An error occurred while trying to upload the file <strong>'+file.name+'</strong></p><pre>'+response.message+'</pre>'
|
||||
})();
|
||||
});
|
||||
|
||||
this.on('removedfile', function(file) {
|
||||
if (!file.accepted || file.rejected) return;
|
||||
thisDropzone = this;
|
||||
$.post(URI + '/task{{ config.system.param_sep }}delmedia', {filename: file.name}, function(data){
|
||||
$.proxy(modalError, thisDropzone, {
|
||||
file: file,
|
||||
data: data,
|
||||
mode: 'addBack',
|
||||
msg: '<p>An error occurred while trying to remove the file <strong>'+file.name+'</strong></p><pre>'+data.message+'</pre>'
|
||||
})();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dropzone = new Dropzone("#gravDropzone", { url: URI + '/task{{ config.system.param_sep }}addmedia', createImageThumbnails: { thumbnailWidth: 150} });
|
||||
|
||||
$("#gravDropzone").delegate('.dz-preview', 'dragstart', function(e){
|
||||
var uri = encodeURI($(this).find('.dz-filename').text());
|
||||
uri = uri.replace(/\(/g, '%28');
|
||||
uri = uri.replace(/\)/g, '%29');
|
||||
|
||||
var shortcode = '';
|
||||
if (!uri.match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
shortcode = '[' + decodeURI(uri) + '](' + uri + ')';
|
||||
}
|
||||
|
||||
dropzone.disable();
|
||||
$(this).addClass('hide-backface');
|
||||
e.originalEvent.dataTransfer.effectAllowed = 'copy';
|
||||
e.originalEvent.dataTransfer.setData('text', shortcode);
|
||||
});
|
||||
|
||||
$("#gravDropzone").delegate('.dz-preview', 'dragend', function(e){
|
||||
dropzone.enable();
|
||||
$(this).removeClass('hide-backface');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="form-tab">
|
||||
<div class="form-field">
|
||||
<div class="form-label">
|
||||
<label>
|
||||
You cannot add media files until you save the page. Just click 'Save' on top
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,51 @@
|
||||
{% extends "forms/field.html.twig" %}
|
||||
|
||||
{% macro options(field, pages, value, depth) %}
|
||||
|
||||
{% if field.options and depth == 0 %}
|
||||
{% for key, value in field.options %}
|
||||
<option value="{{ key|e('html_attr') }}">{{ value|t }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if field.show_root and depth == 0 %}
|
||||
<option value="/">/ (Root)</option>
|
||||
{% set depth = depth +1 %}
|
||||
{% endif %}
|
||||
|
||||
{% set indent = depth == 0 ? '' : repeat('-',depth) ~ ' ' %}
|
||||
|
||||
{% for page in pages.children %}
|
||||
{% if page.routable() or field.show_all %}
|
||||
<option {% if page.route == value %}selected="selected"{% endif %} value="{{ page.route }}">
|
||||
{{indent}} {{ page.menu }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% if page.children|length > 0 and (field.show_modular or not page.modular()) %}
|
||||
|
||||
{{ _self.options(field, page,value, depth + 1) }}
|
||||
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
<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 %}
|
||||
>
|
||||
{{ _self.options(field,pages,value, 0) }}
|
||||
</select>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{% if field.title %}
|
||||
<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 }}{% else %}{{ field.text|t }}{% endif %}<p>
|
||||
{% endif %}
|
||||
|
||||
{% if field.fields %}
|
||||
<div class="form-section">
|
||||
{% for field in field.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% 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,10 @@
|
||||
{% if field.fields %}
|
||||
<div class="form-tab">
|
||||
{% for field in field.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,23 @@
|
||||
<div class="form-tabs">
|
||||
|
||||
{% if uri.params.tab %}
|
||||
{% set active = uri.params.tab %}
|
||||
{% elseif field.active %}
|
||||
{% set active = field.active %}
|
||||
{% else %}
|
||||
{% set active = 1 %}
|
||||
{% endif %}
|
||||
|
||||
{% if field.fields %}
|
||||
{% for tab in field.fields %}<input type="radio" name="tab" id="tab{{ loop.index }}" class="tab-head" {{ active == loop.index ? 'checked="checked"' : '' }}/><label for="tab{{ loop.index }}">{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}</label>{% endfor %}
|
||||
<div class="tab-body-wrapper">
|
||||
{% for field in field.fields %}
|
||||
{% set value = data.value(field.name) %}
|
||||
<div id="tab-body-{{ loop.index }}" class="tab-body">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{% set taxonomies = (taxonomies is null ? admin.data('site').taxonomies : taxonomies) %}
|
||||
{% set parentname = field.name %}
|
||||
|
||||
{% for name in taxonomies %}
|
||||
|
||||
{% set value = array(data.value('header.taxonomy.' ~ name)|default([])) %}
|
||||
{% set sub_taxonomies = attribute(grav.taxonomy.taxonomy, name)|default([])|keys %}
|
||||
{% set list = []|merge(sub_taxonomies)|merge(value) %}
|
||||
|
||||
{% set field = {
|
||||
type: 'select',
|
||||
classes: 'fancy create',
|
||||
label: name|capitalize,
|
||||
name: parentname ~ '.' ~ name,
|
||||
multiple: true,
|
||||
options: list,
|
||||
selectize: {
|
||||
create: true
|
||||
}
|
||||
} %}
|
||||
|
||||
{% include ['forms/fields/select/select.html.twig'] %}
|
||||
{% endfor %}
|
||||
+31
@@ -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 %}
|
||||
>
|
||||
{% 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,43 @@
|
||||
{% 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="{{ field.name|fieldName }}"
|
||||
{% endblock %}
|
||||
|
||||
{% block input %}
|
||||
|
||||
<div class="switch-toggle switch-grav {{ field.size }} switch-{{ field.options|length }}">
|
||||
{% for key, text in field.options %}
|
||||
{% set id = "toggle_" ~ field.name ~ key %}
|
||||
|
||||
<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.toggleable %}
|
||||
{% if '' ~ key == '' ~ value %}checked="checked" {% endif %}
|
||||
{% if 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 }}">{% if grav.twig.twig.filters['tu'] is defined %}{{ text|tu }}{% else %}{{ text|t }}{% endif %}</label>
|
||||
{% endfor %}
|
||||
<a></a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.PHP_INFO"|tu }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
<ul class="tab-bar">
|
||||
<li><a href="{{ base_url_relative }}/system">System</a></li>
|
||||
<li><a href="{{ base_url_relative }}/site">Site</a></li>
|
||||
<li class="active"><span>Info</span></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="phpinfo">
|
||||
{{ admin.phpinfo }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="admin-block">
|
||||
<h1>
|
||||
{{ "PLUGIN_ADMIN.INSTALLER"|tu }}
|
||||
</h1>
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{% embed 'partials/login.html.twig' with {title:'Grav Login'} %}
|
||||
|
||||
{% block form %}
|
||||
{% for field in page.header.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 secondary-accent">
|
||||
{% if notAuthorized %}
|
||||
<a class="button secondary" onclick="window.history.back()"><i class="fa fa-reply"></i> {{ 'PLUGIN_ADMIN.BACK'|tu }}</a>
|
||||
{% else %}
|
||||
{% if not authenticated %}
|
||||
<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>
|
||||
{% else %}
|
||||
<button type="submit" class="button primary" name="task" value="logout"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_ADMIN.LOGOUT'|tu }}</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% endembed %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% embed 'partials/login.html.twig' with {title:'Grav Logout'} %}
|
||||
{% block head %}
|
||||
{{ parent() }}
|
||||
<meta http-equiv="refresh" content="3; URL={{ base_url_relative }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<section id="admin-login" class="default-glow-shadow">
|
||||
<h1>
|
||||
{{ title }}
|
||||
</h1>
|
||||
{{ admin.setMessage('PLUGIN_ADMIN.LOGGED_OUT'|t) }}
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set logs = admin.logs %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="admin-block">
|
||||
<h1>
|
||||
{{ 'PLUGIN_ADMIN.BROWSE_ERROR_LOGS'|tu }}
|
||||
</h1>
|
||||
|
||||
<table>
|
||||
{% for entry in logs %}
|
||||
<tr>
|
||||
<td><a href="{{ base_url_relative }}/logs/{{ entry.file }}">{{ entry.date }}</a></td>
|
||||
<td>{{ entry.message }}</td>
|
||||
<td><a href="{{ entry.url }}">{{ entry.url }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if admin.json_response %}
|
||||
{{ admin.json_response|json_encode }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if admin.json_response %}
|
||||
{{ admin.json_response|json_encode }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,329 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% 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' %}
|
||||
{% 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 %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{% if mode == 'edit' %}
|
||||
{% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %}
|
||||
{% endif %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs(theme_url~'/js/pages-all.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/speakingurl.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/slugify.min.js') %}
|
||||
{% if mode == 'edit' %}
|
||||
{% do assets.addJs(theme_url~'/js/codemirror-compressed.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/mdeditor.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/dropzone.min.js') %}
|
||||
{% endif %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %}
|
||||
{% set preview_link = context.routable ? '<a class="preview" target="_blank" href="' ~ preview_html ~ '"><i class="fa fa-fw fa-angle-double-right"></i></a>' : '' %}
|
||||
|
||||
{% 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 description = (not p.page ? 'Folder • ' : 'Page • ') ~
|
||||
(p.modular ? 'Modular • ' : '') ~
|
||||
(p.routable ? 'Routable • ' : 'Non-Routable • ') ~
|
||||
(p.visible ? 'Visible • ' : 'Non-Visible • ') ~
|
||||
(p.published ? 'Published • ' : 'Non-Published • ') %}
|
||||
{% 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"' : ''}} data-hint="{{ description|trim(' • ') }}" 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>
|
||||
<a href="{{ page_url }}" class="page-edit">{{ p.title }}</a>
|
||||
|
||||
{% if p.language %}
|
||||
<span class="badge lang {% if p.language == admin_lang %}info{% endif %}">{{p.language ?: default_site_lang}}</span>
|
||||
{% endif %}
|
||||
<span class="page-home">{{ p.home ? '<i class="fa fa-home"></i>' }}</span>
|
||||
<span class="page-tools">
|
||||
|
||||
{% if warn %}
|
||||
<a href="#delete" data-remodal-target="delete" data-delete-url="{{ page_url }}/task{{ separator }}delete" class="page-delete" ><i class="fa fa-close"></i></a>
|
||||
{% else %}
|
||||
<a href="{{ page_url }}/task{{ separator }}delete" class="page-delete" ><i class="fa fa-close"></i></a>
|
||||
{% endif %}
|
||||
</span>
|
||||
<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>
|
||||
{% 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>
|
||||
<a class="button" href="#modal" data-remodal-target="modal"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a>
|
||||
{% if admin.modularTypes is not empty %}
|
||||
<a class="button" href="#modular" data-remodal-target="modular"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% 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>
|
||||
<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="{{ base_url_relative }}{{ theme.slug }}/pages/task{{ config.system.param_sep }}switchlanguage/lang{{ config.system.param_sep }}{{langCode}}">{{ langName[:1]|upper ~ langName[1:] }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% elseif mode == 'edit' %}
|
||||
|
||||
|
||||
<a class="button" href="{{ base_url }}/pages"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
{% if exists %}
|
||||
<a class="button" href="{{ page_url }}/task{{ config.system.param_sep }}copy" 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 warn %}
|
||||
<a class="button" href="#delete" data-remodal-target="delete" data-delete-url="{{ page_url }}/task{{ config.system.param_sep }}delete"><i class="fa fa-close"></i> {{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
|
||||
{% else %}
|
||||
<a class="button" href="{{ uri.route(true) }}/task{{ config.system.param_sep }}delete" 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.exists ? "PLUGIN_ADMIN.EDIT"|tu ~ " <i>#{context.menu}</i>" ~ preview_link : "PLUGIN_ADMIN.CREATE"|tu ~ " <i>#{context.menu}</i>" }}
|
||||
</h1>
|
||||
{% else %}
|
||||
<h1><i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% set default_site_lang = grav.config.system.languages|first|first %}
|
||||
<div class="admin-block clear">
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
{% 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" data-media-url="{{ base_url }}/media/{{ admin.route|trim('/') }}.json" data-media-local="{{ base_url_relative_frontend }}/{{ admin.route|trim('/') }}" data-media-types="{{ media_types }}">
|
||||
<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 %}
|
||||
<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">{{ "PLUGIN_ADMIN.NORMAL"|tu }}</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">{{ "PLUGIN_ADMIN.EXPERT"|tu }}</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('pages/'~modular~'raw'), data: context } %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form id="page-filtering">
|
||||
<div class="page-filters">
|
||||
<input type="text" data-template-types="{{ admin.types|merge(admin.modularTypes)|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>
|
||||
<ul class="pages-list depth-0">
|
||||
{{ _self.loop(pages, 0, _context) }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<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-confirm" href="#">{{ "PLUGIN_ADMIN.CLOSE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if mode == 'list' %}
|
||||
<div class="remodal" data-remodal-id="modal" data-remodal-options="hashTracking: false">
|
||||
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/new'), data: context } %}
|
||||
</div>
|
||||
|
||||
<div class="remodal" data-remodal-id="modular" data-remodal-options="hashTracking: false">
|
||||
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/modular_new'), data: context } %}
|
||||
</div>
|
||||
{% 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('pages/move'), data: context } %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<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">
|
||||
{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}
|
||||
</p>
|
||||
<br>
|
||||
<div class="button-bar">
|
||||
<a class="button secondary remodal-cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<a class="button" data-delete-action href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<a class="button secondary remodal-cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<a class="button remodal-confirm" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,109 @@
|
||||
<!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 }}">
|
||||
{% endif %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/png" href="{{ base_url_relative_frontend }}{{ theme_url }}/images/favicon.png">
|
||||
|
||||
{% block stylesheets %}
|
||||
{% do assets.addCss(theme_url~'/css-compiled/nucleus.css') %}
|
||||
{% do assets.addCss(theme_url~'/css-compiled/template.css') %}
|
||||
{% do assets.addCss(theme_url~'/css/font-awesome.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/datepicker/kendo.common.core.min.css') %}
|
||||
{% do assets.addCss(theme_url~'/css/datepicker/kendo.flat.min.css') %}
|
||||
{% do assets.addCss(theme_url~'/css/datepicker/grav.overrides.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 %}
|
||||
{{ assets.css() }}
|
||||
{% endblock %}
|
||||
|
||||
{% include 'partials/javascript-config.html.twig' %}
|
||||
{% block javascripts %}
|
||||
{% do assets.add('jquery',101) %}
|
||||
{% do assets.addJs(theme_url~'/js/modernizr.custom.71422.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/chartist.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/selectize.min.js') %}
|
||||
{% do assets.addJS(theme_url~'/js/sortable.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/toastr.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/jquery.remodal.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/ajax.js') %}
|
||||
|
||||
{% do assets.addJs(theme_url~'/js/admin-all.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/dropdown.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/mobile.js') %}
|
||||
|
||||
{% do assets.addJs(theme_url~'/js/datepicker/kendo.custom.min.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/datepicker/init.js') %}
|
||||
|
||||
{% do assets.addJs(theme_url~'/js/forms/form.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms/fields/input.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms/fields/array.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms/fields/selectize.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms/fields/checkboxes.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms/fields/toggle.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/forms.js') %}
|
||||
|
||||
{% if browser.getBrowser == 'msie' %}
|
||||
{% do assets.addJs(theme_url~'/js/form-attr.polyfill.js') %}
|
||||
{% endif %}
|
||||
|
||||
{{ assets.js() }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body {% if not config.plugins.admin.google_fonts %}class="simple-fonts"{% endif %}>
|
||||
{% block page %}
|
||||
<div class="remodal-bg">
|
||||
|
||||
{% block navigation %}
|
||||
{% include 'partials/nav.html.twig' %}
|
||||
{% endblock %}
|
||||
|
||||
<section id="admin-main" >
|
||||
<div id="titlebar" class="titlebar secondary-accent">
|
||||
{% block titlebar %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="grav-update" data-gpm-grav>
|
||||
</div>
|
||||
|
||||
<div class="content-padding">
|
||||
<div>
|
||||
{% block messages %}
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
{% endblock %}
|
||||
{% block content_top %}{% endblock %}
|
||||
<div class="admin-block default-box-shadow">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% if config.plugins.admin.show_beta_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>
|
||||
<footer id="footer">
|
||||
<a href="http://getgrav.org">Grav</a> {{ "PLUGIN_ADMIN.VERSION"|tu|lower }} <span class="grav-version">{{ constant('GRAV_VERSION') }}</span> {{ "PLUGIN_ADMIN.WAS_MADE_WITH"|tu|lower }} <i class="fa fa-heart"></i> {{ "PLUGIN_ADMIN.BY"|tu|lower }} <a href="http://www.rockettheme.com">RocketTheme</a>.
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<div id='overlay'></div>
|
||||
</div>
|
||||
{% endblock page %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<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 = data.value(field.name) %}
|
||||
<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>
|
||||
</form>
|
||||
@@ -0,0 +1,13 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<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 = data.value(field.name) %}
|
||||
|
||||
<div class="block block-{{ field.type }}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</form>
|
||||
@@ -0,0 +1,21 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<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 = data.value(field.name) %}
|
||||
|
||||
<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 %}
|
||||
{% set field = {name: '_json.' ~ name} %}
|
||||
{% set value = value|json_encode|e %}
|
||||
{% include 'forms/fields/hidden/hidden.html.twig' %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</form>
|
||||
@@ -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,9 @@
|
||||
<script type="text/javascript">
|
||||
window.GravAdmin = window.GravAdmin || {};
|
||||
window.GravAdmin.config = {
|
||||
base_url_relative: '{{ base_url_relative }}',
|
||||
param_sep: '{{ config.system.param_sep }}',
|
||||
enable_auto_updates_check: '{{ config.plugins.admin.enable_auto_updates_check }}',
|
||||
admin_timeout: '{{ config.plugins.admin.session.timeout ?: 1800 }}'
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block page %}
|
||||
<section id="admin-login" class="default-glow-shadow">
|
||||
<h1>
|
||||
{{ title }}
|
||||
</h1>
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
|
||||
<form method="post" action="{{ base_url_relative }}">
|
||||
{% block form %}{% endblock %}
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,3 @@
|
||||
{% for message in admin.messages %}
|
||||
<div class="{{ message.scope|e }} alert">{{ message.message }}</div>
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,87 @@
|
||||
<nav id="admin-sidebar">
|
||||
<div id="admin-logo">
|
||||
<h3><a href="{{ base_url_relative }}">{{ "PLUGIN_ADMIN.GRAV_ADMIN"|tu }}</a> <a target="_blank" href="{{ base_url_relative_frontend }}"><i class="fa fa-fw fa-angle-double-right"></i></a></h3>
|
||||
</div>
|
||||
|
||||
{#{% if admin.authorize %}#}
|
||||
<div id="admin-user-details">
|
||||
<a href="{{ base_url_relative }}/users/{{ admin.user.username }}">
|
||||
<img src="http://www.gravatar.com/avatar/{{ admin.user.email|md5 }}?s=32" />
|
||||
|
||||
<div class="admin-user-names">
|
||||
<h4>{{ admin.user.fullname }}</h4>
|
||||
<h5>{{ admin.user.title }}</h5>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{#{% endif %}#}
|
||||
|
||||
<ul id="admin-menu">
|
||||
<li class="{{ (location == 'dashboard') ? 'selected' : '' }}">
|
||||
<a href="{{ base_url_relative }}"><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</a>
|
||||
</li>
|
||||
{% if authorize(['admin.configuration', 'admin.super']) %}
|
||||
<li class="{{ (location == 'system' or location == 'site') ? 'selected' : '' }}">
|
||||
<a href="{{ base_url_relative }}/system"><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }}</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> {{ "PLUGIN_ADMIN.PAGES"|tu }}
|
||||
<span class="badges">
|
||||
<span class="badge count">{{ admin.countPages }}</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if grav.twig.plugins_hooked_nav %}
|
||||
{% for label, item in grav.twig.plugins_hooked_nav %}
|
||||
{% if authorize(['admin.' ~ item.route, 'admin.super']) %}
|
||||
<li class="{{ (location == item.route) ? 'selected' : '' }}">
|
||||
<a href="{{ base_url_relative }}/{{ item.route }}">
|
||||
<i class="fa fa-fw {{ item.icon }}"></i> {{ label|tu }}
|
||||
</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> {{ "PLUGIN_ADMIN.PLUGINS"|tu }}
|
||||
<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> {{ "PLUGIN_ADMIN.THEMES"|tu }}
|
||||
<span class="badges">
|
||||
<span class="badge updates"></span>
|
||||
<span class="badge count">{{ admin.themes|length }}</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% include 'nav-pro.html.twig' ignore missing %}
|
||||
|
||||
<!-- <li class="{{ (location == 'logs') ? 'selected' : '' }}">
|
||||
<a href="{{ base_url_relative }}/logs">
|
||||
<i class="fa fa-fw fa-warning"></i> Error Logs
|
||||
<span class="badges">
|
||||
<span class="badge count">{{ admin.logs|length }}</span>
|
||||
</span>
|
||||
</a>
|
||||
</li> -->
|
||||
<li>
|
||||
<a href="{{ base_url_relative }}/task{{ config.system.param_sep }}logout"><i class="fa fa-fw fa-sign-out"></i> {{ "PLUGIN_ADMIN.LOGOUT"|tu }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -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,17 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-page-move>
|
||||
{% for field in blueprints.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="button-bar">
|
||||
<a class="button secondary remodal-cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<button class="button primary" name="task" value="save" form="blueprints">{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,63 @@
|
||||
<table>
|
||||
{% if plugin.author %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
|
||||
<td>
|
||||
{% 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><a href="{{ plugin.homepage }}" target="_blank">{{ plugin.homepage }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if plugin.demo %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
|
||||
<td><a href="{{ plugin.demo }}" target="_blank">{{ plugin.demo }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if plugin.bugs %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
|
||||
<td><a href="{{ plugin.bugs }}" target="_blank">{{ plugin.bugs }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if plugin.keywords %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
|
||||
<td>{{ plugin.keywords|join(', ') }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if plugin.license %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
|
||||
<td>{{ plugin.license }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% if plugin.description %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
|
||||
<td>{{ plugin.description_html }}</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><a href="{{ readme_link }}" target="_blank">{{ readme_link }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,44 @@
|
||||
{% set gpm = admin.gpm() %}
|
||||
{% set installed = gpm.isPluginInstalled(admin.route) %}
|
||||
|
||||
<div class="grav-update plugin" data-gpm-plugin="{{ admin.route }}">
|
||||
{% if installed and gpm.isPluginUpdatable(admin.route) %}
|
||||
{% set remote = gpm.getRepositoryPlugin(admin.route) %}
|
||||
<p>
|
||||
<i class="fa fa-bullhorn"></i>
|
||||
<strong>v{{ remote.available }}</strong> {{ "PLUGIN_ADMIN.OF_THIS_PLUGIN_IS_NOW_AVAILABLE"|tu }}!
|
||||
<button class="button button-small secondary" data-download="{{ remote.zipball_url }}">{{ "PLUGIN_ADMIN.UPDATE_PLUGIN"|tu }}</button>
|
||||
</p>
|
||||
{% endif %}
|
||||
</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 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>
|
||||
</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 } %}
|
||||
|
||||
<div class="button-bar danger">
|
||||
<span class="danger-zone"></span>
|
||||
<a class="button" href="{{ base_url_relative }}/plugins/{{ plugin.slug }}/task{{ config.system.param_sep }}uninstall"><i class="fa fa-fw fa-warning"></i>{{ "PLUGIN_ADMIN.REMOVE_PLUGIN"|tu }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="button-bar success">
|
||||
<a class="button" href="{{ base_url_relative }}/plugins/{{ plugin.slug }}/task{{ config.system.param_sep }}install"><i class="fa fa-fw fa-plus"></i>{{ "PLUGIN_ADMIN.INSTALL_PLUGIN"|tu }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,42 @@
|
||||
<div class="grav-update plugins"></div>
|
||||
|
||||
<h1>
|
||||
{{ installing ? "PLUGIN_ADMIN.AVAILABLE_PLUGINS"|tu : "PLUGIN_ADMIN.INSTALLED_PLUGINS"|tu }}
|
||||
</h1>
|
||||
|
||||
<table>
|
||||
{% for slug, plugin in admin.plugins(not installing).toArray|ksort %}
|
||||
{% set data = admin.data('plugins/' ~ slug) %}
|
||||
|
||||
<tr data-gpm-plugin="{{ slug|url_encode }}">
|
||||
<td class="gpm-name">
|
||||
<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 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>
|
||||
</td>
|
||||
<td class="gpm-actions">
|
||||
{% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %}
|
||||
<a class="{{ data.get('enabled') ? 'enabled' : 'disabled' }}" href="{{ base_url_relative }}/plugins/{{ slug }}/task{{ config.system.param_sep }}{{ data.get('enabled') ? 'disable' : 'enable' }}">
|
||||
<i class="fa fa-fw fa-toggle-{{ data.get('enabled') ? 'on' : 'off' }}"></i>
|
||||
</a>
|
||||
{% elseif (installing) %}
|
||||
<a class="button" href="{{ base_url_relative }}/plugins/{{ slug }}/task{{ config.system.param_sep }}install"><i class="fa fa-plus"></i> Install</a>
|
||||
{% 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>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -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,116 @@
|
||||
{% set gpm = admin.gpm() %}
|
||||
{% set installed = gpm.isThemeInstalled(admin.route) %}
|
||||
|
||||
<div class="grav-update theme" data-gpm-theme="{{ admin.route }}">
|
||||
{% if installed and gpm.isThemeUpdatable(admin.route) %}
|
||||
{% set remote = gpm.getRepositoryTheme(admin.route) %}
|
||||
<p>
|
||||
<i class="fa fa-bullhorn"></i>
|
||||
<strong>v{{ remote.available }}</strong> {{ "PLUGIN_ADMIN.OF_THIS_THEME_IS_NOW_AVAILABLE"|tu }}!
|
||||
<button class="button button-small secondary" data-download="{{ remote.zipball_url }}">{{ "PLUGIN_ADMIN.UPDATE_THEME"|tu }}</button>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<h1>
|
||||
{{ theme.name|e }}
|
||||
{% if admin.isTeamGrav(theme) %}
|
||||
<small><span class="info-reverse"><i class="fa fa-check-circle" title="Grav Official Theme"></i></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>
|
||||
</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>{{ theme.version }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.author %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.AUTHOR"|tu }}:</td>
|
||||
<td>
|
||||
{% 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><a href="{{ theme.homepage }}" target="_blank">{{ theme.homepage }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.demo %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.DEMO"|tu }}:</td>
|
||||
<td><a href="{{ theme.demo }}" target="_blank">{{ theme.demo }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.bugs %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.BUG_TRACKER"|tu }}:</td>
|
||||
<td><a href="{{ theme.bugs }}" target="_blank">{{ theme.bugs }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.keywords %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.KEYWORDS"|tu }}:</td>
|
||||
<td>{{ theme.keywords }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.license %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.LICENSE"|tu }}:</td>
|
||||
<td>{{ theme.license }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if theme.description %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.DESCRIPTION"|tu }}:</td>
|
||||
<td>{{ theme.description_html }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.readme or theme.homepage %}
|
||||
{% set readme_link = theme.readme ?: theme.homepage ~ '/blob/develop/README.md' %}
|
||||
<tr>
|
||||
<td>{{ "PLUGIN_ADMIN.README"|tu }}:</td>
|
||||
<td><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>
|
||||
<a class="button" href="{{ base_url_relative }}/themes/{{ theme.slug }}/task{{ config.system.param_sep }}uninstall"><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="{{ base_url_relative }}/themes/{{ theme.slug }}/task{{ config.system.param_sep }}install"><i class="fa fa-fw fa-plus"></i>{{ "PLUGIN_ADMIN.INSTALL_THEME"|tu }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<div class="grav-update themes"></div>
|
||||
|
||||
<h1>
|
||||
{{ installing ? "PLUGIN_ADMIN.AVAILABLE_THEMES"|tu : "PLUGIN_ADMIN.INSTALLED_THEMES"|tu }}
|
||||
</h1>
|
||||
|
||||
<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 %}
|
||||
|
||||
<div class="theme card-item pure-u-1-3 {{ state }}-theme" data-gpm-theme="{{ slug|url_encode }}">
|
||||
<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 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>
|
||||
</div>
|
||||
<div class="gpm-screenshot">
|
||||
{% set thumb = installing ? 'http://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="{{ base_url_relative }}/themes/{{ slug }}/task{{ config.system.param_sep }}install"><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="{{ base_url_relative }}/themes/{{ slug }}/task{{ config.system.param_sep }}activate" class="gpm-actions">
|
||||
{# <a class="disabled" href="{{ base_url_relative }}/themes/{{ slug }}/task{{ config.system.param_sep }}activate"><i class="fa fa-fw fa-toggle-off"></i></a> #}
|
||||
Activate
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
</div>
|
||||
{% 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">
|
||||
<a class="button secondary remodal-cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<a class="button continue" href="#"><i class="fa fa-fw fa-check"></i>{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
<a class="menu-toggle fa fa-fixed-width fa-bars" href="#menu"></a>
|
||||
|
||||
<h2>
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-bug fa-stack-1x"></i>
|
||||
</span>
|
||||
Admin
|
||||
</h2>
|
||||
|
||||
{% if admin.authorize %}
|
||||
<span class="user-details">
|
||||
<img src="http://www.gravatar.com/avatar/{{ admin.user.email|md5 }}?s=50" /><span class="badge">6</span><span class="hide-small">Hi, {{ admin.user.fullname }}<span> <a href="{{ base_url_relative }}/task{{ config.system.param_sep }}logout">{{ "PLUGIN_ADMIN.LOGOUT"|tu }}</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% if user.exists %}
|
||||
<div class="user-details">
|
||||
<img src="http://www.gravatar.com/avatar/{{ user.email|md5 }}?s=128" />
|
||||
<p class="gravatar">{{ "PLUGIN_ADMIN.AVATAR_BY"|tu }} <a href="http://gravatar.com" target="_blank">gravatar.com</a></p>
|
||||
<h2>{{ user.fullname }}</h2>
|
||||
{% if user.title %}<h5>{{ user.title }}</h5>{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<h1>{{ "PLUGIN_ADMIN.CREATE_NEW_USER"|tu }}</h1>
|
||||
{% endif %}
|
||||
|
||||
{% include 'partials/blueprints.html.twig' with { data: user, blueprints: user.blueprints } %}
|
||||
|
||||
{% if user.exists and admin.user.username != user.username %}
|
||||
<div class="button-bar danger">
|
||||
<span class="danger-zone"></span>
|
||||
<a class="button" href="#"><i class="fa fa-fw fa-warning"></i>{{ "PLUGIN_ADMIN.REMOVE_USER"|tu }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="users card-row grid fixed-blocks pure-g">
|
||||
{% for user in admin.users %}
|
||||
<div class="theme card-item pure-u-1-3">
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% if admin.route %}
|
||||
{% set installing = admin.route starts with 'install' %}
|
||||
{% set installed = true %}
|
||||
|
||||
{# Try installed packages first, then remote #}
|
||||
{% set package = admin.plugins(true)[admin.route] %}
|
||||
{% if (not package) %}
|
||||
{% set package = admin.plugins(false)[admin.route] %}
|
||||
{% set installed = false %}
|
||||
{% endif %}
|
||||
|
||||
{% set plugin = package.toArray() %}
|
||||
{% set title = "PLUGIN_ADMIN.PLUGIN"|tu ~ ": " ~ plugin.name|e %}
|
||||
{% endif %}
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not admin.route or installing %}
|
||||
<div class="button-bar">
|
||||
{% if (installing) %}
|
||||
<a class="button" href="{{ base_url_relative }}/plugins"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
{% else %}
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<a class="button" href="{{ base_url_relative }}/plugins/install"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}</a>
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-plug"></i> {{ "PLUGIN_ADMIN.PLUGINS"|tu }}</h1>
|
||||
{% else %}
|
||||
{% if (installed) %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url_relative }}/plugins"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url_relative }}/plugins/install"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|tu }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1><i class="fa fa-fw fa-plug"></i> {{ "PLUGIN_ADMIN.PLUGIN"|tu }}: {{ plugin.name|e }}</h1>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="gpm gpm-plugins">
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
|
||||
{% if not admin.route or installing %}
|
||||
{% include 'partials/plugins-list.html.twig' %}
|
||||
{% else %}
|
||||
{% include 'partials/plugins-details.html.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% embed 'partials/login.html.twig' with {title:'Grav Reset Password'} %}
|
||||
|
||||
{% block form %}
|
||||
{% for field in page.header.form.fields %}
|
||||
{% set value = attribute(admin.forgot, field.name) is defined ? attribute(admin.forgot, field.name) : null %}
|
||||
|
||||
{% 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 secondary-accent">
|
||||
<button type="submit" class="button primary" name="task" value="reset"><i class="fa fa-key"></i> {{ 'PLUGIN_ADMIN.LOGIN_BTN_RESET'|tu }}</button>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% endembed %}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set data = admin.data('site') %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> Save</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SITE"|tu }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
|
||||
<ul class="tab-bar">
|
||||
<li><a href="{{ base_url_relative }}/system">{{ "PLUGIN_ADMIN.SYSTEM"|tu }}</a></li>
|
||||
<li class="active"><span>{{ "PLUGIN_ADMIN.SITE"|tu }}</span></li>
|
||||
<li><a href="{{ base_url_relative }}/info">{{ "PLUGIN_ADMIN.INFO"|tu }}</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="admin-block">
|
||||
<h1>
|
||||
{{ "PLUGIN_ADMIN.STATISTICS"|tu }}
|
||||
</h1>
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set data = admin.data('system') %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ "PLUGIN_ADMIN.SYSTEM"|tu }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
|
||||
<ul class="tab-bar">
|
||||
<li class="active"><span>{{ "PLUGIN_ADMIN.SYSTEM"|tu }}</span></li>
|
||||
<li><a href="{{ base_url_relative }}/site">{{ "PLUGIN_ADMIN.SITE"|tu }}</a></li>
|
||||
<li><a href="{{ base_url_relative }}/info">{{ "PLUGIN_ADMIN.INFO"|tu }}</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% if admin.route %}
|
||||
{% set installing = admin.route starts with 'install' %}
|
||||
{% set installed = true %}
|
||||
|
||||
{# Try installed packages first, then remote #}
|
||||
{% set package = admin.themes(true)[admin.route] %}
|
||||
{% if (not package) %}
|
||||
{% set package = admin.themes(false)[admin.route] %}
|
||||
{% set installed = false %}
|
||||
{% endif %}
|
||||
|
||||
{% set theme = package.toArray() %}
|
||||
{% set title = "PLUGIN_ADMIN.THEME"|tu ~ ": " ~ theme.name|e %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not admin.route or installing %}
|
||||
<div class="button-bar">
|
||||
{% if (installing) %}
|
||||
<a class="button" href="{{ base_url_relative }}/themes"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
{% else %}
|
||||
<a class="button" href="{{ base_url }}/"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<a class="button" href="{{ base_url_relative }}/themes/install"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}</a>
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEMES"|tu }}</h1>
|
||||
{% else %}
|
||||
{% if (installed) %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url_relative }}/themes"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_THEMES"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url_relative }}/themes/install"><i class="fa fa-arrow-left"></i> {{ "PLUGIN_ADMIN.BACK_TO_THEMES"|tu }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h1><i class="fa fa-fw fa-tint"></i> {{ "PLUGIN_ADMIN.THEME"|tu }}: {{ theme.name|e }}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="gpm gpm-themes">
|
||||
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
|
||||
{% if not admin.route or installing %}
|
||||
{% include 'partials/themes-list.html.twig' %}
|
||||
{% else %}
|
||||
{% include 'partials/themes-details.html.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if admin.json_response %}
|
||||
{{ admin.json_response|json_encode }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% if admin.route %}
|
||||
{% set user = admin.data('users/' ~ admin.route) %}
|
||||
{% endif %}
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not admin.route %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="#modal" data-remodal-target="modal"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_ACCOUNT"|tu }}</a>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-child"></i> Users</h1>
|
||||
{% else %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
{% include 'partials/messages.html.twig' %}
|
||||
|
||||
{% if not admin.route %}
|
||||
{% include 'partials/users-list.html.twig' %}
|
||||
|
||||
<div class="remodal" data-remodal-id="modal" data-remodal-options="hashTracking: false">
|
||||
{% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('user/account_new') } %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include 'partials/users-details.html.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user