mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-15 09:46:06 +01:00
A better update success message. Update the version in the footer.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,10 +122,16 @@ $(function () {
|
||||
url: url,
|
||||
toastErrors: true,
|
||||
success: function(result, status) {
|
||||
toastr.success(result.message);
|
||||
|
||||
if (url.indexOf('task:updategrav') !== -1) {
|
||||
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('<p>' + icon + content + button + '</p>');
|
||||
window.grav_available_version = grav.available;
|
||||
}
|
||||
|
||||
$('#grav-update-button').on('click', function() {
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
{% block content_bottom %}{% endblock %}
|
||||
</div>
|
||||
<footer id="footer">
|
||||
<a href="http://getgrav.org">Grav</a> version {{ constant('GRAV_VERSION') }} was made with <i class="fa fa-heart"></i> by <a href="http:/www.rockettheme.com">RocketTheme</a>.
|
||||
<a href="http://getgrav.org">Grav</a> version <span class="grav-version">{{ constant('GRAV_VERSION') }}</span> was made with <i class="fa fa-heart"></i> by <a href="http:/www.rockettheme.com">RocketTheme</a>.
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user