oliverbooth.dev/OliverBooth/Pages/Projects/Index.cshtml

81 lines
4.0 KiB
Plaintext
Raw Normal View History

2023-08-06 02:29:10 +01:00
@page
2023-09-24 14:36:36 +01:00
@using OliverBooth.Data.Web
@using OliverBooth.Services
@inject IProjectService ProjectService
2023-08-06 02:29:10 +01:00
@{
ViewData["Title"] = "Projects";
IEnumerable<IProject> projects = ProjectService.GetProjects(ProjectStatus.Ongoing).OrderBy(p => p.Rank)
.Concat(ProjectService.GetProjects(ProjectStatus.Past).OrderBy(p => p.Rank))
.Concat(ProjectService.GetProjects(ProjectStatus.Retired).OrderBy(p => p.Rank))
.Concat(ProjectService.GetProjects(ProjectStatus.Hiatus).OrderBy(p => p.Rank));
2023-08-06 02:29:10 +01:00
}
<main class="container">
<h1 class="display-4">Projects</h1>
@foreach (IProject[] chunk in projects.Chunk(2))
{
<div class="card-group row" style="margin-top: 20px;">
@foreach (IProject project in chunk)
{
<div class="col-xs-1 col-md-6 col-lg-6 d-flex align-items-stretch">
@switch (project.Status)
{
case ProjectStatus.Ongoing:
<div class="project-card">
2023-12-26 15:35:27 +00:00
<div class="project-image">
<a asp-page="Project" asp-route-slug="@project.Slug">
<img src="https://cdn.olivr.me/projects/hero/@project.HeroUrl" class="card-img-top" alt="@project.Name">
</a>
<a asp-page="Project" asp-route-slug="@project.Slug">
2023-12-26 15:35:27 +00:00
<p class="project-title">@project.Name</p>
</a>
</div>
</div>
break;
2023-08-06 02:29:10 +01:00
case ProjectStatus.Past:
<div class="border-info project-card">
2023-12-26 15:35:27 +00:00
<div class="project-image">
<a asp-page="Project" asp-route-slug="@project.Slug">
<img src="https://cdn.olivr.me/projects/hero/@project.HeroUrl" class="card-img-top" alt="@project.Name">
</a>
<a asp-page="Project" asp-route-slug="@project.Slug">
2023-12-26 15:35:27 +00:00
<p class="project-title">@project.Name</p>
</a>
</div>
</div>
break;
2023-08-06 02:29:10 +01:00
2023-12-26 20:55:32 +00:00
case ProjectStatus.Retired:
<div class="border-danger project-card">
2023-12-26 15:35:27 +00:00
<div class="project-image">
<a asp-page="Project" asp-route-slug="@project.Slug">
<img src="https://cdn.olivr.me/projects/hero/@project.HeroUrl" class="card-img-top" alt="@project.Name">
</a>
<a asp-page="Project" asp-route-slug="@project.Slug">
2023-12-26 15:35:27 +00:00
<p class="project-title">@project.Name</p>
</a>
</div>
</div>
break;
2023-12-26 20:55:32 +00:00
case ProjectStatus.Hiatus:
<div class="border-warning project-card">
<div class="project-image">
<a asp-page="Project" asp-route-slug="@project.Slug">
<img src="https://cdn.olivr.me/projects/hero/@project.HeroUrl" class="card-img-top" alt="@project.Name">
</a>
<a asp-page="Project" asp-route-slug="@project.Slug">
<p class="project-title">@project.Name</p>
</a>
</div>
</div>
break;
}
2023-09-24 14:36:36 +01:00
</div>
}
</div>
}
</main>