mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
d3447315ee
refs https://github.com/TryGhost/Team/issues/1290 - added `{{members-event-filter}}` helper that can be used to build an event filter string that will always exclude email events when the newsletter is disabled - useful when used in conjunction with `{{members-event-fetcher}}` because the filter is automatically adjusted for you without needing additional logic or JS backing files for components - updated dashboard and member screen activity widgets to use `{{members-event-filter}}` - updated members-activity screen - updated to use `{{members-activity-filter}}` helper in the template which allowed for removal of filter generation in the controller - changed `@hideMemberOnlyEvents` to `@hiddenEvents` on `<MembersActivity::EventTypeFilter>` so that we can control which events are available in the filter based on newsletter enable/disable and presence of a filtered member
68 lines
3.7 KiB
Handlebars
68 lines
3.7 KiB
Handlebars
{{#if this.shouldDisplay}}
|
|
<div class="gh-dashboard-box activity" data-test-dashboard-member-activity>
|
|
<h4 class="gh-dashboard-header-container">
|
|
<h4 class="gh-dashboard-header">
|
|
Activity
|
|
</h4>
|
|
</h4>
|
|
<div class="content">
|
|
{{#let (members-event-fetcher filter=(if (feature "membersActivityFeed") (members-event-filter excludeEmailEvents=true)) pageSize=(if (feature "membersActivityFeed") 10 5)) as |eventsFetcher|}}
|
|
{{#if eventsFetcher.isLoading}}
|
|
Loading...
|
|
{{/if}}
|
|
|
|
{{#if eventsFetcher.isError}}
|
|
<p class="error">
|
|
There was an error loading events
|
|
{{#if eventsFetcher.errorMessage}}
|
|
<code>{{eventsFetcher.errorMessage}}</code>
|
|
{{/if}}
|
|
</p>
|
|
{{/if}}
|
|
|
|
{{#unless (or eventsFetcher.isLoading eventsFetcher.isError)}}
|
|
<div class="gh-event-timeline">
|
|
{{#if eventsFetcher.data}}
|
|
<ul class="gh-dashboard-activity-list">
|
|
{{#each eventsFetcher.data as |event|}}
|
|
{{#let (parse-member-event event) as |parsedEvent|}}
|
|
<li class="gh-dashboard-activity-item" data-test-dashboard-member-activity-item>
|
|
<LinkTo class="member-details" @route="member" @model="{{parsedEvent.memberId}}">
|
|
<div class="gh-dashboard-activity-container">
|
|
{{svg-jar parsedEvent.icon}}
|
|
<div class="gh-dashboard-activity-detail">
|
|
<div class="gh-dashboard-activity-name">
|
|
{{parsedEvent.subject}}
|
|
</div>
|
|
<div class="gh-dashboard-activity-event">
|
|
{{parsedEvent.action}}
|
|
{{parsedEvent.object}}
|
|
<span class="highlight">{{parsedEvent.info}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</LinkTo>
|
|
<span class="gh-dashboard-activity-time">{{moment-from-now parsedEvent.timestamp}}</span>
|
|
</li>
|
|
{{/let}}
|
|
{{/each}}
|
|
</ul>
|
|
{{else}}
|
|
<div class="gh-no-data-list" data-test-no-member-activities>
|
|
{{svg-jar "no-data-list"}}
|
|
<span>No member activity available.</span>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
|
|
{{#if (feature "membersActivityFeed")}}
|
|
<div class="footer">
|
|
<LinkTo @route="members-activity" @query={{reset-query-params "members-activity"}}>See all activity →</LinkTo>
|
|
</div>
|
|
{{/if}}
|
|
{{/unless}}
|
|
{{/let}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|