diff --git a/app/assets/javascripts/admin/templates/emojis.hbs b/app/assets/javascripts/admin/templates/emojis.hbs index 146baba74..ca6fd742d 100644 --- a/app/assets/javascripts/admin/templates/emojis.hbs +++ b/app/assets/javascripts/admin/templates/emojis.hbs @@ -5,7 +5,7 @@
{{emoji-uploader done="emojiUploaded"}}
- {{#if controller}} + {{#if model}}:{{e.name}}: | diff --git a/app/assets/javascripts/admin/templates/groups_type.hbs b/app/assets/javascripts/admin/templates/groups_type.hbs index 4486b8780..45bb054ad 100644 --- a/app/assets/javascripts/admin/templates/groups_type.hbs +++ b/app/assets/javascripts/admin/templates/groups_type.hbs @@ -2,7 +2,7 @@|
---|---|
{{#if plugin.url}}
diff --git a/app/assets/javascripts/admin/templates/site-settings.hbs b/app/assets/javascripts/admin/templates/site-settings.hbs
index b9a96c90c..5fd954593 100644
--- a/app/assets/javascripts/admin/templates/site-settings.hbs
+++ b/app/assets/javascripts/admin/templates/site-settings.hbs
@@ -14,7 +14,7 @@
{{#if user.can_approve}}
{{input type="checkbox" checked=user.selected}}
diff --git a/app/assets/javascripts/discourse/components/bulk-select-button.js.es6 b/app/assets/javascripts/discourse/components/bulk-select-button.js.es6
index 8c50f5e0e..fd5d45946 100644
--- a/app/assets/javascripts/discourse/components/bulk-select-button.js.es6
+++ b/app/assets/javascripts/discourse/components/bulk-select-button.js.es6
@@ -4,7 +4,7 @@ export default Ember.Component.extend({
actions: {
showBulkActions() {
const controller = showModal('topic-bulk-actions', { model: this.get('selected'), title: 'topics.bulk.actions' });
- controller.set('refreshTarget', this.get('refreshTarget'));
+ controller.set('refreshClosure', () => this.sendAction());
}
}
});
diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6
index b22330abb..20f6490b1 100644
--- a/app/assets/javascripts/discourse/controllers/composer.js.es6
+++ b/app/assets/javascripts/discourse/controllers/composer.js.es6
@@ -77,6 +77,8 @@ export default Ember.Controller.extend({
}
}),
+ topicModel: Ember.computed.alias('controllers.topic.model'),
+
_initializeSimilar: function() {
this.set('similarTopics', []);
}.on('init'),
@@ -252,7 +254,7 @@ export default Ember.Controller.extend({
// if we are replying to a topic AND not on the topic pop the window up
if (!force && composer.get('replyingToTopic')) {
- const currentTopic = this.get('controllers.topic.model');
+ const currentTopic = this.get('topicModel');
if (!currentTopic || currentTopic.get('id') !== composer.get('topic.id'))
{
const message = I18n.t("composer.posting_not_on_topic");
@@ -346,7 +348,7 @@ export default Ember.Controller.extend({
});
if (this.get('controllers.application.currentRouteName').split('.')[0] === 'topic' &&
- composer.get('topic.id') === this.get('controllers.topic.model.id')) {
+ composer.get('topic.id') === this.get('topicModel.id')) {
staged = composer.get('stagedPost');
}
diff --git a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
index 89a6b0e70..e1c710115 100644
--- a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
@@ -61,8 +61,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
this.perform(operation).then(topics => {
if (topics) {
topics.forEach(cb);
- const refreshTarget = this.get('refreshTarget');
- if (refreshTarget) { refreshTarget.send('refresh'); }
+ (this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
}
});
@@ -70,8 +69,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
performAndRefresh(operation) {
return this.perform(operation).then(() => {
- const refreshTarget = this.get('refreshTarget');
- if (refreshTarget) { refreshTarget.send('refresh'); }
+ (this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
});
},
@@ -117,8 +115,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
this.perform({type: 'change_category', category_id: categoryId}).then(topics => {
topics.forEach(t => t.set('category', category));
- const refreshTarget = this.get('refreshTarget');
- if (refreshTarget) { refreshTarget.send('refresh'); }
+ (this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
});
},
diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs
index f3140a70c..44c91b570 100644
--- a/app/assets/javascripts/discourse/templates/composer.hbs
+++ b/app/assets/javascripts/discourse/templates/composer.hbs
@@ -44,7 +44,7 @@
{{#if model.canEditTitle}}
|
{{#if model.creatingPrivateMessage}}
- {{user-selector topicId=controller.controllers.topic.model.id
+ {{user-selector topicId=topicModel.id
excludeCurrentUser="true"
id="private-message-users"
includeMentionableGroups="true"
diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs
index 8bb13926f..b467b0f92 100644
--- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs
+++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs
@@ -13,7 +13,7 @@
{{/if}}
-{{bulk-select-button selected=selected refreshTarget=controller}}
+{{bulk-select-button selected=selected action="refresh"}}
{{#discovery-topics-list model=model refresh="refresh" incomingCount=topicTrackingState.incomingCount}}
{{#if top}}
diff --git a/app/assets/javascripts/discourse/templates/full-page-search.hbs b/app/assets/javascripts/discourse/templates/full-page-search.hbs
index 7c39f11aa..e8a74f294 100644
--- a/app/assets/javascripts/discourse/templates/full-page-search.hbs
+++ b/app/assets/javascripts/discourse/templates/full-page-search.hbs
@@ -9,7 +9,7 @@
{{#if canBulkSelect}}
{{#if model.posts}}
{{d-button icon="list" class="bulk-select" title="topics.bulk.toggle" action="toggleBulkSelect"}}
- {{bulk-select-button selected=selected refreshTarget=controller}}
+ {{bulk-select-button selected=selected action="refresh"}}
{{/if}}
{{/if}}
@@ -66,7 +66,7 @@
{{/if}}
{{avatar result imageSize="tiny"}}
- {{topic-status topic=result.topic disableActions=true}}{{#highlight-text highlight=controller.q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}
+ {{topic-status topic=result.topic disableActions=true}}{{#highlight-text highlight=q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}
{{category-link result.topic.category}}
@@ -84,7 +84,7 @@
{{/if}}
{{#if result.blurb}}
- {{#highlight-text highlight=controller.q}}
+ {{#highlight-text highlight=q}}
{{{unbound result.blurb}}}
{{/highlight-text}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/templates/group-index.hbs b/app/assets/javascripts/discourse/templates/group-index.hbs
index 1641286ad..f38104880 100644
--- a/app/assets/javascripts/discourse/templates/group-index.hbs
+++ b/app/assets/javascripts/discourse/templates/group-index.hbs
@@ -1 +1 @@
-{{group-post-stream posts=controller emptyText=emptyText loadMore="loadMore"}}
+{{group-post-stream posts=model emptyText=emptyText loadMore="loadMore"}}
diff --git a/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.hbs b/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.hbs
index be2b59358..8abe6bc1f 100644
--- a/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.hbs
+++ b/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.hbs
@@ -32,12 +32,12 @@
{{raw "list/activity-column" topic=t tagName="div" class="num activity last"}}
{{t.last_poster_username}}
- {{#unless controller.hideCategory}}
+ {{#unless hideCategory}}
{{category-link t.category}}
{{/unless}}
- {{#if controller.showParticipants}}
+ {{#if showParticipants}}
{{#each participants as |p|}}
{{avatar p usernamePath="user.username" imageSize="small"}}
diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs
index e890fdacf..1047de967 100644
--- a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs
+++ b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.raw.hbs
@@ -17,11 +17,11 @@
- {{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=controller.showTopicPostBadges}}
+ {{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=showTopicPostBadges}}
- {{#unless controller.hideCategory}}
+ {{#unless hideCategory}}
{{category-link topic.category}}
diff --git a/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs b/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs
index a52aaffb7..34484ac61 100644
--- a/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs
+++ b/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs
@@ -1,7 +1,7 @@
{{#each notificationLevels as |level|}}
{{bound-avatar avatar "huge"}}
diff --git a/app/assets/javascripts/discourse/templates/user/badges.hbs b/app/assets/javascripts/discourse/templates/user/badges.hbs
index 042b08fbf..835a7fea3 100644
--- a/app/assets/javascripts/discourse/templates/user/badges.hbs
+++ b/app/assets/javascripts/discourse/templates/user/badges.hbs
@@ -1,5 +1,5 @@
|