Basic Home functionality complete

This commit is contained in:
Kira 2023-09-05 11:01:20 -07:00
parent 44429629a0
commit db58816899
15 changed files with 49 additions and 3 deletions

View File

@ -6,4 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\images\" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,49 @@
@page "/"
@using Blazor_DotNet8_MovieApp.Models;
@using Blazor_DotNet8_MovieApp.Services;
<PageTitle>Home</PageTitle>
@inject IMovieReviewService MovieReviewService
<h1>Home</h1>
<PageTitle>Movies in DotNet8</PageTitle>
Welcome to your new app.
@if(Movies is null)
{
<h1>Loading Movies...</h1>
}
else
{
@for (int i = 0; i <= Movies.Count / 4; i++)
{
MovieModel[] movieGroup = Movies.Skip(i * 4).Take(4).ToArray();
<div class="row">
@foreach(MovieModel movie in movieGroup)
{
<div class="col-md-3 mb-2">
<a href="/MovieReview/@movie?.Id">
<img class="img-thumbnail" src="@movie?.ImageUrl">
<div class="card-body">
<h5 class="card-title">
@movie?.Title
</h5>
<p class="card-text">
@movie?.Description
</p>
</div>
</a>
</div>
}
</div>
}
}
@code {
List<MovieModel> Movies = null;
protected override async Task OnInitializedAsync()
{
Movies = MovieReviewService?.GetMovies();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB