diff --git a/OliverBooth/Pages/Tutorials/Article.cshtml b/OliverBooth/Pages/Tutorials/Article.cshtml index c5dd15c..c7efb52 100644 --- a/OliverBooth/Pages/Tutorials/Article.cshtml +++ b/OliverBooth/Pages/Tutorials/Article.cshtml @@ -1,7 +1,7 @@ @page "/tutorial/{**slug}" @using Humanizer @using Microsoft.AspNetCore.Mvc.TagHelpers -@using OliverBooth.Data.Blog +@using OliverBooth.Data @using OliverBooth.Data.Web @using OliverBooth.Services @inject ITutorialService TutorialService @@ -64,7 +64,9 @@
- @if (article.PreviousPart is { } previousPartId && TutorialService.TryGetArticle(previousPartId, out ITutorialArticle? previousPart)) + @if (article.PreviousPart is { } previousPartId && + TutorialService.TryGetArticle(previousPartId, out ITutorialArticle? previousPart) && + previousPart.Visibility == Visibility.Published) { Previous Part

@@ -75,7 +77,9 @@ }

- @if (article.NextPart is { } nextPartId && TutorialService.TryGetArticle(nextPartId, out ITutorialArticle? nextPart)) + @if (article.NextPart is { } nextPartId && + TutorialService.TryGetArticle(nextPartId, out ITutorialArticle? nextPart) && + nextPart.Visibility == Visibility.Published) { Next Part

diff --git a/OliverBooth/Pages/Tutorials/Index.cshtml b/OliverBooth/Pages/Tutorials/Index.cshtml index ab72749..aaa2346 100644 --- a/OliverBooth/Pages/Tutorials/Index.cshtml +++ b/OliverBooth/Pages/Tutorials/Index.cshtml @@ -1,5 +1,6 @@ @page "/tutorials/{**slug}" @using System.Text +@using OliverBooth.Data @using OliverBooth.Data.Web @using OliverBooth.Services @model Index @@ -31,11 +32,16 @@ }

@(currentFolder?.Title ?? "Tutorials")

- @foreach (ITutorialFolder[] folders in TutorialService.GetFolders(currentFolder).Chunk(2)) + @foreach (ITutorialFolder[] folders in TutorialService.GetFolders(currentFolder, Visibility.Published).Chunk(2)) {
@foreach (ITutorialFolder folder in folders) { + if (folder.Visibility != Visibility.Published) + { + continue; + } +
@@ -54,7 +60,7 @@ @if (currentFolder is not null) { - foreach (ITutorialArticle[] articles in TutorialService.GetArticles(currentFolder).Chunk(2)) + foreach (ITutorialArticle[] articles in TutorialService.GetArticles(currentFolder, Visibility.Published).Chunk(2)) {
@foreach (ITutorialArticle article in articles)