Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed post list not displaying correctly with long titles #21892

Merged
merged 9 commits into from
Dec 16, 2024
77 changes: 40 additions & 37 deletions ghost/admin/app/components/posts-list/list-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -145,42 +145,10 @@
</LinkTo>
{{/if}}

{{!-- Opened / Signups column --}}
{{#if (and @post.showEmailOpenAnalytics @post.showEmailClickAnalytics) }}
<LinkTo @route="members" @query={{hash filterParam=(concat "opened_emails.post_id:" @post.id) }} class="permalink gh-list-data gh-post-list-metrics">
<span class="gh-content-email-stats-value">
{{#if this.isHovered}}
{{format-number @post.email.openedCount}}
{{else}}
{{@post.email.openRate}}<sup>%</sup>
{{/if}}
</span>
<span class="gh-content-email-stats">
opened
</span>
</LinkTo>
{{else}}
<LinkTo @route={{this.editorRoute}} @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data">
{{!-- Empty on purpose --}}
</LinkTo>
{{/if}}

{{!-- Clicked / Conversions column --}}
{{#if @post.showEmailClickAnalytics }}
<LinkTo @route="members" @query={{hash filterParam=(concat "clicked_links.post_id:" @post.id) }} class="permalink gh-list-data gh-post-list-metrics">
<span class="gh-content-email-stats-value">
{{#if this.isHovered}}
{{format-number @post.count.clicks}}
{{else}}
{{@post.clickRate}}<sup>%</sup>
{{/if}}
</span>
<span class="gh-content-email-stats">
clicked
</span>
</LinkTo>
{{else}}
{{#if @post.showEmailOpenAnalytics }}
{{!-- Metrics columns wrapper --}}
<div class="gh-post-list-metrics-container">
{{!-- Opened / Signups column --}}
{{#if (and @post.showEmailOpenAnalytics @post.showEmailClickAnalytics) }}
<LinkTo @route="members" @query={{hash filterParam=(concat "opened_emails.post_id:" @post.id) }} class="permalink gh-list-data gh-post-list-metrics">
<span class="gh-content-email-stats-value">
{{#if this.isHovered}}
Expand All @@ -198,7 +166,42 @@
{{!-- Empty on purpose --}}
</LinkTo>
{{/if}}
{{/if}}

{{!-- Clicked / Conversions column --}}
{{#if @post.showEmailClickAnalytics }}
<LinkTo @route="members" @query={{hash filterParam=(concat "clicked_links.post_id:" @post.id) }} class="permalink gh-list-data gh-post-list-metrics">
<span class="gh-content-email-stats-value">
{{#if this.isHovered}}
{{format-number @post.count.clicks}}
{{else}}
{{@post.clickRate}}<sup>%</sup>
{{/if}}
</span>
<span class="gh-content-email-stats">
clicked
</span>
</LinkTo>
{{else}}
{{#if @post.showEmailOpenAnalytics }}
<LinkTo @route="members" @query={{hash filterParam=(concat "opened_emails.post_id:" @post.id) }} class="permalink gh-list-data gh-post-list-metrics">
<span class="gh-content-email-stats-value">
{{#if this.isHovered}}
{{format-number @post.email.openedCount}}
{{else}}
{{@post.email.openRate}}<sup>%</sup>
{{/if}}
</span>
<span class="gh-content-email-stats">
opened
</span>
</LinkTo>
{{else}}
<LinkTo @route={{this.editorRoute}} @models={{array this.post.displayName this.post.id}} class="permalink gh-list-data">
{{!-- Empty on purpose --}}
</LinkTo>
{{/if}}
{{/if}}
</div>

{{!-- Button column --}}
{{#if @post.hasAnalyticsPage }}
Expand Down
51 changes: 41 additions & 10 deletions ghost/admin/app/styles/layouts/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@
/* END Temporary styles to move post list to use flex instead of tables */

.gh-posts-list-item {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
}

.gh-posts-list-item a:hover {
Expand Down Expand Up @@ -281,7 +283,10 @@
}

.gh-post-list-title {
padding-left: 10px;
flex: 0 1 auto;
min-width: 0;
max-width: 80%;
overflow: hidden;
}

.gh-post-list-title .gh-lexical-indicator {
Expand Down Expand Up @@ -339,6 +344,8 @@
margin: 0 0 2px;
font-size: 1.6rem;
font-weight: 600;
max-width: 100%;
overflow: hidden;
}

.gh-content-entry-title a {
Expand Down Expand Up @@ -654,6 +661,18 @@
.gh-contentfilter-menu:last-of-type {
padding-right: 8px;
}

.gh-post-list-title {
flex: 1 1 auto;
max-width: 100%;
overflow: hidden;
padding-right: 0;
}

.gh-post-list-metrics-container a {
padding: 0!important;
}

}

@media (min-width: 901px) {
Expand Down Expand Up @@ -753,11 +772,7 @@
display: block;
padding: 6px 0 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: initial;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}

@media (max-width: 1280px) {
Expand Down Expand Up @@ -1451,10 +1466,6 @@
transition: all 1s ease;
}

.gh-post-list-metrics {
width: 120px;
}

.gh-content-email-stats,
.gh-post-list-cta {
margin: 0 0 3px;
Expand Down Expand Up @@ -2127,3 +2138,23 @@ span.dropdown .gh-post-list-cta > span {
.gh-post-analytics-mentions .gh-dashboard-list-footer a {
font-size: 1.3rem;
}

.gh-post-list-button {
flex: 0 0 auto;
}

.gh-post-list-metrics-container {
display: flex;
flex: 0 0 auto;
}

.gh-post-list-metrics {
width: 100px;
flex-shrink: 0;
display: grid;
grid-template-rows: auto auto;
}

.gh-post-list-button {
flex: 0 0 auto;
}
Loading