diff options
| author | 2017-12-02 13:45:26 +0100 | |
|---|---|---|
| committer | 2017-12-02 13:45:26 +0100 | |
| commit | 8abfe1cf28b9ca4b1b53073dbb1ec24953855777 (patch) | |
| tree | 4aa5ce1004af6aad2b0c519f8cb736ff34317c37 | |
| parent | b5626391553b57d85cca87869c27ffdbdb9a0b04 (diff) | |
Update panel shows latest version message as success (#1701)
show latest version message as success, FIXES #1586
| -rw-r--r-- | app/Controllers/updateController.php | 4 | ||||
| -rw-r--r-- | app/views/update/index.phtml | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 7a8a3d6c0..c67b358bb 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -102,7 +102,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { $version = 'git'; } else { $this->view->message = array( - 'status' => 'bad', + 'status' => 'latest', 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.none') ); @@ -138,7 +138,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { $status = $res_array[0]; if (strpos($status, 'UPDATE') !== 0) { $this->view->message = array( - 'status' => 'bad', + 'status' => 'latest', 'title' => _t('gen.short.damn'), 'body' => _t('feedback.update.none') ); diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml index da1bc7ef5..0599d5b0d 100644 --- a/app/views/update/index.phtml +++ b/app/views/update/index.phtml @@ -14,7 +14,21 @@ </p> <?php if (!empty($this->message)) { ?> - <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <?php + $class = 'alert-warn'; + switch ($this->message['status']) { + case 'bad': + $class = 'alert-error'; + break; + case 'latest': + $class = 'alert-success'; + break; + default: + $class = 'alert-warn'; + break; + } + ?> + <p class="alert <?php echo $class; ?>"> <span class="alert-head"><?php echo $this->message['title']; ?></span> <?php echo $this->message['body']; ?> </p> |
