2013-02-21 02:15:50 +08:00
|
|
|
(function() {
|
|
|
|
|
2013-02-22 03:09:28 +08:00
|
|
|
/**
|
|
|
|
Handles the default admin route
|
|
|
|
|
2013-02-26 05:21:52 +08:00
|
|
|
@class AdminDashboardRoute
|
2013-02-22 03:09:28 +08:00
|
|
|
@extends Discourse.Route
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2013-02-21 02:15:50 +08:00
|
|
|
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
|
|
|
setupController: function(c) {
|
2013-02-26 05:21:52 +08:00
|
|
|
if( !c.get('versionCheckedAt') || Date.create('12 hours ago') > c.get('versionCheckedAt') ) {
|
|
|
|
this.checkVersion(c);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
renderTemplate: function() {
|
|
|
|
this.render({into: 'admin/templates/admin'});
|
|
|
|
},
|
|
|
|
|
|
|
|
checkVersion: function(c) {
|
2013-02-21 23:19:02 +08:00
|
|
|
if( Discourse.SiteSettings.version_checks ) {
|
2013-02-22 03:09:28 +08:00
|
|
|
Discourse.VersionCheck.find().then(function(vc) {
|
2013-02-21 23:19:02 +08:00
|
|
|
c.set('versionCheck', vc);
|
2013-02-26 05:21:52 +08:00
|
|
|
c.set('versionCheckedAt', new Date());
|
2013-02-22 03:09:28 +08:00
|
|
|
c.set('loading', false);
|
2013-02-21 23:19:02 +08:00
|
|
|
});
|
|
|
|
}
|
2013-02-21 02:15:50 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|