Version check gets how many versions behind you are, and shows judgemental faces on the dashboard

This commit is contained in:
Neil Lalonde
2013-03-05 18:14:51 -05:00
parent 3c1388bbd7
commit f8e04a5c48
7 changed files with 38 additions and 20 deletions

View File

@@ -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');

View File

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