A better update success message. Update the version in the footer.

This commit is contained in:
Flavio Copes
2015-08-06 17:23:08 +02:00
parent 66764b2255
commit 7b705d3595
3 changed files with 13 additions and 14 deletions

View File

@@ -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;
}

View File

@@ -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() {

View File

@@ -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>