Initial TafsirQuran app with Gitea CI/CD deploy to k3s.
build-and-deploy / deploy (push) Successful in 10m50s
build-and-deploy / deploy (push) Successful in 10m50s
Blazor UI + ASP.NET API + Postgres; push to main builds images and rolls out namespace tafsirquran.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
@page "/"
|
||||
@inject TafsirApiClient Api
|
||||
|
||||
<section class="home">
|
||||
<h1 class="sr-only">تفسیر قرآن</h1>
|
||||
|
||||
@if (loading)
|
||||
{
|
||||
<p class="muted">در حال بارگذاری...</p>
|
||||
}
|
||||
else if (tafsirs.Count == 0)
|
||||
{
|
||||
<a class="tafsir-tile" href="/tafsir/ghatreh-chekani">
|
||||
<span class="tile-title">تفسیر قطره چکانی</span>
|
||||
<span class="tile-author">قرائتی</span>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="tile-grid">
|
||||
@foreach (var t in tafsirs)
|
||||
{
|
||||
<a class="tafsir-tile" href="@($"/tafsir/{t.Slug}")">
|
||||
<span class="tile-title">@t.Title</span>
|
||||
<span class="tile-author">@t.Author</span>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
|
||||
@code {
|
||||
private List<TafsirDto> tafsirs = [];
|
||||
private bool loading = true;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (!firstRender) return;
|
||||
try
|
||||
{
|
||||
tafsirs = (await Api.GetTafsirsAsync()).ToList();
|
||||
}
|
||||
catch
|
||||
{
|
||||
tafsirs = [];
|
||||
}
|
||||
finally
|
||||
{
|
||||
loading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user