Add projects index page, and more detail on placeholder pages

This commit is contained in:
Alex Cabal 2024-12-14 21:08:45 -06:00
parent fe5bb8ed48
commit c7a4e34e31
15 changed files with 211 additions and 59 deletions

39
www/projects/index.php Normal file
View file

@ -0,0 +1,39 @@
<?
try{
if(Session::$User === null){
throw new Exceptions\LoginRequiredException();
}
if(!Session::$User->Benefits->CanEditProjects){
throw new Exceptions\InvalidPermissionsException();
}
$inProgressProjects = Project::GetAllByStatus(Enums\ProjectStatusType::InProgress);
$stalledProjects = Project::GetAllByStatus(Enums\ProjectStatusType::Stalled);
}
catch(Exceptions\LoginRequiredException){
Template::RedirectToLogin();
}
catch(Exceptions\InvalidPermissionsException){
Template::Emit403();
}
?><?= Template::Header(['title' => 'Projects', 'css' => ['/css/project.css'], 'description' => 'Ebook projects currently underway at Standard Ebooks.']) ?>
<main>
<section class="narrow">
<h1>Projects</h1>
<h2>Active projects</h2>
<? if(sizeof($inProgressProjects) == 0){ ?>
<p>
<i>None.</i>
</p>
<? }else{ ?>
<?= Template::ProjectsTable(['projects' => $inProgressProjects]) ?>
<? } ?>
<? if(sizeof($stalledProjects) > 0){ ?>
<h2>Stalled projects</h2>
<?= Template::ProjectsTable(['projects' => $stalledProjects]) ?>
<? } ?>
</section>
</main>
<?= Template::Footer() ?>