Fix /more silently hiding spillover categories/tracked items with no articles yet
Sections were only rendered when their preview fetch returned at least one article, so a freshly-marked-spillover tracked item with nothing published yet looked like it wasn't there at all. Now every spillover section always renders its name/link, with a "No stories here yet." placeholder — matching the empty state InfiniteFeed already uses on the home and category feeds.
This commit is contained in:
@@ -12,28 +12,32 @@
|
|||||||
|
|
||||||
<div class="sections">
|
<div class="sections">
|
||||||
{#each data.categorySections as section (section.category.id)}
|
{#each data.categorySections as section (section.category.id)}
|
||||||
{#if section.articles.length > 0}
|
<section class="cat-section">
|
||||||
<section class="cat-section">
|
<a class="cat-name" href={`/category/${slugify(section.category.name)}`}>{section.category.name}</a>
|
||||||
<a class="cat-name" href={`/category/${slugify(section.category.name)}`}>{section.category.name}</a>
|
<div class="list">
|
||||||
<div class="list">
|
{#if section.articles.length > 0}
|
||||||
{#each section.articles as article (article.id)}
|
{#each section.articles as article (article.id)}
|
||||||
<ArticleListRow {article} />
|
<ArticleListRow {article} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
{:else}
|
||||||
</section>
|
<div class="empty">No stories here yet.</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
{/each}
|
{/each}
|
||||||
{#each data.eventSections as section (section.event.id)}
|
{#each data.eventSections as section (section.event.id)}
|
||||||
{#if section.articles.length > 0}
|
<section class="cat-section">
|
||||||
<section class="cat-section">
|
<a class="cat-name" href={`/event/${section.event.id}`}>{section.event.name}</a>
|
||||||
<a class="cat-name" href={`/event/${section.event.id}`}>{section.event.name}</a>
|
<div class="list">
|
||||||
<div class="list">
|
{#if section.articles.length > 0}
|
||||||
{#each section.articles as article (article.id)}
|
{#each section.articles as article (article.id)}
|
||||||
<ArticleListRow {article} />
|
<ArticleListRow {article} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
{:else}
|
||||||
</section>
|
<div class="empty">No stories here yet.</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -69,4 +73,9 @@
|
|||||||
.list {
|
.list {
|
||||||
max-width: 720px;
|
max-width: 720px;
|
||||||
}
|
}
|
||||||
|
.empty {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user