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'),
|
isFeatured: alias('post.featured'),
|
||||||
isPage: alias('post.page'),
|
isPage: alias('post.page'),
|
||||||
|
isDraft: equal('post.status', 'draft'),
|
||||||
isPublished: equal('post.status', 'published'),
|
isPublished: equal('post.status', 'published'),
|
||||||
isScheduled: equal('post.status', 'scheduled'),
|
isScheduled: equal('post.status', 'scheduled'),
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@ export default Controller.extend({
|
||||||
}, {
|
}, {
|
||||||
name: 'Scheduled posts',
|
name: 'Scheduled posts',
|
||||||
value: 'scheduled'
|
value: 'scheduled'
|
||||||
|
}, {
|
||||||
|
name: 'Featured posts',
|
||||||
|
value: 'featured'
|
||||||
}, {
|
}, {
|
||||||
name: 'Pages',
|
name: 'Pages',
|
||||||
value: 'page'
|
value: 'page'
|
||||||
|
|
|
@ -37,6 +37,10 @@ export default AuthenticatedRoute.extend(InfinityRoute, {
|
||||||
let queryParams = this._typeParams(params.type);
|
let queryParams = this._typeParams(params.type);
|
||||||
let filterParams = {tag: params.tag};
|
let filterParams = {tag: params.tag};
|
||||||
|
|
||||||
|
if (params.type === 'featured') {
|
||||||
|
filterParams.featured = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (user.get('isAuthor')) {
|
if (user.get('isAuthor')) {
|
||||||
// authors can only view their own posts
|
// authors can only view their own posts
|
||||||
filterParams.author = user.get('slug');
|
filterParams.author = user.get('slug');
|
||||||
|
|
|
@ -2,18 +2,26 @@
|
||||||
<p>{{subText}}</p>
|
<p>{{subText}}</p>
|
||||||
|
|
||||||
<section class="gh-content-entry-meta">
|
<section class="gh-content-entry-meta">
|
||||||
{{#if isPublished}}
|
{{#if isPage}}
|
||||||
{{#if post.page}}
|
<span class="gh-content-status-draft gh-badge gh-badge-black">Page</span>
|
||||||
<span class="gh-content-status-draft gh-badge gh-badge-black">Page</span>
|
{{/if}}
|
||||||
{{else}}
|
|
||||||
<span class="gh-content-status-published">Published</span>
|
{{#if isScheduled}}
|
||||||
{{/if}}
|
|
||||||
{{else if isScheduled}}
|
|
||||||
<span class="gh-content-status-draft gh-badge">Scheduled</span>
|
<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>
|
<span class="gh-content-status-draft gh-badge gh-badge-red">Draft</span>
|
||||||
{{/if}}
|
{{/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> —
|
by <span class="gh-content-entry-author">{{authorName}}</span> —
|
||||||
|
|
||||||
{{#if isPublished}}
|
{{#if isPublished}}
|
||||||
|
@ -23,4 +31,4 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
Last edited {{gh-format-post-time post.updatedAtUTC draft=true}}
|
Last edited {{gh-format-post-time post.updatedAtUTC draft=true}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Add table
Reference in a new issue