From e9813150ebb34b804a65a5bd28f27e26735a192a Mon Sep 17 00:00:00 2001 From: James Morris Date: Wed, 24 Aug 2022 15:46:39 +0100 Subject: [PATCH] Adding in sticky headers to posts and pages behind a feature flag - Adding sticky headers so columns are easier to read and parse - These are working only behind the feature flag - Checked against narrower viewports and dark mode refs https://github.com/TryGhost/Team/issues/1837 --- ghost/admin/app/styles/app-dark.css | 10 +++ ghost/admin/app/styles/components/lists.css | 13 +++- ghost/admin/app/styles/layouts/content.css | 3 +- ghost/admin/app/styles/layouts/main.css | 8 ++ ghost/admin/app/templates/pages.hbs | 72 ++++++++--------- ghost/admin/app/templates/posts.hbs | 86 +++++++++++---------- 6 files changed, 112 insertions(+), 80 deletions(-) diff --git a/ghost/admin/app/styles/app-dark.css b/ghost/admin/app/styles/app-dark.css index f1b245b081..ac3eea8d51 100644 --- a/ghost/admin/app/styles/app-dark.css +++ b/ghost/admin/app/styles/app-dark.css @@ -771,6 +771,10 @@ input:focus, background: var(--whitegrey); } +.gh-list-nodata { + color: #5b6167; +} + .gh-content-status-published { background: var(--whitegrey-l1); } @@ -964,6 +968,12 @@ input:focus, border-top: 1px solid var(--hairline-color-1); } +@media (max-width: 1200px) { + .gh-list-data { + border-top: 0 none; + } +} + /* Members */ .gh-members-help-card, .gh-offers-help-card { diff --git a/ghost/admin/app/styles/components/lists.css b/ghost/admin/app/styles/components/lists.css index 9e955c5eb2..1456d767a1 100644 --- a/ghost/admin/app/styles/components/lists.css +++ b/ghost/admin/app/styles/components/lists.css @@ -58,17 +58,23 @@ ul.nostyle li { white-space: nowrap; } +.posts-list .gh-list-row.header, +.pages-list .gh-list-row.header { + position: sticky; + background: var(--white); + z-index: 2; + top: 0; +} + .gh-list-row.header.empty .gh-list-header { padding: 0; } .gh-list:not(.tabbed) .gh-list-header:first-child { - border-top-left-radius: 5px; padding-left: 0; } .gh-list:not(.tabbed) .gh-list-header:last-child { - border-top-right-radius: 5px; padding-right: 16px; } @@ -387,6 +393,7 @@ ul.nostyle li { } /* Horizontally scrolling list */ +.gh-list-sticky, .gh-list-scrolling { position: relative; overflow: auto; @@ -486,6 +493,7 @@ ul.nostyle li { } @media (max-width: 800px) { + .gh-list-sticky, .gh-list-scrolling { max-width: calc(100% + 8vw); height: calc(100vh - 193px); @@ -497,6 +505,7 @@ ul.nostyle li { } @media (min-width: 1450px) { + .gh-list-sticky, .gh-list-scrolling { height: calc(100vh - 96px); } diff --git a/ghost/admin/app/styles/layouts/content.css b/ghost/admin/app/styles/layouts/content.css index b68960fc5e..734b33271a 100644 --- a/ghost/admin/app/styles/layouts/content.css +++ b/ghost/admin/app/styles/layouts/content.css @@ -598,7 +598,8 @@ padding: 0 0.33em; } - .posts-list .gh-list-nodata { + .posts-list .gh-list-nodata, + .pages-list .gh-list-nodata { display: none; } } diff --git a/ghost/admin/app/styles/layouts/main.css b/ghost/admin/app/styles/layouts/main.css index fd19e52108..b58f977471 100644 --- a/ghost/admin/app/styles/layouts/main.css +++ b/ghost/admin/app/styles/layouts/main.css @@ -1078,6 +1078,10 @@ max-width: var(--main-layout-content-maxwidth); } +.gh-canvas.gh-canvas-sticky { + padding-bottom: 0; /* No padding needed when tables are sticky */ +} + .gh-canvas.circle-bg::before { position: absolute; display: block; @@ -1558,6 +1562,10 @@ padding-bottom: var(--main-layout-area-padding); } +.gh-canvas-sticky .view-container { + padding-bottom: 0; +} + .view-content { padding: 20px; } diff --git a/ghost/admin/app/templates/pages.hbs b/ghost/admin/app/templates/pages.hbs index 3e48d5b1dd..0142b6cb5c 100644 --- a/ghost/admin/app/templates/pages.hbs +++ b/ghost/admin/app/templates/pages.hbs @@ -1,4 +1,4 @@ -
+
@@ -27,41 +27,43 @@
-
    - {{#if this.postsInfinityModel}} -
  1. -
    Title
    -
    {{#unless this.feature.memberAttribution}}Status{{/unless}}
    - {{#if this.feature.memberAttribution}} -
    Signups
    -
    Conversions
    - {{/if}} -
  2. - {{/if}} - - {{#each this.postsInfinityModel as |page|}} - - {{else}} -
  3. -
    - {{#if this.showingAll}} - {{svg-jar "pages-placeholder" class="gh-pages-placeholder"}} -

    Tell the world about yourself.

    - - Create a new page - - {{else}} -

    No pages match the current filter

    - - Show all pages - +
    +
      + {{#if this.postsInfinityModel}} +
    1. +
      Title
      +
      {{#unless this.feature.memberAttribution}}Status{{/unless}}
      + {{#if this.feature.memberAttribution}} +
      Signups
      +
      Conversions
      {{/if}} -
    -
  4. - {{/each}} -
+ + {{/if}} + + {{#each this.postsInfinityModel as |page|}} + + {{else}} +
  • +
    + {{#if this.showingAll}} + {{svg-jar "pages-placeholder" class="gh-pages-placeholder"}} +

    Tell the world about yourself.

    + + Create a new page + + {{else}} +

    No pages match the current filter

    + + Show all pages + + {{/if}} +
    +
  • + {{/each}} + + +
    @@ -27,48 +27,50 @@
    -
      - {{#if this.postsInfinityModel}} -
    1. -
      Title
      - {{#if this.feature.memberAttribution}} -
      -
      Signups
      -
      Paid
      - {{/if}} - {{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled") (not this.session.user.isContributor) this.feature.emailAnalytics)}} -
      Sends
      -
      Opens
      - {{/if}} - {{#unless this.feature.memberAttribution}} -
      Status
      - {{/unless}} -
    2. - {{/if}} +
      +
        + {{#if this.postsInfinityModel}} +
      1. +
        Title
        + {{#if this.feature.memberAttribution}} +
        +
        Signups
        +
        Paid
        + {{/if}} + {{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled") (not this.session.user.isContributor) this.feature.emailAnalytics)}} +
        Sends
        +
        Opens
        + {{/if}} + {{#unless this.feature.memberAttribution}} +
        Status
        + {{/unless}} +
      2. + {{/if}} - {{#each this.postsInfinityModel as |post|}} - - {{else}} -
      3. -
        - {{#if this.showingAll}} - {{svg-jar "posts-placeholder" class="gh-posts-placeholder"}} -

        Start creating content.

        - - Write a new post - - {{else}} -

        No posts match the current filter

        - - Show all posts - - {{/if}} -
        -
      4. - {{/each}} -
      + {{#each this.postsInfinityModel as |post|}} + + {{else}} +
    3. +
      + {{#if this.showingAll}} + {{svg-jar "posts-placeholder" class="gh-posts-placeholder"}} +

      Start creating content.

      + + Write a new post + + {{else}} +

      No posts match the current filter

      + + Show all posts + + {{/if}} +
      +
    4. + {{/each}} +
    +