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