mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #4742 from rwjblue/cleanup-posts-template
Cleanup posts template.
This commit is contained in:
commit
d15521ea12
3 changed files with 21 additions and 30 deletions
|
@ -14,24 +14,24 @@
|
|||
{{#view "paginated-scroll-box" tagName="section" classNames="content-list-content js-content-scrollbox"}}
|
||||
<ol class="posts-list">
|
||||
{{#each post in model itemController="posts/post" itemView="post-item-view" itemTagName="li"}}
|
||||
{{#link-to "posts.post" post class="permalink" title="Edit this post"}}
|
||||
<h3 class="entry-title">{{post.title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="status">
|
||||
{{#if post.isPublished}}
|
||||
{{#if post.page}}
|
||||
<span class="page">Page</span>
|
||||
{{else}}
|
||||
<time datetime="{{unbound post.published_at}}" class="date published">
|
||||
Published {{gh-format-timeago post.published_at}}
|
||||
</time>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
||||
{{#link-to "posts.post" post class="permalink" alternateActive=view.active title="Edit this post"}}
|
||||
<h3 class="entry-title">{{post.title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="status">
|
||||
{{#if post.isPublished}}
|
||||
{{#if post.page}}
|
||||
<span class="page">Page</span>
|
||||
{{else}}
|
||||
<time datetime="{{unbound post.published_at}}" class="date published">
|
||||
Published {{gh-format-timeago post.published_at}}
|
||||
</time>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
||||
{{/each}}
|
||||
</ol>
|
||||
{{/view}}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
var ItemView = Ember.View.extend({
|
||||
classNameBindings: ['active'],
|
||||
|
||||
active: Ember.computed('childViews.firstObject.active', function () {
|
||||
return this.get('childViews.firstObject.active');
|
||||
})
|
||||
});
|
||||
|
||||
export default ItemView;
|
|
@ -1,7 +1,7 @@
|
|||
import itemView from 'ghost/views/item-view';
|
||||
var PostItemView = Ember.View.extend({
|
||||
classNameBindings: ['active', 'isFeatured:featured', 'isPage:page'],
|
||||
|
||||
var PostItemView = itemView.extend({
|
||||
classNameBindings: ['isFeatured:featured', 'isPage:page'],
|
||||
active: null,
|
||||
|
||||
isFeatured: Ember.computed.alias('controller.model.featured'),
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue