2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Refactor functions out of the dashboard controller

This commit is contained in:
Neil Lalonde 2013-02-21 15:03:43 -05:00
parent dd6d98f48f
commit 2d1bbf22e9
4 changed files with 41 additions and 43 deletions

View file

@ -10,39 +10,7 @@
**/
window.Discourse.AdminDashboardController = Ember.Controller.extend({
loading: true,
versionCheck: null,
upToDate: function() {
if (this.get('versionCheck')) {
return this.get('versionCheck.latest_version') === this.get('versionCheck.installed_version');
}
return true;
}.property('versionCheck'),
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.critical_updates'),
priorityClass: function() {
if (this.get('versionCheck.critical_updates')) {
return 'version-check critical';
}
}.property('versionCheck.critical_updates'),
gitLink: function() {
return "https://github.com/discourse/discourse/tree/" + this.get('versionCheck.installed_sha');
}.property('versionCheck.installed_sha'),
shortSha: function() {
return this.get('versionCheck.installed_sha').substr(0,10);
}.property('versionCheck.installed_sha')
versionCheck: null
});
}).call(this);