Ghost/ghost/admin/app/components/dashboard/v5/charts/recent-posts.hbs
Simon Backx 46fd0e4a27 Added open rate and charts to recent posts
refs https://github.com/TryGhost/Team/issues/1535

Also made some temporary changes in CSS to get the percentage bar in.
2022-04-20 15:31:12 +02:00

33 lines
1.6 KiB
Handlebars

<section class="gh-dashboard5-section gh-dashboard5-recent-posts">
<article class="gh-dashboard5-box">
<div class="gh-dashboard5-list" {{did-insert this.loadPosts}}>
<div class="gh-dashboard5-list-header">
<div class="gh-dashboard5-list-title">Recent posts</div>
<div class="gh-dashboard5-list-title">Sends</div>
<div class="gh-dashboard5-list-title">Open rate</div>
</div>
<div class="gh-dashboard5-list-body">
{{#each this.posts as |post|}}
<div class="gh-dashboard5-list-item">
<LinkTo class="gh-dashboard5-list-post permalink" @route="editor.edit" @models={{array post.displayName post.id}}>
{{post.title}}
</LinkTo>
<span>{{format-number post.email.emailCount}}</span>
<span class="with-percentage-bar">
<span class="prototype-bar"><span style={{html-safe (concat "width: " post.email.openRate "%;")}}/></span>
<span>{{post.email.openRate}}%</span>
</span>
</div>
{{else}}
<div class="gh-dashboard5-list-empty">
<p>No published posts yet.</p>
</div>
{{/each}}
</div>
<div class="gh-dashboard5-list-footer">
<LinkTo @route="posts" @query={{reset-query-params "posts"}}>See all posts →</LinkTo>
</div>
</div>
</article>
</section>