mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 06:45:14 -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
|
@ -4,7 +4,7 @@
|
|||
* @var array<stdClass> $collections
|
||||
*/
|
||||
?>
|
||||
<table class="download-list">
|
||||
<table class="data-table bulk-downloads-table">
|
||||
<caption aria-hidden="hidden">Scroll right →</caption>
|
||||
<thead>
|
||||
<tr class="mid-header">
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
<td>Ebook ID:</td>
|
||||
<td><?= $ebook->EbookId ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Identifier:</td>
|
||||
<td><?= Formatter::EscapeHtml($ebook->Identifier) ?></td>
|
||||
</tr>
|
||||
<? if($ebook->IsPlaceholder() && $ebook->EbookPlaceholder !== null){ ?>
|
||||
<tr>
|
||||
<td>Is wanted:</td>
|
||||
|
@ -27,24 +23,13 @@
|
|||
<? } ?>
|
||||
<tr>
|
||||
<td>Difficulty:</td>
|
||||
<td><?= ucfirst($ebook->EbookPlaceholder->Difficulty->value) ?></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<? if(sizeof($ebook->Projects) > 0){ ?>
|
||||
<tr>
|
||||
<td>Projects:</td>
|
||||
<td>
|
||||
<ul>
|
||||
<? foreach($ebook->Projects as $project){ ?>
|
||||
<li>
|
||||
<p>
|
||||
<?= $project->Started->format(Enums\DateTimeFormat::FullDateTime->value) ?> — <?= $project->Status->GetDisplayName() ?> — <? if($project->ProducerEmail !== null){ ?><a href="mailto:<?= Formatter::EscapeHtml($project->ProducerEmail) ?>"><?= Formatter::EscapeHtml($project->ProducerName) ?></a><? }else{ ?><?= Formatter::EscapeHtml($project->ProducerName) ?><? } ?> — <a href="<?= $project->Url ?>">Link</a>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</td>
|
||||
<td><?= ucfirst($ebook->EbookPlaceholder->Difficulty->value ?? '') ?></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<? if(sizeof($ebook->Projects) > 0){ ?>
|
||||
<h2>Projects</h2>
|
||||
<?= Template::ProjectsTable(['projects' => $ebook->Projects, 'includeTitle' => false]) ?>
|
||||
<? } ?>
|
||||
|
|
48
templates/ProjectsTable.php
Normal file
48
templates/ProjectsTable.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?
|
||||
/**
|
||||
* @var array<Project> $projects
|
||||
*/
|
||||
|
||||
$includeTitle = $includeTitle ?? true;
|
||||
?>
|
||||
<table class="data-table">
|
||||
<caption aria-hidden="hidden">Scroll right →</caption>
|
||||
<thead>
|
||||
<tr class="mid-header">
|
||||
<? if($includeTitle){ ?>
|
||||
<th scope="col">Title</th>
|
||||
<? } ?>
|
||||
<th scope="col">Started</th>
|
||||
<th scope="col">Producer</th>
|
||||
<th scope="col">Status</th>
|
||||
<th/>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? foreach($projects as $project){ ?>
|
||||
<tr>
|
||||
<? if($includeTitle){ ?>
|
||||
<td class="row-header">
|
||||
<a href="<?= $project->Ebook->Url ?>"><?= Formatter::EscapeHtml($project->Ebook->Title) ?></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td>
|
||||
<?= $project->Started->format(Enums\DateTimeFormat::ShortDate->value) ?>
|
||||
</td>
|
||||
<td class="producer">
|
||||
<? if($project->ProducerEmail !== null){ ?>
|
||||
<a href="mailto:<?= Formatter::EscapeHtml($project->ProducerEmail) ?>"><?= Formatter::EscapeHtml($project->ProducerName) ?></a>
|
||||
<? }else{ ?>
|
||||
<?= Formatter::EscapeHtml($project->ProducerName) ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td class="status">
|
||||
<?= ucfirst($project->Status->GetDisplayName()) ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= Formatter::EscapeHtml($project->VcsUrl) ?>">GitHub repo</a>
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue