- new "show-footer" mixins - converted most of the routes to ES6 - FIX: handling of "indexStream" in user pages There will now be a footer on all the following pages - /exception - /about - /latest - /new - /unread - /starred - /top - /categories - /c/:category - /c/:category/l/latest - /c/:category/l/new - /c/:category/l/unread - /c/:category/l/top - /t/:topic/:id - /groups/:name/members - /user/activity - /user/activity/topics - /user/activity/posts - /user/activity/replies - /user/activity/likes-given - /user/activity/likes-received - /user/activity/bookmarks - /user/activity/starred - /user/badges - /user/notifications - /user/flagged-posts - /user/deleted-posts - /user/private-messages - /user/private-messages/mine - /user/private-messages/unread - /user/invited - /user/:username/preferences - /faq (static pages) - /badges - /badges/:id/:badge
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
import ObjectController from 'discourse/controllers/object';
|
|
|
|
// Handles displaying of a topic as a list item
|
|
export default Ember.ObjectController.extend({
|
|
needs: ['discovery/topics'],
|
|
|
|
canStar: Em.computed.alias('controllers.discovery/topics.currentUser.id'),
|
|
bulkSelectEnabled: Em.computed.alias('controllers.discovery/topics.bulkSelectEnabled'),
|
|
showTopicPostBadges: Em.computed.not('controllers.discovery/topics.new'),
|
|
|
|
checked: function(key, value) {
|
|
var selected = this.get('controllers.discovery/topics.selected'),
|
|
topic = this.get('model');
|
|
|
|
if (arguments.length > 1) {
|
|
if (value) {
|
|
selected.addObject(topic);
|
|
} else {
|
|
selected.removeObject(topic);
|
|
}
|
|
}
|
|
return selected.contains(topic);
|
|
}.property('controllers.discovery/topics.selected.length'),
|
|
|
|
titleColSpan: function() {
|
|
// Uncategorized pinned topics will span the title and category column in the topic list.
|
|
return (!this.get('controllers.discovery/topics.hideCategory') &&
|
|
this.get('model.isPinnedUncategorized') ? 2 : 1);
|
|
}.property('controllers.discovery/topics.hideCategory', 'model.isPinnedUncategorized'),
|
|
|
|
hideCategory: function() {
|
|
return this.get('controllers.discovery/topics.hideCategory') || this.get('titleColSpan') > 1;
|
|
}.property('controllers.discovery/topics.hideCategory', 'titleColSpan'),
|
|
|
|
actions: {
|
|
toggleStar: function() {
|
|
this.get('model').toggleStar();
|
|
}
|
|
}
|
|
});
|