mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Tweak donation banners and some type safety
This commit is contained in:
parent
c07b4cec1e
commit
0105bfefa4
3 changed files with 5 additions and 4 deletions
|
@ -63,7 +63,7 @@ if($donationDrive->IsStretchEnabled){
|
||||||
</header>
|
</header>
|
||||||
<? }else{ ?>
|
<? }else{ ?>
|
||||||
<header>
|
<header>
|
||||||
<p>Help us meet our stretch goal of<br/> <?= number_format($donationDrive->TargetDonationCount) ?> new patrons by <?= $deadline ?></p>
|
<p><? if($timeLeft->days <= 1){ ?><?= $timeString ?> left—<br/>Help us meet our stretch goal of<br/> <?= number_format($donationDrive->TargetDonationCount) ?> new patrons<? }else{ ?>Help us meet our stretch goal of<br/> <?= number_format($donationDrive->TargetDonationCount) ?> new patrons by <?= $deadline ?><? } ?></p>
|
||||||
</header>
|
</header>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<div class="progress"<? if($donationDrive->IsStretchEnabled){ ?> style="--stretch-starting-position: <?= $stretchStartingPosition ?>%; --stretch-base-counter-position: <?= $stretchStartingPosition - 1 ?>%"<? } ?>>
|
<div class="progress"<? if($donationDrive->IsStretchEnabled){ ?> style="--stretch-starting-position: <?= $stretchStartingPosition ?>%; --stretch-base-counter-position: <?= $stretchStartingPosition - 1 ?>%"<? } ?>>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?
|
||||||
|
use function Safe\preg_match;
|
||||||
use function Safe\preg_replace;
|
use function Safe\preg_replace;
|
||||||
|
|
||||||
$page = HttpInput::Int(GET, 'page') ?? 1;
|
$page = HttpInput::Int(GET, 'page') ?? 1;
|
||||||
|
|
|
@ -38,13 +38,13 @@ try{
|
||||||
catch(Exceptions\DuplicateEbookException $ex){
|
catch(Exceptions\DuplicateEbookException $ex){
|
||||||
// If the `Ebook` already exists, create the `Project` anyway.
|
// If the `Ebook` already exists, create the `Project` anyway.
|
||||||
$project->Ebook = Ebook::GetByIdentifier($project->Ebook->Identifier);
|
$project->Ebook = Ebook::GetByIdentifier($project->Ebook->Identifier);
|
||||||
if(!$project->Ebook->EbookPlaceholder?->IsInProgress){
|
if($project->Ebook->EbookPlaceholder !== null && !$project->Ebook->EbookPlaceholder->IsInProgress){
|
||||||
$project->EbookId = $project->Ebook->EbookId;
|
$project->EbookId = $project->Ebook->EbookId;
|
||||||
$_SESSION['is-only-ebook-project-created'] = true;
|
$_SESSION['is-only-ebook-project-created'] = true;
|
||||||
|
|
||||||
// Set the placeholder to in progress.
|
// Set the placeholder to in progress.
|
||||||
$project->Ebook->EbookPlaceholder?->IsInProgress = true;
|
$project->Ebook->EbookPlaceholder->IsInProgress = true;
|
||||||
$project->Ebook->EbookPlaceholder?->Save();
|
$project->Ebook->EbookPlaceholder->Save();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// `Ebook` exists and it's not a placeholder, so really fail.
|
// `Ebook` exists and it's not a placeholder, so really fail.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue