diff --git a/Wave/Components/Layout/NavMenu.razor b/Wave/Components/Layout/NavMenu.razor index ed9983e..0862ee1 100644 --- a/Wave/Components/Layout/NavMenu.razor +++ b/Wave/Components/Layout/NavMenu.razor @@ -21,6 +21,11 @@
  • @Localizer["Review_Label"]
  • + + +
  • @Localizer["Future_Label"]
  • +
    +
  • @Localizer["ManageUsers_Label"]
  • diff --git a/Wave/Components/Pages/Future.razor b/Wave/Components/Pages/Future.razor new file mode 100644 index 0000000..c28ccf3 --- /dev/null +++ b/Wave/Components/Pages/Future.razor @@ -0,0 +1,33 @@ +@page "/future" +@using Wave.Data +@using Microsoft.EntityFrameworkCore +@using Wave.Data.Migrations.postgres + +@attribute [Authorize(Policy = "ArticleDeletePermissions")] +@inject IDbContextFactory ContextFactory +@inject IStringLocalizer Localizer + +
    + @foreach (var article in Articles) { + + } + @if(Articles.Count < 1) { +

    @Localizer["NoArticles"]

    + } +
    + +@code { + private List
    Articles { get; } = []; + + protected override async Task OnInitializedAsync() { + await using var context = await ContextFactory.CreateDbContextAsync(); + + var now = DateTimeOffset.UtcNow; + Articles.AddRange(await + context.Set
    () + .Include(a => a.Author) + .Where(a => a.Status == ArticleStatus.Published && a.PublishDate > now) + .OrderByDescending(a => a.PublishDate) + .ToListAsync()); + } +} diff --git a/Wave/Resources/Components/Layout/NavMenu.de-DE.resx b/Wave/Resources/Components/Layout/NavMenu.de-DE.resx index e7a8c0a..4d6d624 100644 --- a/Wave/Resources/Components/Layout/NavMenu.de-DE.resx +++ b/Wave/Resources/Components/Layout/NavMenu.de-DE.resx @@ -122,4 +122,7 @@ Registrieren + + In Veröffentlichung + \ No newline at end of file diff --git a/Wave/Resources/Components/Layout/NavMenu.resx b/Wave/Resources/Components/Layout/NavMenu.resx index e401df6..d46382d 100644 --- a/Wave/Resources/Components/Layout/NavMenu.resx +++ b/Wave/Resources/Components/Layout/NavMenu.resx @@ -122,4 +122,7 @@ Sign Up + + Publishing + \ No newline at end of file