mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 14:55:13 -04:00
Add projects index page, and more detail on placeholder pages
This commit is contained in:
parent
fe5bb8ed48
commit
c7a4e34e31
15 changed files with 211 additions and 59 deletions
39
www/projects/index.php
Normal file
39
www/projects/index.php
Normal 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() ?>
|
Loading…
Add table
Add a link
Reference in a new issue