2013-02-20 13:15:50 -05:00
|
|
|
(function() {
|
|
|
|
|
2013-02-21 12:58:21 -05:00
|
|
|
/**
|
|
|
|
This controller supports the default interface when you enter the admin section.
|
|
|
|
|
|
|
|
@class AdminDashboardController
|
|
|
|
@extends Ember.Controller
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2013-02-20 13:15:50 -05:00
|
|
|
window.Discourse.AdminDashboardController = Ember.Controller.extend({
|
|
|
|
loading: true,
|
|
|
|
versionCheck: null,
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
upToDate: (function() {
|
|
|
|
if (this.versionCheck) {
|
|
|
|
return this.versionCheck.latest_version === this.versionCheck.installed_version;
|
|
|
|
}
|
2013-02-21 12:58:21 -05:00
|
|
|
return true;
|
2013-02-20 13:15:50 -05:00
|
|
|
}).property('versionCheck'),
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
updateIconClasses: (function() {
|
|
|
|
var classes;
|
|
|
|
classes = "icon icon-warning-sign ";
|
|
|
|
if (this.get('versionCheck.critical_updates')) {
|
|
|
|
classes += "critical-updates-available";
|
|
|
|
} else {
|
|
|
|
classes += "updates-available";
|
|
|
|
}
|
|
|
|
return classes;
|
|
|
|
}).property('versionCheck'),
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
priorityClass: (function() {
|
|
|
|
if (this.get('versionCheck.critical_updates')) {
|
|
|
|
return 'version-check critical';
|
|
|
|
}
|
2013-02-21 12:58:21 -05:00
|
|
|
return 'version-check normal';
|
2013-02-20 13:15:50 -05:00
|
|
|
}).property('versionCheck')
|
2013-02-21 12:58:21 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|