0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🎨 Added "Featured posts" filter and badge to stories list (#907)

closes https://github.com/TryGhost/Ghost/issues/9234
- add `featured` badge to stories/pages that have the featured flag
- add "Featured posts" to the post type filter dropdown
- simplified badge logic in `{{gh-posts-list-item}}`
This commit is contained in:
Kevin Ansfield 2017-11-10 17:36:27 +00:00 committed by GitHub
parent 0572c33e0f
commit 3c63ae0843
4 changed files with 25 additions and 9 deletions

View file

@ -21,6 +21,7 @@ export default Component.extend({
isFeatured: alias('post.featured'),
isPage: alias('post.page'),
isDraft: equal('post.status', 'draft'),
isPublished: equal('post.status', 'published'),
isScheduled: equal('post.status', 'scheduled'),

View file

@ -29,6 +29,9 @@ export default Controller.extend({
}, {
name: 'Scheduled posts',
value: 'scheduled'
}, {
name: 'Featured posts',
value: 'featured'
}, {
name: 'Pages',
value: 'page'

View file

@ -37,6 +37,10 @@ export default AuthenticatedRoute.extend(InfinityRoute, {
let queryParams = this._typeParams(params.type);
let filterParams = {tag: params.tag};
if (params.type === 'featured') {
filterParams.featured = true;
}
if (user.get('isAuthor')) {
// authors can only view their own posts
filterParams.author = user.get('slug');

View file

@ -2,18 +2,26 @@
<p>{{subText}}</p>
<section class="gh-content-entry-meta">
{{#if isPublished}}
{{#if post.page}}
{{#if isPage}}
<span class="gh-content-status-draft gh-badge gh-badge-black">Page</span>
{{else}}
<span class="gh-content-status-published">Published</span>
{{/if}}
{{else if isScheduled}}
{{#if isScheduled}}
<span class="gh-content-status-draft gh-badge">Scheduled</span>
{{else}}
{{/if}}
{{#if isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-red">Draft</span>
{{/if}}
{{#if isFeatured}}
<span class="gh-content-status-featured gh-badge gh-badge-blue">Featured</span>
{{/if}}
{{#if (and isPublished (not post.page))}}
<span class="gh-content-status-published">Published</span>
{{/if}}
by <span class="gh-content-entry-author">{{authorName}}</span> &mdash;
{{#if isPublished}}