1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/templates/posts.hbs
Aileen Nowak dd8d3507f0 Renaming date properties to contain UTC
closes TryGhost/Ghost#6985

- renames all date properties to end with `UTC`:
	- `publishedAt` in `post` model
	- `createdAt` in `post`, `role`, `subscriber`, `tag` and `user` model
	- `updatedAt` in `post`, `role`, `subscriber`, `tag` and `user` model
	- `unsubscribedAt` in `subscriber` model
	- `lastLogin` in `user` model
- adds `attrs` transforms in matching serializers `post`, `tag` and `user`
- new serializers files for `subscribers` and `role` to add `attr` transforms
- adds unit tests for all serializers
- use two variables in `post-settings-menu` controller to handle blog-timezone adjusted date as well as UTC date
2016-06-17 11:09:21 +02:00

69 lines
3.8 KiB
Handlebars

{{#gh-content-view-container as |previewIsHidden|}}
<header class="view-header">
{{#gh-view-title openMobileMenu="openMobileMenu"}}<span>Content</span>{{/gh-view-title}}
<section class="view-actions">
{{#link-to "editor.new" class="btn btn-green" title="New Post"}}New Post{{/link-to}}
</section>
</header>
<div class="view-container">
<section class="content-list js-content-list {{if postListFocused 'keyboard-focused'}}">
{{#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>&ndash;
<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>
{{#if feature.internalTags}}
<div class="internal-tags-list">
{{#each post.internalTags as |tag|}}
<span class="label label-default">{{tag.name}}</span>
{{/each}}
</div>
{{/if}}
</section>
{{/link-to}}
{{/gh-posts-list-item}}
{{/each}}
</ol>
{{/gh-infinite-scroll}}
</section>
<section class="content-preview js-content-preview {{if postContentFocused 'keyboard-focused'}}">
{{outlet}}
</section>
</div>
{{/gh-content-view-container}}
{{#if showDeletePostModal}}
{{gh-fullscreen-modal "delete-post"
model=currentPost
close=(action "toggleDeletePostModal")
modifier="action wide"}}
{{/if}}