Ghost/ghost/admin/app/components/posts-list/list-item-clicks.hbs

172 lines
7.2 KiB
Handlebars
Raw Normal View History

{{!-- template-lint-disable no-invalid-interactive --}}
<li class="gh-list-row gh-posts-list-item gh-posts-list-item-labs gh-post-list-plain-status"
{{on "mouseover" this.mouseOver}}
{{on "mouseleave" this.mouseLeave}}
...attributes
>
{{!-- Title column --}}
{{#if (and this.session.user.isContributor @post.isPublished)}}
<a href={{@post.url}} class="permalink gh-list-data gh-post-list-title" target="_blank" rel="noopener noreferrer">
<h3 class="gh-content-entry-title">
{{@post.title}} {{svg-jar "external" class="gh-post-list-external"}}
</h3>
{{#unless @hideAuthor }}
<p class="gh-content-entry-meta">
<span class="gh-content-entry-author">
By {{post-author-names @post}}
{{#if @post.primaryTag}}
in <span class="midgrey-l2 fw5">{{@post.primaryTag.name}}</span>
{{/if}}
</span>
<span class="gh-content-entry-date">
{{#if this.isHovered}}
{{gh-format-post-time @post.updatedAtUTC "D MMM YYYY"}}
{{else}}
{{gh-format-post-time @post.updatedAtUTC draft=true}}
{{/if}}
</span>
</p>
<p class="gh-content-entry-status">
<span class="published">
Published
{{#if @post.hasEmail}}
{{#if this.isHovered}}
and sent to 2,467 free subscribers
{{else}}
and sent
{{/if}}
{{/if}}
</span>
</p>
{{/unless}}
</a>
{{else}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-title">
<h3 class="gh-content-entry-title">
{{@post.title}}
</h3>
{{#unless @hideAuthor }}
<p class="gh-content-entry-meta">
<span class="gh-content-entry-author">
By {{post-author-names @post}}
{{#if @post.primaryTag}}
in <span class="midgrey-l2 fw5">{{@post.primaryTag.name}}</span>
{{/if}}
</span>
<span class="gh-content-entry-date">
{{#if this.isHovered}}
{{gh-format-post-time @post.updatedAtUTC "D MMM YYYY"}}
{{else}}
{{gh-format-post-time @post.updatedAtUTC draft=true}}
{{/if}}
</span>
</p>
<p class="gh-content-entry-status">
{{#if @post.isScheduled}}
<span class="scheduled" title="Scheduled">
{{#if this.isHovered}}
Scheduled to be published {{if @post.newsletter "and sent "}}{{this.scheduledText}} to {{@post.emailSegment}} subscribers
{{else}}
Scheduled
{{/if}}
</span>
{{/if}}
{{#if @post.isDraft}}
<span class="draft">
Draft
</span>
{{/if}}
{{#if @post.isPublished}}
<span class="published">
Published
{{#if @post.hasEmail}}
{{#if this.isHovered}}
and sent to 2,467 free subscribers
{{else}}
and sent
{{/if}}
{{/if}}
</span>
{{/if}}
{{#if @post.isSent}}
<span class="sent">
{{#if this.isHovered}}
Sent to 2,467 free subscribers
{{else}}
Sent
{{/if}}
</span>
{{/if}}
</p>
{{/unless}}
</LinkTo>
{{/if}}
{{!-- Opens and clicks columns --}}
{{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled") (not this.session.user.isContributor) this.feature.emailAnalytics (eq @post.displayName "post"))}}
{{!-- Opens column --}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-opens">
{{#if (and @post.email.trackOpens (eq @post.email.status "submitted"))}}
<div class="flex flex-column">
<span class="gh-content-email-stats">
{{#if this.isHovered}}
1,283
{{else}}
52%
{{/if}}
</span>
<span class="gh-content-entry-meta">
opens
</span>
<span class="midgrey-l2 fw4 gh-content-email-stats-mobile">{{@post.email.openRate}}% opens</span>
</div>
{{/if}}
</LinkTo>
{{!-- Clicks column --}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-clicks">
{{#if (and @post.email.trackOpens (eq @post.email.status "submitted"))}}
<div class="flex flex-column">
<span class="gh-content-email-stats">
{{#if this.isHovered}}
444
{{else}}
18%
{{/if}}
</span>
<span class="gh-content-entry-meta">
clicks
</span>
</div>
{{/if}}
</LinkTo>
{{/if}}
{{!-- Button column --}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-cta">
{{#if (or @post.isSent @post.isPublished)}}
<LinkTo @route="posts.analytics" @model={{@post}} class="gh-btn gh-btn-outline gh-btn-icon">
<span>
{{svg-jar "stats" class="stats"}} Stats
</span>
</LinkTo>
{{else}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="gh-btn gh-btn-outline gh-btn-icon">
<span>
{{svg-jar "pen" class="edit"}} Edit
</span>
</LinkTo>
{{/if}}
</LinkTo>
</li>