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:
parent
0572c33e0f
commit
3c63ae0843
4 changed files with 25 additions and 9 deletions
|
@ -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'),
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ export default Controller.extend({
|
|||
}, {
|
||||
name: 'Scheduled posts',
|
||||
value: 'scheduled'
|
||||
}, {
|
||||
name: 'Featured posts',
|
||||
value: 'featured'
|
||||
}, {
|
||||
name: 'Pages',
|
||||
value: 'page'
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -2,18 +2,26 @@
|
|||
<p>{{subText}}</p>
|
||||
|
||||
<section class="gh-content-entry-meta">
|
||||
{{#if isPublished}}
|
||||
{{#if post.page}}
|
||||
<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 isPage}}
|
||||
<span class="gh-content-status-draft gh-badge gh-badge-black">Page</span>
|
||||
{{/if}}
|
||||
|
||||
{{#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> —
|
||||
|
||||
{{#if isPublished}}
|
||||
|
@ -23,4 +31,4 @@
|
|||
{{else}}
|
||||
Last edited {{gh-format-post-time post.updatedAtUTC draft=true}}
|
||||
{{/if}}
|
||||
</section>
|
||||
</section>
|
||||
|
|
Loading…
Add table
Reference in a new issue