diff --git a/classes/controller.php b/classes/controller.php index 97c1ce53..4a30cc68 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -703,19 +703,11 @@ class AdminController $result = \Grav\Plugin\Admin\Gpm::selfupgrade(); if ($result) { - $this->admin->json_response = ['status' => 'success', 'message' => 'Everything updated']; + $this->admin->json_response = ['status' => 'success', 'message' => 'Grav was successfully updated to ']; } else { - $this->admin->json_response = ['status' => 'error', 'message' => 'Updates failed']; + $this->admin->json_response = ['status' => 'error', 'message' => 'Grav update failed']; } - if ($result) { - $this->admin->setMessage("Installation successful.", 'info'); - } else { - $this->admin->setMessage("Installation failed.", 'error'); - } - - //$this->post = array('_redirect' => $this->view . '/' . $this->route); - return true; } diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index 687425e1..7618c731 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -122,10 +122,16 @@ $(function () { url: url, toastErrors: true, success: function(result, status) { - toastr.success(result.message); - if (url.indexOf('task:updategrav') !== -1) { - $('[data-gpm-grav]').remove(); + if (result.status == 'success') { + $('[data-gpm-grav]').remove(); + toastr.success(result.message + window.grav_available_version); + $('#footer .grav-version').html(window.grav_available_version); + } else { + toastr.success(result.message); + } + } else { + toastr.success(result.message); } } }).always(function() { @@ -231,6 +237,7 @@ $(function () { content = jQuery.substitute(content, {available: grav.available, version: grav.version}); $('[data-gpm-grav]').addClass('grav').html('

' + icon + content + button + '

'); + window.grav_available_version = grav.available; } $('#grav-update-button').on('click', function() { diff --git a/themes/grav/templates/partials/base.html.twig b/themes/grav/templates/partials/base.html.twig index 06633c8c..c5ccd4a8 100644 --- a/themes/grav/templates/partials/base.html.twig +++ b/themes/grav/templates/partials/base.html.twig @@ -90,7 +90,7 @@ {% block content_bottom %}{% endblock %}