mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
🎨 move template content to gh-posts-list-item
component
- we were exporting the component through a yield, which is probably not best practice. As there were no major things barring the content from going into the posts-list-item component, the template content was just moved
This commit is contained in:
parent
6d6cc56ae1
commit
21180c467c
2 changed files with 32 additions and 34 deletions
|
@ -1 +1,31 @@
|
|||
{{yield this}}
|
||||
{{#link-to (if previewIsHidden 'editor.edit' 'posts.post') post.id class="permalink" title="Edit this post"}}
|
||||
<h3 class="entry-title">{{post.title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="avatar" style={{authorAvatarBackground}}>
|
||||
<img src="{{authorAvatar}}" title="{{authorName}}">
|
||||
</span>
|
||||
<span class="author">{{authorName}}</span>
|
||||
<span class="status">
|
||||
{{#if isPublished}}
|
||||
{{#if post.page}}
|
||||
<span class="page">Page</span>
|
||||
{{else}}
|
||||
<time datetime="{{post.publishedAtUTC}}" class="date published">
|
||||
Published {{gh-format-timeago post.publishedAtUTC}}
|
||||
</time>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if isScheduled}}
|
||||
<span class="scheduled">Scheduled</span>
|
||||
<span>–
|
||||
<time datetime="{{post.publishedAtUTC}}" class-="date scheduled">
|
||||
{{gh-format-time-scheduled post.publishedAtUTC blogTimezone}}
|
||||
</time>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
|
@ -11,39 +11,7 @@
|
|||
{{#gh-infinite-scroll tagName="section" classNames="content-list-content js-content-scrollbox" fetch="loadNextPage" as |checkScroll|}}
|
||||
<ol class="posts-list">
|
||||
{{#each sortedPosts key="id" as |post|}}
|
||||
{{#gh-posts-list-item post=post onDoubleClick="openEditor" onDelete=(action checkScroll) as |component|}}
|
||||
{{#link-to (if previewIsHidden 'editor.edit' 'posts.post') post.id class="permalink" title="Edit this post"}}
|
||||
<h3 class="entry-title">{{post.title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="avatar" style={{component.authorAvatarBackground}}>
|
||||
<img src="{{component.authorAvatar}}" title="{{component.authorName}}">
|
||||
</span>
|
||||
<span class="author">{{component.authorName}}</span>
|
||||
<span class="status">
|
||||
{{#if component.isPublished}}
|
||||
{{#if post.page}}
|
||||
<span class="page">Page</span>
|
||||
{{else}}
|
||||
<time datetime="{{post.publishedAtUTC}}" class="date published">
|
||||
Published {{gh-format-timeago post.publishedAtUTC}}
|
||||
</time>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if component.isScheduled}}
|
||||
<span class="scheduled">Scheduled</span>
|
||||
<span>–
|
||||
<time datetime="{{post.publishedAtUTC}}" class-="date scheduled">
|
||||
{{gh-format-time-scheduled post.publishedAtUTC component.blogTimezone}}
|
||||
</time>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
||||
{{/gh-posts-list-item}}
|
||||
{{gh-posts-list-item post=post previewIsHidden=previewIsHidden onDoubleClick="openEditor" onDelete=(action checkScroll)}}
|
||||
{{/each}}
|
||||
</ol>
|
||||
{{/gh-infinite-scroll}}
|
||||
|
|
Loading…
Reference in a new issue