diff --git a/classes/plugin/AdminController.php b/classes/plugin/AdminController.php index 6c10f497..72cb8b0e 100644 --- a/classes/plugin/AdminController.php +++ b/classes/plugin/AdminController.php @@ -678,7 +678,7 @@ class AdminController extends AdminBaseController return false; } - $this->post = ['_redirect' => 'themes']; + $this->post = ['_redirect' => 'themes' ]; // Make sure theme exists (throws exception) $name = $this->route; @@ -699,6 +699,8 @@ class AdminController extends AdminBaseController $this->admin->setMessage($this->admin::translate('PLUGIN_ADMIN.SUCCESSFULLY_CHANGED_THEME'), 'info'); Cache::clearCache('invalidate'); + + $this->post = ['_redirect' => 'themes/' . $name ]; return true; } diff --git a/themes/grav/templates/partials/modal-switch-theme.html.twig b/themes/grav/templates/partials/modal-switch-theme.html.twig new file mode 100644 index 00000000..5a4f17b5 --- /dev/null +++ b/themes/grav/templates/partials/modal-switch-theme.html.twig @@ -0,0 +1,16 @@ +
+
+

{{ "PLUGIN_ADMIN.SWITCHING_TO"|tu }} {theme_name}

+

+ {{ "PLUGIN_ADMIN.SWITCHING_TO_DESCRIPTION"|tu }} +

+

+ {{ "PLUGIN_ADMIN.SWITCHING_TO_CONFIRMATION"|tu }} {theme_name}? +

+
+
+ + {{ "PLUGIN_ADMIN.CONTINUE"|tu }} +
+
+
\ No newline at end of file diff --git a/themes/grav/templates/partials/themes-details.html.twig b/themes/grav/templates/partials/themes-details.html.twig index be01e31e..d2d3d54b 100644 --- a/themes/grav/templates/partials/themes-details.html.twig +++ b/themes/grav/templates/partials/themes-details.html.twig @@ -3,6 +3,9 @@ {% set isTestingRelease = gpm.isTestingRelease(theme.slug) %} {% set gumroad_loaded = false %} +{% set state = 'inactive' %} +{% if (config.get('system.pages.theme') == theme.slug) %}{% set state = 'active' %}{% endif %} +
@@ -107,6 +110,7 @@ {% if (installed) %} + {% if (state == 'active') %} {% set data = admin.data('themes/' ~ admin.route) %} {% include 'partials/blueprints.html.twig' with { data: data, blueprints: data.blueprints } %} @@ -119,6 +123,23 @@ {{ "PLUGIN_ADMIN.REMOVE_THEME"|tu }} {% endif %} + {% else %} +
+ +
+
+
+ +
+ +
+
+
+ {% endif %} {% else %}
{% if (theme.premium and not admin.license(theme.slug)) %} @@ -133,6 +154,7 @@
{% endif %} +{% include 'partials/modal-switch-theme.html.twig' with {theme_name: theme.name} %} {% include 'partials/modal-changes-detected.html.twig' %} {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %} {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %} diff --git a/themes/grav/templates/partials/themes-list.html.twig b/themes/grav/templates/partials/themes-list.html.twig index 8f9a1610..1a865c56 100644 --- a/themes/grav/templates/partials/themes-list.html.twig +++ b/themes/grav/templates/partials/themes-list.html.twig @@ -66,7 +66,7 @@ {% else %} - {{ "PLUGIN_ADMIN.ACTIVATE"|tu }} + {{ "PLUGIN_ADMIN.ACTIVATE"|tu }} {% endif %} @@ -75,22 +75,6 @@ {% endfor %} -
-
-

{{ "PLUGIN_ADMIN.SWITCHING_TO"|tu }} {theme_name}

-

- {{ "PLUGIN_ADMIN.SWITCHING_TO_DESCRIPTION"|tu }} -

-

- {{ "PLUGIN_ADMIN.SWITCHING_TO_CONFIRMATION"|tu }} {theme_name}? -

-
-
- - {{ "PLUGIN_ADMIN.CONTINUE"|tu }} -
-
-
- +{% include 'partials/modal-switch-theme.html.twig' %} {% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %} {% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}