Fix site title issue when installing a theme/plugin, title was "Plugin: | Grav" or "Theme: | Grav"

This commit is contained in:
Flavio Copes
2016-03-10 18:28:26 +01:00
parent b99f6c5f92
commit 67c4a4e501
2 changed files with 26 additions and 19 deletions

View File

@@ -5,19 +5,21 @@
{% if plugin_slug %}
{% set installing = plugin_slug starts with 'install' %}
{# Try installed packages first, then remote #}
{% set package = admin.plugins(true)[plugin_slug] %}
{% if (not package) %}
{# Remote #}
{% set package = admin.plugins(false)[plugin_slug] %}
{% set installed = false %}
{% if installing %}
{% set title = "PLUGIN_ADMIN.PLUGINS"|tu %}
{% else %}
{# Local #}
{% set installed = true %}
{% endif %}
{% set plugin = package.toArray() %}
{% set title = "PLUGIN_ADMIN.PLUGIN"|tu ~ ": " ~ plugin.name|e %}
{# 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 %}
{% else %}
{% set title = "PLUGIN_ADMIN.PLUGINS"|tu %}
{% endif %}

View File

@@ -2,17 +2,22 @@
{% 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 %}
{% if installing %}
{% set title = "PLUGIN_ADMIN.THEMES"|tu %}
{% else %}
{% 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 %}
{% set theme = package.toArray() %}
{% set title = "PLUGIN_ADMIN.THEME"|tu ~ ": " ~ theme.name|e %}
{% else %}
{% set title = "PLUGIN_ADMIN.THEMES"|tu %}
{% endif %}