Ghost/ghost/admin/app/templates/settings/audit-log.hbs
Daniel Lockyer 62915cccff
Removed brackets from resource IDs
- I don't think they're needed and it's a little cleaner without
2022-08-18 14:22:59 +02:00

80 lines
3.6 KiB
Handlebars

<section class="gh-canvas gh-members-activity">
<GhCanvasHeader class="gh-canvas-header">
<h2 class="gh-canvas-title" data-test-screen-title>
<LinkTo @route="settings">Settings</LinkTo>
<span>{{svg-jar "arrow-right"}}</span>
<LinkTo @route="settings.audit-log" data-test-link="audit-log-back">Audit log</LinkTo>
</h2>
</GhCanvasHeader>
<div class="view-container">
{{#let (audit-log-event-fetcher pageSize=50) as |eventsFetcher|}}
{{#if eventsFetcher.data}}
<div class="gh-list-scrolling">
<table class="gh-list">
<thead>
<tr>
<th>User</th>
<th>Action</th>
<th>Time</th>
</tr>
</thead>
<tbody>
{{#each eventsFetcher.data as |event|}}
{{#let (parse-audit-log-event event) as |ev|}}
<tr>
<div class="gh-list-data">
<div class="flex">
<span class="user-list-item-figure" style={{background-image-style ev.actor.profileImageUrl}}>
<span class="hidden">Photo of {{ev.actor.name}}</span>
</span>
<h3 class="ma0 pa0 gh-members-list-name">{{ev.actor.name}}</h3>
</div>
</div>
<div class="gh-list-data">
<div class="gh-members-activity-container">
<div class="gh-members-activity-icon">{{svg-jar ev.actionIcon}}</div>
<div class="gh-members-activity-event">
<span class="gh-members-activity-description">
{{capitalize-first-letter ev.action}}
{{#if (or ev.resource.title ev.resource.name)}}
<LinkTo @route="editor.edit" @models={{array ev.resource.displayName ev.resource.id}} class="permalink">
<strong>{{if ev.resource.title ev.resource.title ev.resource.name}}</strong>
</LinkTo>
{{else}}
<br/><small>{{ev.original.resource_id}}</small>
{{/if}}
</span>
</div>
</div>
</div>
<div class="gh-list-data">{{moment-format ev.original.created_at "DD MMM YYYY HH:mm:ss"}}</div>
</tr>
{{/let}}
{{/each}}
</tbody>
</table>
{{#if (not (or eventsFetcher.isLoading eventsFetcher.hasReachedEnd))}}
<GhScrollTrigger @enter={{eventsFetcher.loadNextPage}} @triggerOffset={{250}} />
{{/if}}
</div>
{{else}}
{{#unless eventsFetcher.isLoading}}
<div class="no-posts-box">
<div class="no-posts">
{{svg-jar "activity-placeholder" class="gh-members-placeholder"}}
<h4>No staff activity yet</h4>
</div>
</div>
{{/unless}}
{{/if}}
{{#if eventsFetcher.isLoading}}
<div class="no-posts-box"><GhLoadingSpinner /></div>
{{/if}}
{{/let}}
</div>
</section>
{{outlet}}