mirror of
https://github.com/standardebooks/web.git
synced 2025-07-22 07:14:59 -04:00
Completely type hint template functions and switch to named arguments
This commit is contained in:
parent
6108b5e53d
commit
124e8343fc
125 changed files with 542 additions and 450 deletions
|
@ -35,12 +35,9 @@ catch(Exceptions\InvalidPermissionsException){
|
|||
}
|
||||
?>
|
||||
<?= Template::Header(
|
||||
[
|
||||
'title' => 'Edit Project for ' . $project->Ebook->Title,
|
||||
'css' => ['/css/project.css'],
|
||||
'highlight' => '',
|
||||
'description' => 'Edit the project for ' . $project->Ebook->Title
|
||||
]
|
||||
title: 'Edit Project for ' . $project->Ebook->Title,
|
||||
css: ['/css/project.css'],
|
||||
description: 'Edit the project for ' . $project->Ebook->Title
|
||||
) ?>
|
||||
<main>
|
||||
<section class="narrow">
|
||||
|
@ -51,11 +48,11 @@ catch(Exceptions\InvalidPermissionsException){
|
|||
|
||||
<h1>Edit Project</h1>
|
||||
|
||||
<?= Template::Error(['exception' => $exception]) ?>
|
||||
<?= Template::Error(exception: $exception) ?>
|
||||
|
||||
<form class="project-form" autocomplete="off" method="<?= Enums\HttpMethod::Post->value ?>" action="<?= $project->Url ?>">
|
||||
<input type="hidden" name="_method" value="<?= Enums\HttpMethod::Put->value ?>" />
|
||||
<?= Template::ProjectForm(['project' => $project, 'isEditForm' => true]) ?>
|
||||
<?= Template::ProjectForm(project: $project, isEditForm: true) ?>
|
||||
<div class="footer">
|
||||
<button>Save</button>
|
||||
</div>
|
||||
|
|
|
@ -40,11 +40,11 @@ catch(Exceptions\LoginRequiredException){
|
|||
catch(Exceptions\InvalidPermissionsException){
|
||||
Template::ExitWithCode(Enums\HttpCode::Forbidden);
|
||||
}
|
||||
?><?= Template::Header([
|
||||
'title' => 'Projects',
|
||||
'css' => ['/css/project.css'],
|
||||
'description' => 'Ebook projects currently underway at Standard Ebooks.'
|
||||
]) ?>
|
||||
?><?= Template::Header(
|
||||
title: 'Projects',
|
||||
css: ['/css/project.css'],
|
||||
description: 'Ebook projects currently underway at Standard Ebooks.'
|
||||
) ?>
|
||||
<main>
|
||||
<section>
|
||||
<h1>Projects</h1>
|
||||
|
@ -68,14 +68,14 @@ catch(Exceptions\InvalidPermissionsException){
|
|||
<? if(sizeof($inProgressProjects) == 0){ ?>
|
||||
<p class="empty-notice">None.</p>
|
||||
<? }else{ ?>
|
||||
<?= Template::ProjectsTable(['projects' => $inProgressProjects, 'includeStatus' => false]) ?>
|
||||
<?= Template::ProjectsTable(projects: $inProgressProjects, includeStatus: false) ?>
|
||||
<? } ?>
|
||||
</section>
|
||||
|
||||
<? if(sizeof($stalledProjects) > 0){ ?>
|
||||
<section id="stalled">
|
||||
<h2>Stalled projects</h2>
|
||||
<?= Template::ProjectsTable(['projects' => $stalledProjects, 'includeStatus' => false]) ?>
|
||||
<?= Template::ProjectsTable(projects: $stalledProjects, includeStatus: false) ?>
|
||||
</section>
|
||||
<? } ?>
|
||||
</section>
|
||||
|
|
|
@ -52,11 +52,11 @@ catch(Exceptions\LoginRequiredException){
|
|||
catch(Exceptions\InvalidPermissionsException){
|
||||
Template::ExitWithCode(Enums\HttpCode::Forbidden);
|
||||
}
|
||||
?><?= Template::Header([
|
||||
'title' => 'New Project',
|
||||
'css' => ['/css/project.css', '/css/ebook-placeholder.css'],
|
||||
'description' => 'Add a new ebook project.'
|
||||
]) ?>
|
||||
?><?= Template::Header(
|
||||
title: 'New Project',
|
||||
css: ['/css/project.css', '/css/ebook-placeholder.css'],
|
||||
description: 'Add a new ebook project.'
|
||||
) ?>
|
||||
<main>
|
||||
<section class="narrow">
|
||||
<? if(isset($project->Ebook)){ ?>
|
||||
|
@ -66,14 +66,14 @@ catch(Exceptions\InvalidPermissionsException){
|
|||
<? } ?>
|
||||
<h1>New Project</h1>
|
||||
|
||||
<?= Template::Error(['exception' => $exception]) ?>
|
||||
<?= Template::Error(exception: $exception) ?>
|
||||
|
||||
<form action="/projects" autocomplete="off" method="<?= Enums\HttpMethod::Post->value ?>" class="project-form">
|
||||
<?= Template::ProjectForm(['project' => $project]) ?>
|
||||
<?= Template::ProjectForm(project: $project) ?>
|
||||
<? if(!isset($project->EbookId)){ ?>
|
||||
<fieldset class="create-update-ebook-placeholder placeholder-form">
|
||||
<legend>Placeholder</legend>
|
||||
<?= Template::EbookPlaceholderForm(['ebook' => $project->Ebook ?? new Ebook(), 'showProjectForm' => false]) ?>
|
||||
<?= Template::EbookPlaceholderForm(ebook: $project->Ebook ?? new Ebook(), showProjectForm: false) ?>
|
||||
</fieldset>
|
||||
<? } ?>
|
||||
<div class="footer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue