Ghost/ghost/admin/app/templates/mentions.hbs
Simon Backx 85ac38cc48 Added mentions page for a post
fixes https://github.com/TryGhost/Team/issues/2590

Added a new route that only shows mentions for a given post. Reuses the same controller and template.
2023-02-22 10:48:15 +01:00

93 lines
4.7 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<section class="gh-canvas" {{scroll-top}}>
<GhCanvasHeader class="gh-canvas-header">
<div class="flex flex-column flex-grow-1">
{{#if this.post }}
<div class="gh-canvas-breadcrumb">
<LinkTo @route="posts">
Posts
</LinkTo>
{{svg-jar "arrow-right-small"}}
<LinkTo @route="posts.analytics" @model={{this.post.id}}>
Analytics
</LinkTo>
{{svg-jar "arrow-right-small"}}Mentions
</div>
{{/if}}
<h2 class="gh-canvas-title gh-post-title" data-test-screen-title>
{{#if this.post }}
{{this.post.title}}
{{else}}
Mentions
{{/if}}
</h2>
{{#if this.post }}
<div class="gh-post-analytics-meta">
<div class="gh-post-analytics-meta-text">
This post was mentioned in:
</div>
</div>
{{/if}}
</div>
</GhCanvasHeader>
<section class="gh-mentions-main-section">
<div class="gh-mentions-list">
{{#if this.mentionsInfinityModel}}
<div>
{{#each this.mentionsInfinityModel as |mention|}}
<a href="{{mention.source}}" class="gh-mention-card" rel="noreferrer noopener" target="_blank">
{{!-- TODO: link to the post analytics page of your post --}}
<div class="gh-mention-header">
{{#if mention.sourceFavicon}}
<img src="{{mention.sourceFavicon}}" alt="{{mention.sourceSiteTitle}}" class="gh-mention-icon">
{{/if}}
<div class="gh-mention-publisher">{{mention.sourceSiteTitle}}</div>
<div class="gh-mention-link-icon">
{{svg-jar "twitter-link"}}
</div>
<span class="gh-mention-your-link">{{if mention.resource mention.resource.name mention.target}}</span>
<span class="gh-mention-timestamp" title={{gh-format-post-time mention.timestamp}}>{{moment-from-now mention.timestamp}}</span>
</div>
<div class="gh-mention-content">
<div class="gh-mention-source">
<h3 class="gh-mention-title">{{if mention.sourceTitle mention.sourceTitle mention.target}}</h3>
{{#if mention.sourceExcerpt}}
<p class="gh-mention-description">{{mention.sourceExcerpt}}</p>
{{/if}}
<div class="gh-mention-metadata">
{{#if mention.sourceAuthor}}
<span class="gh-mention-author">{{mention.sourceAuthor}}</span>
{{/if}}
</div>
</div>
{{#if mention.sourceFeaturedImage}}
<div class="gh-mention-thumbnail">
<img src="{{mention.sourceFeaturedImage}}" alt="" role="presentation">
</div>
{{/if}}
</div>
</a>
{{/each}}
</div>
{{else}}
<div class="gh-mentions-list-cta">
{{svg-jar "email-love-letter" class="love-letter"}}
<h4>No mentions yet</h4>
<p>When other sites mention your posts, they'll appear here.</p>
</div>
{{/if}}
<GhInfinityLoader
@infinityModel={{this.mentionsInfinityModel}}
@scrollable=".gh-main"
@triggerOffset={{1000}} />
</div>
<div class="gh-mentions-sidebar">
<div class="gh-mentions-explainer">
<img src="assets/img/mentions-background.png" alt="" role="presentation"/>
<h2>Introducing Mentions</h2>
<p>Whenever another person or site links to you, youll receive a notification in your dashboard to show you whos talking about your content — and, when you link to someone elses work, theyll be notified, too.</p>
</div>
</div>
</section>
</section>