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