mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
Converted <GhPostsListItem> to glimmer component
no issue - moved tag name and classes into template - updated backing class to native class syntax
This commit is contained in:
parent
1f87c59055
commit
ec925a60b0
@ -1,10 +1,11 @@
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-featured" @title="Edit this post">
|
||||
<li class="gh-list-row gh-posts-list-item" ...attributes>
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-featured" @title="Edit this post">
|
||||
{{#if @post.isFeatured}}
|
||||
<span data-tooltip="Featured" class="dib pl1 pr1 nr1 nl1">{{svg-jar "star-filled" class="fill-blue w3 h3"}}</span>
|
||||
{{/if}}
|
||||
</LinkTo>
|
||||
</LinkTo>
|
||||
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-title" @title="Edit this post">
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-title" @title="Edit this post">
|
||||
<h3 class="gh-content-entry-title">
|
||||
{{@post.title}}
|
||||
</h3>
|
||||
@ -21,9 +22,9 @@
|
||||
{{/if}}
|
||||
</span>
|
||||
</p>
|
||||
</LinkTo>
|
||||
</LinkTo>
|
||||
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-status" @title="Edit this post">
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-status" @title="Edit this post">
|
||||
<div class="flex items-center">
|
||||
{{#if @post.isScheduled}}
|
||||
<span class="gh-content-status-draft gh-badge nowrap">
|
||||
@ -63,8 +64,9 @@
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</LinkTo>
|
||||
</LinkTo>
|
||||
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-updated" @title="Edit this post">
|
||||
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-updated" @title="Edit this post">
|
||||
<span class="nowrap">{{gh-format-post-time @post.updatedAtUTC draft=true}}</span>
|
||||
</LinkTo>
|
||||
</LinkTo>
|
||||
</li>
|
@ -1,16 +1,10 @@
|
||||
import Component from '@ember/component';
|
||||
import {computed} from '@ember/object';
|
||||
import Component from '@glimmer/component';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
session: service(),
|
||||
export default class GhPostsListItemComponent extends Component {
|
||||
@service session;
|
||||
|
||||
tagName: 'li',
|
||||
classNames: ['gh-list-row', 'gh-posts-list-item'],
|
||||
|
||||
authorNames: computed('post.authors.[]', function () {
|
||||
let authors = this.get('post.authors');
|
||||
|
||||
return authors.map(author => author.get('name') || author.get('email')).join(', ');
|
||||
})
|
||||
});
|
||||
get authorNames() {
|
||||
return this.args.post.authors.map(author => author.name || author.email).join(', ');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user