2022-05-17 10:34:34 +03:00
|
|
|
<section class="gh-dashboard-section gh-dashboard-recents" {{did-insert this.loadPosts}}>
|
|
|
|
<article class="gh-dashboard-box">
|
|
|
|
<div class="gh-dashboard-tabs">
|
|
|
|
<button type="button" class="gh-dashboard-tab {{if this.postsTabSelected 'is-selected'}}" {{on "click" this.changeTabToPosts}}>
|
|
|
|
<Dashboard::Parts::Metric
|
2022-07-06 10:21:57 +03:00
|
|
|
@label="Recent posts" />
|
2022-04-22 13:42:51 +03:00
|
|
|
</button>
|
2022-04-22 17:27:49 +03:00
|
|
|
{{#if this.areMembersEnabled}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<button type="button" class="gh-dashboard-tab {{if this.activityTabSelected 'is-selected'}}" {{on "click" this.changeTabToActivity}}>
|
|
|
|
<Dashboard::Parts::Metric
|
2022-07-06 10:21:57 +03:00
|
|
|
@label="Member activity" />
|
|
|
|
</button>
|
2022-04-22 17:27:49 +03:00
|
|
|
{{/if}}
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
|
|
|
{{#if this.postsTabSelected}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-recents-posts gh-dashboard-list {{unless this.areNewslettersEnabled 'is-single'}}">
|
2022-07-06 10:21:57 +03:00
|
|
|
<div class="gh-dashboard-list-header">
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-title">Title</div>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{#if this.areNewslettersEnabled}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-title">Sends</div>
|
|
|
|
<div class="gh-dashboard-list-title">Open rate</div>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-title">Published</div>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{/if}}
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-body">
|
2022-04-22 13:42:51 +03:00
|
|
|
{{#each this.posts as |post|}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<LinkTo class="gh-dashboard-list-item permalink" @route="editor.edit" @models={{array post.displayName post.id}}>
|
|
|
|
<div class="gh-dashboard-list-item-sub">
|
|
|
|
<span class="gh-dashboard-list-text">{{post.title}}</span>
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{#if this.areNewslettersEnabled}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
|
|
|
<span class="gh-dashboard-metric-minivalue {{unless post.email "na"}}">
|
2022-05-04 18:45:34 +03:00
|
|
|
{{#if post.email}}
|
|
|
|
{{format-number post.email.emailCount}}
|
|
|
|
{{else}}
|
|
|
|
—
|
|
|
|
{{/if}}
|
|
|
|
</span>
|
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
2022-07-06 10:21:57 +03:00
|
|
|
<span class="gh-dashboard-rate-bar">
|
|
|
|
{{#if post.email}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<span class="gh-dashboard-metric-minivalue">{{post.email.openRate}}%</span>
|
|
|
|
<span class="gh-dashboard-rate-amount"><span style={{html-safe (concat "width: " post.email.openRate "%;")}}/></span>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<span class="gh-dashboard-metric-minivalue na">—</span>
|
2022-05-04 18:45:34 +03:00
|
|
|
{{/if}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
2022-07-15 11:26:02 +03:00
|
|
|
<span class="gh-dashboard-list-subtext">{{moment-format (moment-site-tz post.publishedAtUTC) "DD MMM YYYY HH:mm"}}</span>
|
2022-05-04 18:45:34 +03:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-05-04 15:29:55 +03:00
|
|
|
</LinkTo>
|
2022-04-22 13:42:51 +03:00
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-empty">
|
2022-04-22 13:42:51 +03:00
|
|
|
<p>No published posts yet.</p>
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-footer">
|
2022-04-22 13:42:51 +03:00
|
|
|
<LinkTo @route="posts" @query={{reset-query-params "posts"}}>See all posts →</LinkTo>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-recents-activity gh-dashboard-list" data-test-dashboard-member-activity>
|
2022-07-06 10:21:57 +03:00
|
|
|
<div class="gh-dashboard-list-header">
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-title">Member</div>
|
|
|
|
<div class="gh-dashboard-list-title">Event</div>
|
|
|
|
<div class="gh-dashboard-list-title">Time</div>
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-body">
|
2022-07-06 10:21:57 +03:00
|
|
|
{{#let (members-event-fetcher filter=(members-event-filter excludeEmailEvents=true) pageSize=5) as |eventsFetcher|}}
|
2022-04-22 13:42:51 +03:00
|
|
|
{{#if eventsFetcher.isError}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-error">
|
2022-04-22 13:42:51 +03:00
|
|
|
<p>There was an error loading events</p>
|
|
|
|
{{#if eventsFetcher.errorMessage}}
|
|
|
|
<code>{{eventsFetcher.errorMessage}}</code>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-07-06 10:21:57 +03:00
|
|
|
|
2022-04-22 13:42:51 +03:00
|
|
|
{{#if eventsFetcher.isLoading}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-loading">
|
2022-04-22 13:42:51 +03:00
|
|
|
<div class="gh-loading-spinner"></div>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
{{#if eventsFetcher.data}}
|
|
|
|
{{#each eventsFetcher.data as |event|}}
|
2022-05-04 11:21:42 +03:00
|
|
|
{{#let (parse-member-event event eventsFetcher.hasMultipleNewsletters) as |parsedEvent|}}
|
2022-08-02 20:11:44 +03:00
|
|
|
<div class="gh-dashboard-list-item member-details">
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
2022-08-18 18:29:40 +03:00
|
|
|
<GhMemberAvatar @member={{parsedEvent.member}} @containerClass="w8 h8 mr3 flex-shrink-0" />
|
|
|
|
<LinkTo class="gh-dashboard-list-text" @route="member" @model="{{parsedEvent.memberId}}" data-test-dashboard-member-activity-item>{{parsedEvent.subject}}</LinkTo>
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
2022-05-04 15:29:55 +03:00
|
|
|
{{svg-jar parsedEvent.icon}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<span class="gh-dashboard-list-subtext">
|
2022-05-03 15:21:29 +03:00
|
|
|
{{capitalize-first-letter parsedEvent.action}}
|
2022-08-18 18:29:40 +03:00
|
|
|
{{#if parsedEvent.url}}
|
|
|
|
"<a class="ghost-members-activity-object-link" href="{{parsedEvent.url}}" target="_blank" rel="noopener noreferrer">{{parsedEvent.object}}</a>"
|
|
|
|
{{else}}
|
|
|
|
{{parsedEvent.object}}
|
|
|
|
{{/if}}
|
2022-08-17 18:19:59 +03:00
|
|
|
{{parsedEvent.info}}
|
2022-08-18 18:29:40 +03:00
|
|
|
</span>
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-item-sub">
|
2022-08-18 18:29:40 +03:00
|
|
|
<span class="gh-dashboard-list-subtext">{{moment-format parsedEvent.timestamp "DD MMM YYYY HH:mm"}}</span>
|
2022-04-22 13:42:51 +03:00
|
|
|
</div>
|
2022-08-02 20:11:44 +03:00
|
|
|
</div>
|
2022-04-22 13:42:51 +03:00
|
|
|
{{/let}}
|
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-empty" data-test-no-member-activities>
|
2022-04-22 13:42:51 +03:00
|
|
|
<p>No activity yet.</p>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{/let}}
|
|
|
|
</div>
|
2022-05-17 10:34:34 +03:00
|
|
|
<div class="gh-dashboard-list-footer">
|
2022-04-22 13:42:51 +03:00
|
|
|
<LinkTo @route="members-activity" @query={{reset-query-params "members-activity"}}>See all activity →</LinkTo>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</article>
|
|
|
|
</section>
|