Refactoring, database structure changed
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
@using Blazorise.Extensions
|
||||
@using WatchIt.Website.Components.Subcomponents.Common
|
||||
|
||||
@inherits Component
|
||||
|
||||
@typeparam TItem
|
||||
@typeparam TQuery where TQuery : WatchIt.DTO.Query.IFilterQuery
|
||||
|
||||
|
||||
|
||||
<div class="panel">
|
||||
<div class="container-grid">
|
||||
<div class="row mb-4">
|
||||
<div class="col">
|
||||
<h4 class="m-0"><strong>@(Title)</strong></h4>
|
||||
</div>
|
||||
</div>
|
||||
@if (_loaded)
|
||||
{
|
||||
if (!_items.IsNullOrEmpty())
|
||||
{
|
||||
for (int i = 0; i < _items.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@{
|
||||
int iCopy = i;
|
||||
TItem item = _items[iCopy];
|
||||
string url = string.Format(UrlIdTemplate, IdFunc(item));
|
||||
}
|
||||
<VerticalListItem Name="@(NameFunc(item))"
|
||||
AdditionalInfo="@(AdditionalNameInfoFunc(item))"
|
||||
PicturePlaceholder="@(PicturePlaceholder)"
|
||||
PictureFunc="@(() => PictureFunc(item))"
|
||||
GlobalRating="@(GlobalRatingFunc(item))"
|
||||
SecondaryRatingTitle="@(SecondaryRatingTitle)"
|
||||
GetGlobalRatingMethod="@(() => GetGlobalRatingMethod(item))"
|
||||
GetSecondaryRatingMethod="@(() => GetSecondaryRatingMethod(item))"
|
||||
GetYourRatingMethod="@(GetYourRatingMethod is not null ? async userId => (int?)(await GetYourRatingMethod(item, userId))?.Rating : null)"
|
||||
PutYourRatingMethod="@(PutYourRatingMethod is not null ? request => PutYourRatingMethod(item, request) : null)"
|
||||
DeleteYourRatingMethod="@(DeleteYourRatingMethod is not null ? () => DeleteYourRatingMethod(item) : null)"
|
||||
ItemUrl="@(url)"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
if (!_allItemsLoaded)
|
||||
{
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-center">
|
||||
<button class="btn btn-secondary" @onclick="DownloadItems">
|
||||
@if (!_itemsLoading)
|
||||
{
|
||||
<span>Load more</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
<span>Loading...</span>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-center">
|
||||
No items found
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<Loading Color="@(Loading.Colors.Light)"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user