0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

Added mentions widget to post analytics

refs https://github.com/TryGhost/Team/issues/2575
This commit is contained in:
Djordje Vlaisavljevic 2023-02-21 19:55:57 +00:00
parent d3563d9c06
commit 1545d4fb5b
3 changed files with 98 additions and 28 deletions

View file

@ -115,32 +115,30 @@
</Tabs::Tabs>
{{#if this.isLoaded }}
{{#if this.showLinks }}
{{#if (is-empty this.links) }}
{{!-- Empty state --}}
{{else}}
<Posts::LinksTable
@links={{this.links}}
@updateLink={{this.updateLink}}
@showSuccess={{this.showSuccess}}
/>
<div class="gh-post-analytics-split {{if this.showMentions "gh-post-analytics-with-mentions"}}">
{{#if this.showLinks }}
{{#if (is-empty this.links) }}
{{!-- Empty state --}}
{{else}}
<Posts::LinksTable
@links={{this.links}}
@updateLink={{this.updateLink}}
@showSuccess={{this.showSuccess}}
/>
{{/if}}
{{/if}}
{{/if}}
{{#if this.showMentions }}
<div class="pa4">
<h3>Mentions</h3>
<div>
<div>
{{#if this.showMentions }}
<div class="gh-post-analytics-box gh-post-analytics-mentions">
<h3 class="gh-post-analytics-mentions-header">Mentions</h3>
<div class="gh-post-analytics-mentions-list">
{{#if this.mentions}}
{{#each this.mentions as |mention|}}
<div class="flex">
<img src="assets/img/orb-squircle.png" alt="Ghost" class="w5 h5 mr2 flex-shrink-0" />
<div class="flex flex-column">
<span class="gh-dashboard-list-text">{{if mention.sourceSiteTitle mention.sourceSiteTitle mention.source}}</span>
<span>{{moment-from-now mention.timestamp}}</span>
</div>
</div>
<a href="{{mention.source}}" class="gh-post-analytics-mention" rel="noreferrer noopener" target="_blank">
<img src="{{mention.sourceFavicon}}" alt="{{mention.sourceSiteTitle}}" class="w5 h5 mr2 flex-shrink-0" />
<span class="gh-post-analytics-mention-title">{{if mention.sourceTitle mention.sourceTitle mention.source}}</span>
<span class="gh-post-analytics-mention-timestamp">{{moment-from-now mention.timestamp}}</span>
</a>
{{/each}}
{{else}}
<div>
@ -148,10 +146,12 @@
</div>
{{/if}}
</div>
<div class="gh-dashboard-list-footer">
<LinkTo @route="mentions">View all mentions &rarr;</LinkTo>
</div>
</div>
<a href="#">See all mentions</a>
</div>
{{/if}}
{{/if}}
</div>
<div class="gh-post-analytics-box resources">
<a href="https://ghost.org/help/post-analytics/" target="_blank" class="gh-post-analytics-resource" rel="noopener noreferrer">

View file

@ -1424,7 +1424,9 @@ kbd {
/* Post Analytics */
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-newsletter-clicks,
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-source-attribution {
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-source-attribution,
.gh-post-analytics-box.gh-post-analytics-mentions
{
background: #101114;
border-color: #26282b;
}

View file

@ -706,7 +706,8 @@
}
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-newsletter-clicks,
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-source-attribution {
.feature-audienceFeedback .gh-post-analytics-box.gh-post-analytics-source-attribution,
.gh-post-analytics-box.gh-post-analytics-mentions {
flex: 1;
border: 1px solid #ebeef0;
padding: 28px 24px 24px;
@ -753,7 +754,7 @@
gap: 24px;
}
.gh-newsletter-clicks-header {
.gh-newsletter-clicks-header, .gh-mentions-header {
align-items: center;
font-size: 1.55rem;
font-weight: 700;
@ -1893,3 +1894,70 @@
padding: 0 0 24px;
}
}
.gh-post-analytics-split {
display: grid;
grid-gap: 24px;
grid-template-columns: 1fr;
}
.gh-post-analytics-split.gh-post-analytics-with-mentions {
grid-template-columns: 1fr 1fr;
}
.gh-post-analytics-mentions {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.gh-post-analytics-mentions-header {
font-size: 1.55rem;
font-weight: 700;
line-height: 1em;
margin: 0 0 8px;
padding: 0;
color: var(--darkgrey);
white-space: nowrap;
letter-spacing: -.3px;
}
.gh-post-analytics-mentions-list {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-evenly;
}
.gh-post-analytics-mention {
display: grid;
grid-template-columns: 20px auto;
grid-template-rows: 20px auto;
grid-column-gap: 8px;
padding: 4px 0;
flex-direction: column;
padding: 10px 0;
}
.gh-post-analytics-mention-title {
color: var(--darkgrey);
font-size: 1.5rem;
font-weight: 600;
line-height: 1.3;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.gh-post-analytics-mention-timestamp {
color: var(--midlightgrey);
font-size: 1.3rem;
font-weight: 500;
padding-left: 28px;
white-space: nowrap;
}
.gh-post-analytics-mentions .gh-dashboard-list-footer {
margin-top: auto;
}