mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Move topic list extensibility to topic-list component
This commit is contained in:
@@ -52,7 +52,8 @@ export default Ember.Component.extend(bufferedRender({
|
|||||||
classes.push('has-excerpt');
|
classes.push('has-excerpt');
|
||||||
}
|
}
|
||||||
|
|
||||||
_.each(['liked', 'archived', 'bookmarked'],function(name) {
|
|
||||||
|
['liked', 'archived', 'bookmarked', 'pinned'].forEach(name => {
|
||||||
if (topic.get(name)) {
|
if (topic.get(name)) {
|
||||||
classes.push(name);
|
classes.push(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ export default Ember.Component.extend({
|
|||||||
classNames: ['topic-list'],
|
classNames: ['topic-list'],
|
||||||
showTopicPostBadges: true,
|
showTopicPostBadges: true,
|
||||||
|
|
||||||
|
// Overwrite this to perform client side filtering of topics, if desired
|
||||||
|
filteredTopics: Ember.computed.alias('topics'),
|
||||||
|
|
||||||
_init: function(){
|
_init: function(){
|
||||||
this.addObserver('hideCategory', this.rerender);
|
this.addObserver('hideCategory', this.rerender);
|
||||||
this.addObserver('order', this.rerender);
|
this.addObserver('order', this.rerender);
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ const controllerOpts = {
|
|||||||
this.setProperties({ order: "default", ascending: false });
|
this.setProperties({ order: "default", ascending: false });
|
||||||
},
|
},
|
||||||
|
|
||||||
// Overwrite this to perform client side filtering of topics, if desired
|
|
||||||
filteredTopics: Ember.computed.alias('model.topics'),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
changeSort(sortBy) {
|
changeSort(sortBy) {
|
||||||
|
|||||||
@@ -14,8 +14,20 @@
|
|||||||
bulkSelectEnabled=bulkSelectEnabled}}
|
bulkSelectEnabled=bulkSelectEnabled}}
|
||||||
</thead>
|
</thead>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
|
{{plugin-outlet
|
||||||
|
name="before-topic-list-body"
|
||||||
|
args=(hash
|
||||||
|
topics=topics
|
||||||
|
selected=selected
|
||||||
|
bulkSelectEnabled=bulkSelectEnabled
|
||||||
|
lastVisitedTopic=lastVisitedTopic
|
||||||
|
discoveryList=discoveryList)
|
||||||
|
tagName=""
|
||||||
|
connectorTagName=""}}
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each topics as |topic|}}
|
{{#each filteredTopics as |topic|}}
|
||||||
{{topic-list-item topic=topic
|
{{topic-list-item topic=topic
|
||||||
bulkSelectEnabled=bulkSelectEnabled
|
bulkSelectEnabled=bulkSelectEnabled
|
||||||
showTopicPostBadges=showTopicPostBadges
|
showTopicPostBadges=showTopicPostBadges
|
||||||
|
|||||||
@@ -32,12 +32,6 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if hasTopics}}
|
{{#if hasTopics}}
|
||||||
|
|
||||||
{{plugin-outlet
|
|
||||||
name="discovery-before-topic-list"
|
|
||||||
tagName=""
|
|
||||||
args=(hash model=model category=category)}}
|
|
||||||
|
|
||||||
{{topic-list
|
{{topic-list
|
||||||
highlightLastVisited=true
|
highlightLastVisited=true
|
||||||
top=top
|
top=top
|
||||||
@@ -54,7 +48,8 @@
|
|||||||
expandGloballyPinned=expandGloballyPinned
|
expandGloballyPinned=expandGloballyPinned
|
||||||
expandAllPinned=expandAllPinned
|
expandAllPinned=expandAllPinned
|
||||||
category=category
|
category=category
|
||||||
topics=filteredTopics}}
|
topics=model.topics
|
||||||
|
discoveryList=true}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/discovery-topics-list}}
|
{{/discovery-topics-list}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user