mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Restricted linking to posts and pages
refs https://github.com/TryGhost/Toolbox/issues/356 - linking is a bit hit-or-miss right now so it's best to only link to the resources we can - this implements a `linkable` attribute on an event to indicate if we can link to its page or not
This commit is contained in:
parent
b9a42bcb1c
commit
30d211fcab
2 changed files with 10 additions and 4 deletions
|
@ -25,11 +25,15 @@
|
|||
<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>
|
||||
{{#if ev.linkable}}
|
||||
<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}}
|
||||
<strong>{{if ev.resource.title ev.resource.title ev.resource.name}}</strong>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<small>(unknown)</small>
|
||||
<small>(unknown)</small>
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -9,6 +9,7 @@ export default class ParseAuditLogEvent extends Helper {
|
|||
const actionIcon = getActionIcon(ev);
|
||||
const getActor = () => this.store.findRecord(ev.actor_type, ev.actor_id, {reload: false});
|
||||
const getResource = () => this.store.findRecord(ev.resource_type, ev.resource_id, {reload: false});
|
||||
const linkable = ['page', 'post'].includes(ev.resource_type);
|
||||
|
||||
return {
|
||||
get actor() {
|
||||
|
@ -17,6 +18,7 @@ export default class ParseAuditLogEvent extends Helper {
|
|||
get resource() {
|
||||
return getResource();
|
||||
},
|
||||
linkable,
|
||||
actionIcon,
|
||||
action,
|
||||
original: ev
|
||||
|
|
Loading…
Add table
Reference in a new issue