mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Version check gets how many versions behind you are, and shows judgemental faces on the dashboard
This commit is contained in:
@@ -8,8 +8,12 @@
|
||||
**/
|
||||
Discourse.VersionCheck = Discourse.Model.extend({
|
||||
upToDate: function() {
|
||||
return this.get('latest_version') === this.get('installed_version');
|
||||
}.property('latest_version', 'installed_version'),
|
||||
return this.get('missing_versions_count') === 0;
|
||||
}.property('missing_versions_count'),
|
||||
|
||||
behindByOneVersion: function() {
|
||||
return this.get('missing_versions_count') === 1;
|
||||
}.property('missing_versions_count'),
|
||||
|
||||
gitLink: function() {
|
||||
return "https://github.com/discourse/discourse/tree/" + this.get('installed_sha');
|
||||
|
||||
@@ -14,9 +14,15 @@
|
||||
<p class="version-notes">
|
||||
{{i18n admin.dashboard.latest_version}}: <span class="version-number">{{ versionCheck.latest_version }}</span>
|
||||
{{#if versionCheck.upToDate }}
|
||||
<i class='icon icon-ok update-to-date'></i> {{i18n admin.dashboard.up_to_date}}
|
||||
<span class='icon update-to-date'>☻</span> {{i18n admin.dashboard.up_to_date}}
|
||||
{{else}}
|
||||
<i {{bindAttr class=":icon :icon-warning-sign versionCheck.critical_updates:critical-updates-available:updates-available"}}></i>
|
||||
<span {{bindAttr class=":icon versionCheck.critical_updates:critical-updates-available:updates-available"}}>
|
||||
{{#if versionCheck.behindByOneVersion}}
|
||||
☺
|
||||
{{else}}
|
||||
☹
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="critical-note">{{i18n admin.dashboard.critical_available}}</span>
|
||||
<span class="normal-note">{{i18n admin.dashboard.updates_available}}</span>
|
||||
{{i18n admin.dashboard.please_upgrade}}
|
||||
|
||||
Reference in New Issue
Block a user