diff --git a/lib/autogit.php b/lib/autogit.php old mode 100755 new mode 100644 index 4a4df12..f3252f1 --- a/lib/autogit.php +++ b/lib/autogit.php @@ -55,6 +55,7 @@ public function commit($message) public function pull() { $this->execute("pull {$this->remoteName} {$this->remoteBranch} 2>&1"); + kirby()->cache()->flush(); } public function push() @@ -62,6 +63,11 @@ public function push() $this->execute("push {$this->remoteName} {$this->remoteBranch} 2>&1"); } + public function getStatus() + { + return $this->execute("status 2>&1")[1]; + } + public function hasRemote($remoteName = null) { $remoteName = $remoteName ? $remoteName : $this->remoteName; diff --git a/widgets/autogit/template.php b/widgets/autogit/template.php index a6e0624..fed9d60 100644 --- a/widgets/autogit/template.php +++ b/widgets/autogit/template.php @@ -22,9 +22,6 @@ margin-top: .5em; text-align: center; } -.autogit-status { - display: none; } - .autogit-warning { color: #b3000a; } @@ -57,7 +54,7 @@ Get latest changes -
+
getStatus() ?>
Could not detect remote repository . @@ -87,22 +84,22 @@ $.post(panelURL + '/autogit/' + $button.data('action')) .done(function (res) { $button.find('.icon').replaceWith($successIcon) - $status.text(res.message).show(600) + $status.text(res.message).show(0) }) .fail(function (res) { $button.find('.icon').replaceWith($errorIcon) $button.removeClass('btn-positive').addClass('btn-negative') - $status.text(res.responseJSON.message).show(600) + $status.text(res.responseJSON.message).show(0) }) .always(function () { setTimeout(function () { $button.find('.icon').replaceWith($defaultIcon) $button.removeClass('btn-negative').addClass('btn-positive') $otherButton.prop('disabled', false) - $status.hide(600, function () { + $status.hide(0, function () { $(this).text('') }) - }, 6000) + }, 10000) }) })