Ghost/ghost/admin/app/components/dashboard/v5/charts/recent-activity.hbs
Simon Backx da3b3850f5 Added the newsletter name to the activity feed
refs https://github.com/TryGhost/Team/issues/1563

- When a member (un)subscribes to a specific newsletter, we should add the name of the newsletter.
- Replaced CSS lowercase/first uppercase transform with a new HBS helper so we can maintain the caps in the newsletter names.
- Copy is still WIP, refs https://ghost.slack.com/archives/C02G9E68C/p1651569897474819
2022-05-03 14:24:18 +02:00

53 lines
3.0 KiB
Handlebars

<section class="gh-dashboard5-section gh-dashboard5-section-main gh-dashboard5-recent-activity">
<article class="gh-dashboard5-box">
<div class="gh-dashboard5-list" data-test-dashboard-member-activity>
<div class="gh-dashboard5-list-header">
<Dashboard::v5::Parts::Metric @label="Recent activity" />
</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">
<p>Loading...</p>
</div>
{{else}}
{{#if eventsFetcher.data}}
{{#each eventsFetcher.data as |event|}}
{{#let (parse-member-event event) as |parsedEvent|}}
<div class="gh-dashboard5-list-item" data-test-dashboard-member-activity-item>
<LinkTo class="member-details" @route="member" @model="{{parsedEvent.memberId}}">
<GhMemberAvatar @member={{parsedEvent.member}} @containerClass="w8 h8 mr3 flex-shrink-0" />
{{parsedEvent.subject}}
<span>
{{capitalize-first-letter parsedEvent.action}}
{{parsedEvent.object}}
{{parsedEvent.info}}
</span>
</LinkTo>
<span class="gh-dashboard5-list-date">{{moment-from-now parsedEvent.timestamp}}</span>
</div>
{{/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 &rarr;</LinkTo>
</div>
</div>
</article>
</section>