Add wrapping <div> around authors in list view, to correctly align with CSS grid

This commit is contained in:
Alex Cabal 2020-12-17 13:55:49 -06:00
parent 06f55d5af9
commit 9de1a41f91

View file

@ -1,4 +1,9 @@
<? <?
if($view == ''){
$view = VIEW_GRID;
}
if(!isset($ebooks)){ if(!isset($ebooks)){
$ebooks = []; $ebooks = [];
} }
@ -14,13 +19,21 @@ if(!isset($ebooks)){
</picture> </picture>
</a> </a>
<p><a href="<?= $ebook->Url ?>"><?= Formatter::ToPlainText($ebook->Title) ?></a></p> <p><a href="<?= $ebook->Url ?>"><?= Formatter::ToPlainText($ebook->Title) ?></a></p>
<? if($view == VIEW_GRID){ ?>
<? foreach($ebook->Authors as $author){ ?> <? foreach($ebook->Authors as $author){ ?>
<p class="author"><? if($author->Name != 'Anonymous'){ ?><a href="<?= Formatter::ToPlainText($ebook->AuthorsUrl) ?>"><?= Formatter::ToPlainText($author->Name) ?></a><? } ?></p> <p class="author"><? if($author->Name != 'Anonymous'){ ?><a href="<?= Formatter::ToPlainText($ebook->AuthorsUrl) ?>"><?= Formatter::ToPlainText($author->Name) ?></a><? } ?></p>
<? } ?> <? } ?>
<? if($view == VIEW_LIST){ ?> <? }else{ ?>
<div>
<? foreach($ebook->Authors as $author){ ?>
<p class="author"><? if($author->Name != 'Anonymous'){ ?><a href="<?= Formatter::ToPlainText($ebook->AuthorsUrl) ?>"><?= Formatter::ToPlainText($author->Name) ?></a><? } ?></p>
<? } ?>
</div>
<div class="details"> <div class="details">
<? if($ebook->ContributorsHtml !== null){ ?> <? if($ebook->ContributorsHtml !== null){ ?>
<p><?= rtrim($ebook->ContributorsHtml, '.') ?></p> <div>
<p><?= rtrim($ebook->ContributorsHtml, '.') ?></p>
</div>
<? } ?> <? } ?>
<p><?= number_format($ebook->WordCount) ?> words • <?= $ebook->ReadingEase ?> reading ease</p> <p><?= number_format($ebook->WordCount) ?> words • <?= $ebook->ReadingEase ?> reading ease</p>
<ul class="tags"><? foreach($ebook->Tags as $tag){ ?><li><a href="<?= $tag->Url ?>"><?= Formatter::ToPlainText($tag->Name) ?></a></li><? } ?></ul> <ul class="tags"><? foreach($ebook->Tags as $tag){ ?><li><a href="<?= $tag->Url ?>"><?= Formatter::ToPlainText($tag->Name) ?></a></li><? } ?></ul>