diff --git a/ghost/admin/app/components/gh-contentfilter.js b/ghost/admin/app/components/gh-contentfilter.js new file mode 100644 index 0000000000..5c596ef0a3 --- /dev/null +++ b/ghost/admin/app/components/gh-contentfilter.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import {inject as service} from '@ember/service'; + +export default class GhContentfilterComponent extends Component { + @service session +} diff --git a/ghost/admin/app/controllers/pages.js b/ghost/admin/app/controllers/pages.js index c4f5abc8fb..043b653096 100644 --- a/ghost/admin/app/controllers/pages.js +++ b/ghost/admin/app/controllers/pages.js @@ -17,23 +17,11 @@ const TYPES = [{ value: 'featured' }]; -const ORDERS = [{ - name: 'Newest', - value: null -}, { - name: 'Oldest', - value: 'published_at asc' -}, { - name: 'Recently updated', - value: 'updated_at desc' -}]; - /* eslint-disable ghost/ember/alias-model-in-controller */ export default PostsController.extend({ init() { this._super(...arguments); this.availableTypes = TYPES; - this.availableOrders = ORDERS; }, actions: { diff --git a/ghost/admin/app/controllers/posts.js b/ghost/admin/app/controllers/posts.js index e2b0311846..4ee85ea2d7 100644 --- a/ghost/admin/app/controllers/posts.js +++ b/ghost/admin/app/controllers/posts.js @@ -34,7 +34,6 @@ const ORDERS = [{ export default Controller.extend({ - session: service(), store: service(), queryParams: ['type', 'author', 'tag', 'order'], @@ -116,30 +115,6 @@ export default Controller.extend({ return authors.findBy('slug', author); }), - typeClassNames: computed('type', function () { - let classNames = 'gh-contentfilter-menu gh-contentfilter-type'; - if (this.get('type')) { - classNames = classNames + ' gh-contentfilter-selected'; - } - return classNames; - }), - - authorClassNames: computed('author', function () { - let classNames = 'gh-contentfilter-menu gh-contentfilter-author'; - if (this.get('author')) { - classNames = classNames + ' gh-contentfilter-selected'; - } - return classNames; - }), - - tagClassNames: computed('tag', function () { - let classNames = 'gh-contentfilter-menu gh-contentfilter-tag'; - if (this.get('tag')) { - classNames = classNames + ' gh-contentfilter-selected'; - } - return classNames; - }), - actions: { changeType(type) { this.set('type', get(type, 'value')); diff --git a/ghost/admin/app/templates/components/gh-contentfilter.hbs b/ghost/admin/app/templates/components/gh-contentfilter.hbs new file mode 100644 index 0000000000..4cf0012e79 --- /dev/null +++ b/ghost/admin/app/templates/components/gh-contentfilter.hbs @@ -0,0 +1,74 @@ +