mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
17a6217cc7
fixes https://github.com/TryGhost/Team/issues/2404 This change introduces a new 'post' query parameter to the members and member routes. Previously, the members route would check if the previous route was the analytics page, and then show the breadcrumbs to go back to the analytics page. But when navigating to the members page from the menu, we don't want to show the breadcrumbs. To accomplish this, the routes that point to the members page from the analytics page now specifically pass on the post id in the query parameters. The query parameter is then passed on from the members page to the member page. `directlyFromAnalytics` is still used in the member route, to know wheter we came from the members page or from the analytics page (changes the breadcrumbs). This doesn't need to go via a query parameter (figured that would make the url too long/complex). The resetController method is now implemented and resets the filter and/or fromAnalytics post id if required (when going from members to member, we don't want to reset it because the we would lose the filter going back).
143 lines
7.9 KiB
Handlebars
143 lines
7.9 KiB
Handlebars
<div class="gh-post-activity-feed">
|
|
{{#let (activity-feed-fetcher filter=(members-event-filter post=@post.id includeEvents=this.getEventTypes) pageSize=this.pageSize) as |eventsFetcher|}}
|
|
{{#if eventsFetcher.isError}}
|
|
<div class="gh-dashboard-list-body">
|
|
<div class="gh-dashboard-list-error">
|
|
<p>There was an error loading events</p>
|
|
{{#if eventsFetcher.errorMessage}}
|
|
<code>{{eventsFetcher.errorMessage}}</code>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if (and (not eventsFetcher.data) (not eventsFetcher.isLoading))}}
|
|
<div class="gh-dashboard-list-body">
|
|
<div class="gh-post-activity-feed-empty">
|
|
<div class="attribution-list-empty">
|
|
{{#if (eq this.eventType "sent")}}
|
|
{{svg-jar "empty-sent"}}
|
|
<h4>No members have received your email yet</h4>
|
|
<p>Once someone receives your email, you'll be able to see the member activity here.</p>
|
|
{{else if (eq this.eventType "opened")}}
|
|
{{svg-jar "empty-opened"}}
|
|
<h4>No members have opened your newsletter</h4>
|
|
<p>Once someone opens, you'll see them listed here.</p>
|
|
{{else if (eq this.eventType "clicked")}}
|
|
{{svg-jar "empty-clicked"}}
|
|
<h4>No links have been clicked in your newsletter</h4>
|
|
<p>Once a member clicks a link, you'll see them listed here.</p>
|
|
{{else if (eq this.eventType "feedback")}}
|
|
{{svg-jar "empty-feedback"}}
|
|
<h4>No members have given feedback yet</h4>
|
|
<p>When someone does, you'll see their response here.</p>
|
|
{{else if (eq this.eventType "conversion")}}
|
|
{{svg-jar "empty-conversion"}}
|
|
<h4>No members have signed up on this post</h4>
|
|
<p>When someone new signs up, you'll see them here.</p>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div class="gh-dashboard-list-body gh-dashboard-list-cols-{{this.eventType}}">
|
|
{{#each eventsFetcher.data as |event|}}
|
|
{{#let (parse-member-event event) as |parsedEvent|}}
|
|
<div class="gh-dashboard-list-item">
|
|
<div class="gh-dashboard-list-item-sub">
|
|
<GhMemberAvatar @member={{parsedEvent.member}} @containerClass="w6 h6 mr3 flex-shrink-0" />
|
|
<LinkTo class="gh-dashboard-list-text" @route="member" @model="{{parsedEvent.memberId}}" @query={{hash postAnalytics=@post.id}}>{{parsedEvent.subject}}</LinkTo>
|
|
</div>
|
|
<div class="gh-dashboard-list-item-sub">
|
|
{{svg-jar parsedEvent.icon }}
|
|
<span class="gh-dashboard-list-subtext">
|
|
<span class="gh-members-activity-description">
|
|
<span class="gh-members-activity-event-text">{{capitalize-first-letter parsedEvent.action}}</span>
|
|
{{#if parsedEvent.info}}
|
|
<span class="highlight"> ({{parsedEvent.info}})</span>
|
|
{{/if}}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
{{#if (eq this.eventType "conversion")}}
|
|
<div class="gh-dashboard-list-item-sub">
|
|
{{#if parsedEvent.source}}
|
|
<span title="Source" class="gh-members-activity-description">{{svg-jar "event-extras-source"}}<span class="gh-members-activity-event-text">{{parsedEvent.source.name}}</span></span>
|
|
{{else}}
|
|
<span class="midlightgrey">—</span>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
<div class="gh-dashboard-list-item-sub">
|
|
<span class="gh-dashboard-list-subtext">{{moment-from-now parsedEvent.timestamp}}</span>
|
|
</div>
|
|
</div>
|
|
{{/let}}
|
|
{{/each}}
|
|
|
|
{{#if (compute (fn this.areStubsNeeded eventsFetcher))}}
|
|
{{#let (compute (fn this.getAmountOfStubs eventsFetcher)) as |stubs|}}
|
|
{{#each stubs}}
|
|
<div class="gh-dashboard-list-item gh-dashboard-list-item-stub"></div>
|
|
{{/each}}
|
|
{{/let}}
|
|
{{/if}}
|
|
|
|
<div class="gh-post-activity-feed-footer">
|
|
{{#if (feature "suppressionList")}}
|
|
<Posts::PostActivityFeed::FooterLinks
|
|
@eventType={{this.eventType}}
|
|
@post={{@post}}
|
|
/>
|
|
{{/if}}
|
|
|
|
{{#if (and @linkQuery (not (feature "suppressionList")))}}
|
|
<LinkTo
|
|
class="gh-post-activity-feed-pagination-link"
|
|
@route="members"
|
|
@query={{hash @linkQuery postAnalytics=@post.id}}
|
|
>
|
|
{{svg-jar "filter"}}
|
|
View members
|
|
</LinkTo>
|
|
{{/if}}
|
|
|
|
<div class="gh-post-activity-feed-pagination">
|
|
{{#if (compute (fn this.isPaginationNotNeeded eventsFetcher))}}
|
|
Showing {{eventsFetcher.totalEvents}} in total
|
|
{{else}}
|
|
Showing {{eventsFetcher.previousEvents}}-{{eventsFetcher.shownEvents}} of {{eventsFetcher.totalEvents}}
|
|
|
|
<div class="gh-post-activity-feed-pagination-group">
|
|
<button
|
|
class="gh-post-activity-feed-pagination-button gh-post-activity-feed-prev-button"
|
|
type="button"
|
|
title="Previous page"
|
|
disabled={{compute (fn this.isPreviousButtonDisabled eventsFetcher)}}
|
|
{{on "click" eventsFetcher.loadPreviousPage}}
|
|
>
|
|
{{svg-jar "arrow-left-pagination"}}
|
|
</button>
|
|
|
|
<button
|
|
class="gh-post-activity-feed-pagination-button gh-post-activity-feed-next-button"
|
|
type="button"
|
|
title="Next page"
|
|
disabled={{compute (fn this.isNextButtonDisabled eventsFetcher)}}
|
|
{{on "click" eventsFetcher.loadNextPage}}
|
|
>
|
|
{{svg-jar "arrow-right-pagination"}}
|
|
</button>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{#if (eq @eventType 'feedback')}}
|
|
<Posts::FeedbackEventsChart @data={{@data}} />
|
|
{{/if}}
|
|
{{/if}}
|
|
{{/let}}
|
|
</div>
|