Remove many usages of `Discourse` in templates as it's deprecated in new

releases of Ember
This commit is contained in:
Robin Ward 2014-09-11 16:30:47 -04:00
parent af6936cf72
commit 8559bbe508
11 changed files with 18 additions and 13 deletions

View File

@ -11,6 +11,8 @@ export default Ember.Controller.extend({
versionCheck: null, versionCheck: null,
problemsCheckMinutes: 1, problemsCheckMinutes: 1,
showVersionChecks: Discourse.computed.setting('version_checks'),
foundProblems: function() { foundProblems: function() {
return(Discourse.User.currentProp('admin') && this.get('problems') && this.get('problems').length > 0); return(Discourse.User.currentProp('admin') && this.get('problems') && this.get('problems').length > 0);
}.property('problems'), }.property('problems'),

View File

@ -10,11 +10,13 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
loading: false, loading: false,
content: [], content: [],
actions: {
clearBlock: function(row){ clearBlock: function(row){
row.clearBlock().then(function(){ row.clearBlock().then(function(){
// feeling lazy // feeling lazy
window.location.reload(); window.location.reload();
}); });
}
}, },
show: function() { show: function() {

View File

@ -13,6 +13,7 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
content: null, content: null,
loading: false, loading: false,
mustApproveUsers: Discourse.computed.setting('must_approve_users'),
queryNew: Em.computed.equal('query', 'new'), queryNew: Em.computed.equal('query', 'new'),
queryPending: Em.computed.equal('query', 'pending'), queryPending: Em.computed.equal('query', 'pending'),
queryHasApproval: Em.computed.or('queryNew', 'queryPending'), queryHasApproval: Em.computed.or('queryNew', 'queryPending'),

View File

@ -1,5 +1,5 @@
<div class="dashboard-left"> <div class="dashboard-left">
{{#if Discourse.SiteSettings.version_checks}} {{#if showVersionChecks}}
{{partial 'admin/templates/version_checks'}} {{partial 'admin/templates/version_checks'}}
{{/if}} {{/if}}

View File

@ -17,7 +17,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{{view Discourse.ScreenedEmailsListView contentBinding="controller"}} {{view 'screened-emails-list' content=controller}}
</div> </div>
{{else}} {{else}}

View File

@ -19,7 +19,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{{view Discourse.ScreenedIpAddressesListView contentBinding="controller"}} {{view 'screened-ip-addresses-list' content=controller}}
</div> </div>
{{else}} {{else}}

View File

@ -15,7 +15,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{{view Discourse.ScreenedUrlsListView contentBinding="controller"}} {{view 'screened-urls-list' content=controller}}
</div> </div>
{{else}} {{else}}

View File

@ -48,7 +48,7 @@
<div class='admin-loading'>{{i18n loading}}</div> <div class='admin-loading'>{{i18n loading}}</div>
{{else}} {{else}}
{{#if model.length}} {{#if model.length}}
{{view Discourse.StaffActionLogsListView contentBinding="controller"}} {{view "staff-action-logs-list" content=controller}}
{{else}} {{else}}
{{i18n search.no_results}} {{i18n search.no_results}}
{{/if}} {{/if}}

View File

@ -1,5 +1,5 @@
{{#if filteredContent.length}} {{#if filteredContent.length}}
{{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemViewClass="Discourse.SiteSettingView"}} {{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemView="site-setting"}}
{{else}} {{else}}
<br/> <br/>
{{i18n admin.site_settings.no_results}} {{i18n admin.site_settings.no_results}}

View File

@ -3,7 +3,7 @@
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li>{{#link-to 'adminUsersList.active'}}{{i18n admin.users.nav.active}}{{/link-to}}</li> <li>{{#link-to 'adminUsersList.active'}}{{i18n admin.users.nav.active}}{{/link-to}}</li>
<li>{{#link-to 'adminUsersList.new'}}{{i18n admin.users.nav.new}}{{/link-to}}</li> <li>{{#link-to 'adminUsersList.new'}}{{i18n admin.users.nav.new}}{{/link-to}}</li>
{{#if Discourse.SiteSettings.must_approve_users}} {{#if mustApproveUsers}}
<li>{{#link-to 'adminUsersList.pending'}}{{i18n admin.users.nav.pending}}{{/link-to}}</li> <li>{{#link-to 'adminUsersList.pending'}}{{i18n admin.users.nav.pending}}{{/link-to}}</li>
{{/if}} {{/if}}
<li>{{#link-to 'adminUsersList.admins'}}{{i18n admin.users.nav.admins}}{{/link-to}}</li> <li>{{#link-to 'adminUsersList.admins'}}{{i18n admin.users.nav.admins}}{{/link-to}}</li>

View File

@ -61,7 +61,7 @@
<div class="container posts"> <div class="container posts">
{{view Discourse.SelectedPostsView}} {{view "selected-posts"}}
<div class="row"> <div class="row">
<section class="topic-area" id='topic' data-topic-id='{{unbound id}}'> <section class="topic-area" id='topic' data-topic-id='{{unbound id}}'>