ES6: More controllers converted over
This commit is contained in:
parent
6d919d75cc
commit
1c9ccc6eb1
|
@ -1,4 +1,4 @@
|
|||
Discourse.DiscoverySortableController = Discourse.Controller.extend({
|
||||
export default Discourse.Controller.extend({
|
||||
needs: ['discovery/topics'],
|
||||
queryParams: ['order', 'ascending', 'status', 'state', 'search'],
|
||||
order: Em.computed.alias('controllers.discovery/topics.order'),
|
|
@ -1,12 +1,4 @@
|
|||
/**
|
||||
The base controller for discoverying topics
|
||||
|
||||
@class DiscoveryController
|
||||
@extends Discourse.Controller
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.DiscoveryController = Discourse.ObjectController.extend({
|
||||
export default Discourse.ObjectController.extend({
|
||||
loading: false,
|
||||
loadingSpinner: false,
|
||||
scheduledSpinner: null,
|
||||
|
@ -25,4 +17,3 @@ Discourse.DiscoveryController = Discourse.ObjectController.extend({
|
|||
showMoreMonthlyUrl: function() { return this.showMoreUrl('monthly'); }.property('category', 'noSubcategories'),
|
||||
showMoreYearlyUrl: function() { return this.showMoreUrl('yearly'); }.property('category', 'noSubcategories')
|
||||
});
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.DiscoveryController.extend({
|
||||
import DiscoveryController from 'discourse/controllers/discovery';
|
||||
|
||||
export default DiscoveryController.extend({
|
||||
needs: ['modal', 'discovery'],
|
||||
|
||||
withLogo: Em.computed.filterBy('categories', 'logo_url'),
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/**
|
||||
The controller for discoverying 'Top' topics
|
||||
import DiscoveryController from 'discourse/controllers/discovery';
|
||||
|
||||
@class DiscoveryTopController
|
||||
@extends Discourse.Controller
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
export default Discourse.DiscoveryController.extend({
|
||||
export default DiscoveryController.extend({
|
||||
needs: ['discovery'],
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/**
|
||||
The controller for displaying a list of topics.
|
||||
import DiscoveryController from 'discourse/controllers/discovery';
|
||||
|
||||
@class DiscoveryTopicsController
|
||||
@extends Discourse.Controller
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
export default Discourse.DiscoveryController.extend({
|
||||
export default DiscoveryController.extend({
|
||||
needs: ['discovery'],
|
||||
bulkSelectEnabled: false,
|
||||
selected: [],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Discourse.TopicController = Discourse.ObjectController.extend(Discourse.SelectedPostsCount, {
|
||||
export default Discourse.ObjectController.extend(Discourse.SelectedPostsCount, {
|
||||
multiSelect: false,
|
||||
needs: ['header', 'modal', 'composer', 'quote-button', 'search', 'topic-progress'],
|
||||
allPostsSelected: false,
|
|
@ -1,5 +1,6 @@
|
|||
import buildCategoryRoute from 'discourse/routes/build-category-route';
|
||||
import buildTopicRoute from 'discourse/routes/build-topic-route';
|
||||
import DiscoverySortableController from 'discourse/controllers/discovery-sortable';
|
||||
|
||||
export default {
|
||||
name: 'dynamic-route-builders',
|
||||
|
@ -11,14 +12,14 @@ export default {
|
|||
app.DiscoveryCategoryNoneRoute = buildCategoryRoute('latest', {no_subcategories: true});
|
||||
|
||||
Discourse.Site.currentProp('filters').forEach(function(filter) {
|
||||
app["Discovery" + filter.capitalize() + "Controller"] = Discourse.DiscoverySortableController.extend();
|
||||
app["Discovery" + filter.capitalize() + "Controller"] = DiscoverySortableController.extend();
|
||||
app["Discovery" + filter.capitalize() + "Route"] = buildTopicRoute(filter);
|
||||
app["Discovery" + filter.capitalize() + "CategoryRoute"] = buildCategoryRoute(filter);
|
||||
app["Discovery" + filter.capitalize() + "CategoryNoneRoute"] = buildCategoryRoute(filter, {no_subcategories: true});
|
||||
});
|
||||
|
||||
Discourse.Site.currentProp('periods').forEach(function(period) {
|
||||
app["DiscoveryTop" + period.capitalize() + "Controller"] = Discourse.DiscoverySortableController.extend();
|
||||
app["DiscoveryTop" + period.capitalize() + "Controller"] = DiscoverySortableController.extend();
|
||||
app["DiscoveryTop" + period.capitalize() + "Route"] = buildTopicRoute('top/' + period);
|
||||
app["DiscoveryTop" + period.capitalize() + "CategoryRoute"] = buildCategoryRoute('top/' + period);
|
||||
app["DiscoveryTop" + period.capitalize() + "CategoryNoneRoute"] = buildCategoryRoute('top/' + period, {no_subcategories: true});
|
||||
|
|
Loading…
Reference in New Issue