Added ArticleTileArray
This commit is contained in:
parent
4af471b48a
commit
1601e80dfb
10
Wave/Components/ArticleTileArray.razor
Normal file
10
Wave/Components/ArticleTileArray.razor
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-x-8 gap-y-4 mb-6" @attributes="AdditionalAttributes">
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public required RenderFragment ChildContent { get; set; }
|
||||||
|
[Parameter(CaptureUnmatchedValues = true)]
|
||||||
|
public IDictionary<string, object>? AdditionalAttributes { get; set; }
|
||||||
|
}
|
|
@ -8,14 +8,14 @@
|
||||||
@inject UserManager<ApplicationUser> UserManager
|
@inject UserManager<ApplicationUser> UserManager
|
||||||
@inject IStringLocalizer<Drafts> Localizer
|
@inject IStringLocalizer<Drafts> Localizer
|
||||||
|
|
||||||
<div class="flex gap-x-8 gap-y-4">
|
<ArticleTileArray>
|
||||||
@foreach (var article in Articles) {
|
@foreach (var article in Articles) {
|
||||||
<ArticleTile Article="article" />
|
<ArticleTile Article="article" />
|
||||||
}
|
}
|
||||||
@if (Articles.Count < 1) {
|
@if (Articles.Count < 1) {
|
||||||
<p>@Localizer["NoArticles"]</p>
|
<p>@Localizer["NoArticles"]</p>
|
||||||
}
|
}
|
||||||
</div>
|
</ArticleTileArray>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[CascadingParameter]
|
[CascadingParameter]
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
@page "/future"
|
@page "/future"
|
||||||
@using Wave.Data
|
@using Wave.Data
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Wave.Data.Migrations.postgres
|
|
||||||
|
|
||||||
@attribute [Authorize(Policy = "ArticleDeletePermissions")]
|
@attribute [Authorize(Policy = "ArticleDeletePermissions")]
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||||
@inject IStringLocalizer<Future> Localizer
|
@inject IStringLocalizer<Future> Localizer
|
||||||
|
|
||||||
<div class="flex gap-x-8 gap-y-4">
|
<ArticleTileArray>
|
||||||
@foreach (var article in Articles) {
|
@foreach (var article in Articles) {
|
||||||
<ArticleTile Article="article" />
|
<ArticleTile Article="article" />
|
||||||
}
|
}
|
||||||
@if(Articles.Count < 1) {
|
@if(Articles.Count < 1) {
|
||||||
<p>@Localizer["NoArticles"]</p>
|
<p>@Localizer["NoArticles"]</p>
|
||||||
}
|
}
|
||||||
</div>
|
</ArticleTileArray>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Article> Articles { get; } = [];
|
private List<Article> Articles { get; } = [];
|
||||||
|
|
|
@ -45,11 +45,11 @@
|
||||||
<p>@Localizer["NoArticles_Message"]</p>
|
<p>@Localizer["NoArticles_Message"]</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-x-8 gap-y-4 mb-6">
|
<ArticleTileArray>
|
||||||
@foreach (var article in Articles.Skip(1)) {
|
@foreach (var article in Articles.Skip(1)) {
|
||||||
<ArticleTile Article="article" />
|
<ArticleTile Article="article" />
|
||||||
}
|
}
|
||||||
</div>
|
</ArticleTileArray>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (HasMore) {
|
@if (HasMore) {
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||||
@inject IStringLocalizer<Review> Localizer
|
@inject IStringLocalizer<Review> Localizer
|
||||||
|
|
||||||
<div class="flex gap-x-8 gap-y-4">
|
<ArticleTileArray>
|
||||||
@foreach (var article in Articles) {
|
@foreach (var article in Articles) {
|
||||||
<ArticleTile Article="article" />
|
<ArticleTile Article="article" />
|
||||||
}
|
}
|
||||||
@if(Articles.Count < 1) {
|
@if(Articles.Count < 1) {
|
||||||
<p>@Localizer["NoArticles"]</p>
|
<p>@Localizer["NoArticles"]</p>
|
||||||
}
|
}
|
||||||
</div>
|
</ArticleTileArray>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<Article> Articles { get; } = [];
|
private List<Article> Articles { get; } = [];
|
||||||
|
|
Loading…
Reference in a new issue