Rearranged post list table to accomodate stats

- the balance of data vs. status and post title needed adjustment on the post list page
This commit is contained in:
Peter Zimon 2022-08-24 12:12:55 +02:00
parent c6e62b80fa
commit de8f2389cc
5 changed files with 166 additions and 89 deletions

View File

@ -1,5 +1,5 @@
{{!-- template-lint-disable no-invalid-interactive --}}
<li class="gh-list-row gh-posts-list-item"
<li class="gh-list-row gh-posts-list-item {{if this.feature.memberAttribution "gh-post-list-plain-status"}}"
{{on "mouseover" this.mouseOver}}
{{on "mouseleave" this.mouseLeave}}
...attributes
@ -47,21 +47,104 @@
</LinkTo>
{{/if}}
{{#unless @hideStatusColumn }}
{{#if (and this.session.user.isContributor @post.isPublished)}}
<a href={{@post.url}} class="permalink gh-list-data gh-post-list-status" target="_blank" rel="noopener noreferrer">
<div class="flex items-center">
{{#if @post.isScheduled}}
<span class="gh-content-status-scheduled gh-badge nowrap" title="Scheduled" data-tooltip="{{capitalize this.scheduledText}} to {{@post.emailSegment}} members">
Scheduled
{{#if @post.newsletter}}
{{svg-jar "email-stroke" class="gh-post-status-email"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-pink nowrap">
Draft
</span>
{{/if}}
{{#if @post.isPublished}}
<span class="gh-content-status-published nowrap">
Published
{{#if @post.hasEmail}}
{{svg-jar "email-stroke" class="gh-post-status-email"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isSent}}
<span class="gh-content-status-emailed nowrap">
{{svg-jar "email-stroke" class="gh-post-status-email"}}
</span>
{{/if}}
</div>
</a>
{{else}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-status">
<div class="flex items-center">
{{#if @post.isScheduled}}
<span class="gh-content-status-scheduled gh-badge nowrap" title="Scheduled" data-tooltip="To be published {{if @post.newsletter "& sent at "}}{{capitalize this.scheduledText}} to {{@post.emailSegment}} members">
{{#if this.feature.memberAttribution}}
{{svg-jar "clock" class="gh-post-status-icon"}}
{{/if}}
Scheduled
</span>
{{/if}}
{{#if @post.isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-pink nowrap">
{{#if this.feature.memberAttribution}}
{{svg-jar "pen-stroke" class="gh-post-status-icon"}}
{{/if}}
Draft
</span>
{{/if}}
{{#if @post.isPublished}}
<span class="gh-content-status-published nowrap">
{{#if this.feature.memberAttribution}}
{{svg-jar "check" class="gh-post-status-icon"}}
{{/if}}
Published
{{#if @post.hasEmail}}
&amp; sent
{{/if}}
</span>
{{/if}}
{{#if @post.isSent}}
<span class="gh-content-status-emailed nowrap">
{{svg-jar "email-stroke" class="gh-post-status-icon"}}
Sent
</span>
{{/if}}
</div>
</LinkTo>
{{/if}}
{{/unless}}
{{#if this.feature.memberAttribution}}
<a href={{@post.url}} class="permalink gh-list-data gh-post-list-signups" target="_blank" rel="noopener noreferrer">
<span class="darkgrey fw5 gh-content-attribution-stats">{{@post.count.signups}}</span>
<span class="midgrey-l2 fw4 gh-content-attribution-stats-mobile">{{gh-pluralize @post.count.signups "signup"}}</span>
{{!-- TODO: How to show this when there is no data?
<span class="gh-list-nodata">&mdash;</span> --}}
{{#if (not (eq @post.count.signups 0))}}
<span class="darkgrey fw5 gh-content-attribution-stats">{{@post.count.signups}}</span>
<span class="midgrey-l2 fw4 gh-content-attribution-stats-mobile">{{gh-pluralize @post.count.signups "signup"}}</span>
{{else}}
<span class="midlightgrey">0</span>
{{/if}}
</a>
{{/if}}
{{#if this.feature.memberAttribution}}
<a href={{@post.url}} class="permalink gh-list-data gh-post-list-conversions" target="_blank" rel="noopener noreferrer">
<span class="darkgrey fw5 gh-content-attribution-stats">{{@post.count.conversions}}</span>
<span class="midgrey-l2 fw4 gh-content-attribution-stats-mobile">{{gh-pluralize @post.count.conversions "conversion"}}</span>
{{!-- TODO: How to show this when there is no data?
<span class="gh-list-nodata">&mdash;</span> --}}
{{#if (not (eq @post.count.conversions 0))}}
<span class="darkgrey fw5 gh-content-attribution-stats">{{@post.count.conversions}}</span>
<span class="midgrey-l2 fw4 gh-content-attribution-stats-mobile">{{gh-pluralize @post.count.conversions "conversion"}}</span>
{{else}}
<span class="midlightgrey">0</span>
{{/if}}
</a>
{{/if}}
@ -105,76 +188,4 @@
</LinkTo>
{{/if}}
{{/if}}
{{#unless @hideStatusColumn }}
{{#if (and this.session.user.isContributor @post.isPublished)}}
<a href={{@post.url}} class="permalink gh-list-data gh-post-list-status" target="_blank" rel="noopener noreferrer">
<div class="flex items-center">
{{#if @post.isScheduled}}
<span class="gh-content-status-scheduled gh-badge nowrap" title="Scheduled" data-tooltip="{{capitalize this.scheduledText}} to {{@post.emailSegment}} members">
Scheduled
{{#if @post.newsletter}}
{{svg-jar "email-stroke"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-pink nowrap">
Draft
</span>
{{/if}}
{{#if @post.isPublished}}
<span class="gh-content-status-published nowrap">
Published
{{#if @post.hasEmail}}
{{svg-jar "email-stroke"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isSent}}
<span class="gh-content-status-emailed nowrap">
{{svg-jar "email-stroke"}}
</span>
{{/if}}
</div>
</a>
{{else}}
<LinkTo @route="editor.edit" @models={{array @post.displayName @post.id}} class="permalink gh-list-data gh-post-list-status">
<div class="flex items-center">
{{#if @post.isScheduled}}
<span class="gh-content-status-scheduled gh-badge nowrap" title="Scheduled" data-tooltip="{{capitalize this.scheduledText}} to {{@post.emailSegment}} members">
Scheduled
{{#if @post.newsletter}}
{{svg-jar "email-stroke"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-pink nowrap">
Draft
</span>
{{/if}}
{{#if @post.isPublished}}
<span class="gh-content-status-published nowrap">
Published
{{#if @post.hasEmail}}
{{svg-jar "email-stroke"}}
{{/if}}
</span>
{{/if}}
{{#if @post.isSent}}
<span class="gh-content-status-emailed nowrap">
{{svg-jar "email-stroke"}}
</span>
{{/if}}
</div>
</LinkTo>
{{/if}}
{{/unless}}
</li>

View File

@ -220,7 +220,7 @@ ul.nostyle li {
.gh-list-rate-amount > span {
background: rgb(213,184,255);
background: linear-gradient(90deg, rgba(213,184,255,1) 0%, rgba(142,66,255,1) 100%);
background: linear-gradient(90deg, #FB2D8D 0%, #8E42FF 100%);
border-top-right-radius: 2.5px;
border-bottom-right-radius: 2.5px;
position: absolute;

View File

@ -172,17 +172,18 @@
.gh-posts-conversions-header,
.gh-posts-sends-header,
.gh-posts-opens-header {
width: 110px;
width: 90px;
padding-right: 8px;
}
.feature-memberAttribution .gh-posts-opens-header {
width: 170px;
}
.gh-posts-status-header {
width: 140px;
}
/* .gh-posts-status-header {
width: 140px;
} */
.pages-list .gh-posts-conversions-header,
.pages-list .gh-posts-sends-header {
width: 140px;
@ -223,6 +224,12 @@
font-size: 1.3rem;
}
.gh-post-list-signups,
.gh-post-list-conversions,
.gh-post-list-recipients {
padding-right: 8px;
}
.gh-content-entry-title {
display: flex;
align-items: center;
@ -345,6 +352,64 @@
background: color-mod(var(--green) a(20%));
}
.gh-post-list-plain-status .gh-content-status-draft,
.gh-post-list-plain-status .gh-content-status-published,
.gh-post-list-plain-status .gh-content-status-scheduled,
.gh-post-list-plain-status .gh-content-status-emailed {
background: none;
color: var(--darkgrey);
text-transform: unset;
font-size: 1.3rem;
font-weight: 500;
}
.gh-post-list-plain-status .gh-post-status-email {
margin-bottom: -1px;
margin-left: 4px;
}
.gh-post-list-plain-status .gh-post-status-email path {
stroke: var(--darkgrey) !important;
}
.gh-post-list-plain-status .gh-post-status-icon {
width: 16px;
height: 16px;
margin: 0 7px 0 0;
}
.gh-post-list-plain-status .gh-content-status-published .gh-post-status-icon {
width: 12px;
height: 12px;
}
.gh-post-list-plain-status .gh-content-status-scheduled .gh-post-status-icon path {
stroke: var(--purple) !important;
}
.gh-post-list-plain-status .gh-content-status-draft .gh-post-status-icon path {
stroke: var(--pink) !important;
}
.gh-post-list-plain-status .gh-content-status-published .gh-post-status-icon path {
stroke: var(--midgrey-l1) !important;
}
.gh-post-list-plain-status .gh-content-status-published,
.gh-post-list-plain-status .gh-content-status-emailed {
color: var(--midgrey-l1);
margin: 0;
}
.gh-post-list-plain-status .gh-content-status-published .gh-post-status-email path {
stroke: var(--midgrey-l1) !important;
}
.gh-post-list-plain-status .gh-content-status-emailed path {
stroke: var(--midgrey-l1) !important;
stroke-width: 1.5;
}
.gh-content-entry-author {
color: var(--middarkgrey);
}
@ -381,7 +446,7 @@
}
.feature-memberAttribution .gh-posts-opens-header {
width: 160px;
width: 100px;
}
}

View File

@ -31,6 +31,7 @@
{{#if this.postsInfinityModel}}
<li class="gh-list-row header">
<div class="gh-list-header gh-posts-title-header">Title</div>
<div class="gh-list-header gh-posts-status-header">{{#unless this.feature.memberAttribution}}Status{{/unless}}</div>
{{#if this.feature.memberAttribution}}
<div class="gh-list-header gh-posts-signups-header">Signups</div>
<div class="gh-list-header gh-posts-conversions-header">Paid</div>
@ -39,7 +40,6 @@
<div class="gh-list-header gh-posts-sends-header">Sends</div>
<div class="gh-list-header gh-posts-opens-header">Opens</div>
{{/if}}
<div class="gh-list-header gh-posts-status-header">{{#unless this.feature.memberAttribution}}Status{{/unless}}</div>
</li>
{{/if}}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>pencil</title><path class="a" d="M22.19,1.81a3.639,3.639,0,0,0-5.17.035l-14.5,14.5L.75,23.25l6.905-1.771,14.5-14.5A3.637,3.637,0,0,0,22.19,1.81Z"/><line class="a" x1="16.606" y1="2.26" x2="21.74" y2="7.394"/><line class="a" x1="2.521" y1="16.344" x2="7.66" y2="21.474"/></svg>

After

Width:  |  Height:  |  Size: 467 B