quicktray support + fix recompile

This commit is contained in:
Andy Miller
2020-05-07 21:48:33 -06:00
parent 054db3eeaf
commit 26d3995f05
8 changed files with 47 additions and 13 deletions

View File

@@ -46,6 +46,7 @@ popularity:
monthly: 12 monthly: 12
visitors: 20 visitors: 20
whitelabel: whitelabel:
quicktray_recompile: false
logo_custom: logo_custom:
logo_login: logo_login:
color_scheme: color_scheme:

View File

@@ -377,16 +377,22 @@ form:
accept: accept:
- image/* - image/*
whitelabel.customization: customization_section:
type: section type: section
underline: true underline: true
title: PLUGIN_ADMIN.CUSTOMIZATION title: PLUGIN_ADMIN.CUSTOMIZATION
themes-preview: whitelabel.quicktray_recompile:
type: themepreview type: toggle
ignore: true; label: PLUGIN_ADMIN.QUICKTRAY_RECOMPILE
label: PLUGIN_ADMIN.PRESETS help: PLUGIN_ADMIN.QUICKTRAY_RECOMPILE_HELP
style: vertical highlight: 0
default: 0
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
whitelabel.color_scheme.name: whitelabel.color_scheme.name:
type: text type: text
@@ -394,6 +400,23 @@ form:
help: PLUGIN_ADMIN.COLOR_SCHEME_NAME_HELP help: PLUGIN_ADMIN.COLOR_SCHEME_NAME_HELP
placeholder: PLUGIN_ADMIN.COLOR_SCHEME_NAME_PLACEHOLDER placeholder: PLUGIN_ADMIN.COLOR_SCHEME_NAME_PLACEHOLDER
whitelabel.import_theme:
type: file
label: PLUGIN_ADMIN.IMPORT_THEME
destination: 'user://data/admin/themes'
multiple: true
random_name: false
avoid_overwriting: true
accept:
- application/x-yaml
- text/x-yaml
themes-preview:
type: themepreview
ignore: true;
label: PLUGIN_ADMIN.PRESETS
style: vertical
colorschemes: colorschemes:
type: colorscheme type: colorscheme
label: PLUGIN_ADMIN.COLOR_SCHEME_LABEL label: PLUGIN_ADMIN.COLOR_SCHEME_LABEL

View File

@@ -2160,7 +2160,7 @@ class AdminController extends AdminBaseController
protected function taskCompileScss() protected function taskCompileScss()
{ {
if (!$this->authorizeTask('compile scss', ['admin.pages', 'admin.super'])) { if (!$this->authorizeTask('compile scss', ['admin.super'])) {
return false; return false;
} }

View File

@@ -940,3 +940,6 @@ PLUGIN_ADMIN:
LOAD_PRESET: "Load Preset" LOAD_PRESET: "Load Preset"
RECOMPILE: "Recompile" RECOMPILE: "Recompile"
EXPORT: "Export" EXPORT: "Export"
IMPORT_THEME: "Import Theme (.yaml file)"
QUICKTRAY_RECOMPILE: "QuickTray Recompile Icon"
QUICKTRAY_RECOMPILE_HELP: "Will recompile the preset SCSS to pickup any changes or new plugins"

View File

@@ -208,9 +208,9 @@ one-dark:
content-tabs-text: '#9ea5b3' content-tabs-text: '#9ea5b3'
button-bg: '#383F4C' button-bg: '#383F4C'
button-text: '#d8dadf' button-text: '#d8dadf'
notice-bg: '#25b4c7' notice-bg: '#18a4ba'
notice-text: '#dfe3ed' notice-text: '#dfe3ed'
update-bg: '#71c435' update-bg: '#4fa814'
update-text: '#dfe3ed' update-text: '#dfe3ed'
critical-bg: '#d13e46' critical-bg: '#d13e46'
critical-text: '#dfe3ed' critical-text: '#dfe3ed'
@@ -354,7 +354,7 @@ cobalt2:
button-text: '#ffffff' button-text: '#ffffff'
notice-bg: '#0476e0' notice-bg: '#0476e0'
notice-text: '#ffffff' notice-text: '#ffffff'
update-bg: '#cfa200' update-bg: '#ffc600'
update-text: '#ffffff' update-text: '#0e1d2b'
critical-bg: '#d13e46' critical-bg: '#d13e46'
critical-text: '#dfe3ed' critical-text: '#dfe3ed'

View File

@@ -52,7 +52,7 @@ body.on('click', '[data-recompile-scss]', (event) => {
let element = $(event.currentTarget); let element = $(event.currentTarget);
if (element.data('busy_right_now')) { return false; } if (element.data('busy_right_now')) { return false; }
compiler(element, false, false); compiler(element, true, false);
}); });
body.on('click', '[data-export-scss]', (event) => { body.on('click', '[data-export-scss]', (event) => {

File diff suppressed because one or more lines are too long

View File

@@ -7,6 +7,13 @@
</a> </a>
</li> </li>
{% endif %} {% endif %}
{% if authorize(['admin.super']) and config.plugins.admin.whitelabel.quicktray_recompile %}
<li class="hint--bottom" data-hint="{{ "PLUGIN_ADMIN.QUICKTRAY_RECOMPILE_HELP"|tu }}">
<a data-recompile-scss href="#">
<i class="fa fa-paint-brush"></i>
</a>
</li>
{% endif %}
{% if grav.twig.plugins_quick_tray %} {% if grav.twig.plugins_quick_tray %}
{% for label, item in grav.twig.plugins_quick_tray %} {% for label, item in grav.twig.plugins_quick_tray %}
{% if authorize((item.authorize is defined and item.authorize is iterable) ? item.authorize : [item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %} {% if authorize((item.authorize is defined and item.authorize is iterable) ? item.authorize : [item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %}