mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 10:02:02 -04:00
On ebook detail page, split 'more details' section into 'more details' and 'sources'
This commit is contained in:
parent
5ed51b0dbb
commit
ed4ef9c646
2 changed files with 100 additions and 22 deletions
|
@ -835,13 +835,15 @@ article.ebook > header img{
|
|||
max-width: 100%;
|
||||
}
|
||||
|
||||
article.ebook section#details ul{
|
||||
article.ebook section#details ul,
|
||||
article.ebook section#sources ul{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-gap: 1rem;
|
||||
}
|
||||
|
||||
article.ebook section#details ul li{
|
||||
article.ebook section#details ul li,
|
||||
article.ebook section#sources ul li{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
@ -878,14 +880,16 @@ article.ebook section ul li a[class]{
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
article.ebook section#details ul li a[class]{
|
||||
article.ebook section#details ul li a[class],
|
||||
article.ebook section#sources ul li a[class]{
|
||||
display: inline-flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
article.ebook section#read-online a::before,
|
||||
article.ebook section#download ul li a[class]::before,
|
||||
article.ebook section#details ul li a[class]::before{
|
||||
article.ebook section#details ul li a[class]::before,
|
||||
article.ebook section#sources ul li a[class]::before{
|
||||
display: inline-block;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
|
@ -900,7 +904,8 @@ article.ebook section#details ul li a[class]::before{
|
|||
|
||||
article.ebook section#read-online a:hover::before,
|
||||
article.ebook section#download ul li a[class]:hover::before,
|
||||
article.ebook section#details ul li a[class]:hover::before{
|
||||
article.ebook section#details ul li a[class]:hover::before,
|
||||
article.ebook section#sources ul li a[class]:hover::before{
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
|
@ -1997,6 +2002,10 @@ article.ebook section aside.donation p::after{
|
|||
display: none;
|
||||
}
|
||||
|
||||
article.ebook h2 + section > h3:first-of-type{
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.acroynm{
|
||||
font-variant: all-small-caps;
|
||||
}
|
||||
|
@ -2751,7 +2760,8 @@ aside button.close:active{
|
|||
font-size: 2.4rem;
|
||||
}
|
||||
|
||||
article.ebook section#details ul{
|
||||
article.ebook section#details ul,
|
||||
article.ebook section#sources ul{
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
|
@ -3109,6 +3119,7 @@ aside button.close:active{
|
|||
article.ebook section#read-online a::before,
|
||||
article.ebook section#download ul li a[class]::before,
|
||||
article.ebook section#details ul li a[class]::before,
|
||||
article.ebook section#sources ul li a[class]::before,
|
||||
article.ebook #more-ebooks img,
|
||||
article.ebook #more-ebooks a:active img,
|
||||
main.ebooks > ol a[tabindex],
|
||||
|
|
|
@ -41,6 +41,32 @@ try{
|
|||
$ebook = new Ebook($wwwFilesystemPath);
|
||||
}
|
||||
|
||||
// Divide our sources into transcriptions and scans
|
||||
$transcriptionSources = [];
|
||||
$scanSources = [];
|
||||
$otherSources = [];
|
||||
foreach($ebook->Sources as $source){
|
||||
switch($source->Type){
|
||||
case SOURCE_PROJECT_GUTENBERG:
|
||||
case SOURCE_PROJECT_GUTENBERG_AUSTRALIA:
|
||||
case SOURCE_PROJECT_GUTENBERG_CANADA:
|
||||
case SOURCE_WIKISOURCE:
|
||||
case SOURCE_FADED_PAGE:
|
||||
$transcriptionSources[] = $source;
|
||||
break;
|
||||
|
||||
case SOURCE_INTERNET_ARCHIVE:
|
||||
case SOURCE_HATHI_TRUST:
|
||||
case SOURCE_GOOGLE_BOOKS:
|
||||
$scanSources[] = $source;
|
||||
break;
|
||||
|
||||
case SOURCE_OTHER:
|
||||
$otherSources[] = $source;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the bottom carousel.
|
||||
// Pick a random tag from this ebook, and get ebooks in the same tag
|
||||
$carousel = [];
|
||||
|
@ -284,6 +310,7 @@ catch(Exceptions\InvalidEbookException $ex){
|
|||
<? } ?>
|
||||
</section>
|
||||
|
||||
<? if($ebook->GitHubUrl !== null && $ebook->WikipediaUrl !== null){ ?>
|
||||
<section id="details">
|
||||
<h2>More details</h2>
|
||||
<ul>
|
||||
|
@ -297,25 +324,65 @@ catch(Exceptions\InvalidEbookException $ex){
|
|||
<p><a href="<?= Formatter::ToPlainText($ebook->WikipediaUrl) ?>" class="wikipedia">This book at Wikipedia</a></p>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? foreach($ebook->Sources as $source){ ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
|
||||
<? if(sizeof($transcriptionSources) > 0 || sizeof($scanSources) > 0 || sizeof($otherSources) > 0){ ?>
|
||||
<section id="sources">
|
||||
<h2>Sources</h2>
|
||||
<? if(sizeof($transcriptionSources) > 0){ ?>
|
||||
<section id="transcriptions">
|
||||
<h3>Transcriptions</h3>
|
||||
<ul>
|
||||
<? foreach($transcriptionSources as $source){ ?>
|
||||
<li>
|
||||
<p>
|
||||
<? if($source->Type == SOURCE_PROJECT_GUTENBERG){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="project-gutenberg">Transcription at Project Gutenberg</a><? } ?>
|
||||
<? if($source->Type == SOURCE_PROJECT_GUTENBERG_AUSTRALIA){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="project-gutenberg">Transcription at Project Gutenberg Australia</a><? } ?>
|
||||
<? if($source->Type == SOURCE_PROJECT_GUTENBERG_CANADA){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="project-gutenberg">Transcription at Project Gutenberg Canada</a><? } ?>
|
||||
<? if($source->Type == SOURCE_WIKISOURCE){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="wikisource">Transcription at Wikisource</a><? } ?>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
<? if(sizeof($scanSources) > 0){ ?>
|
||||
<section id="page-scans">
|
||||
<h3>Page scans</h3>
|
||||
<ul>
|
||||
<? foreach($scanSources as $source){ ?>
|
||||
<li>
|
||||
<p>
|
||||
<? if($source->Type == SOURCE_INTERNET_ARCHIVE){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="internet-archive">Page scans at the Internet Archive</a><? } ?>
|
||||
<? if($source->Type == SOURCE_HATHI_TRUST){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="hathitrust">Page scans at HathiTrust</a><? } ?>
|
||||
<? if($source->Type == SOURCE_GOOGLE_BOOKS){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="google">Page scans at Google Books</a><? } ?>
|
||||
<? if($source->Type == SOURCE_FADED_PAGE){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="globe">Transcription at Faded Page</a><? } ?>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
<? if(sizeof($otherSources) > 0){ ?>
|
||||
<section id="other-sources">
|
||||
<h3>Other sources</h3>
|
||||
<ul>
|
||||
<? foreach($otherSources as $source){ ?>
|
||||
<li>
|
||||
<p>
|
||||
<? if($source->Type == SOURCE_OTHER){ ?><a href="<?= Formatter::ToPlainText($source->Url) ?>" class="globe"><?= Formatter::ToPlainText(preg_replace(['|https?://(en\.)?|', '|/.+$|'], '', (string)$source->Url) ?? '') /* force type to (string) to satisfy PHPStan */ ?></a><? } ?>
|
||||
</p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
</section>
|
||||
<? } ?>
|
||||
|
||||
<section id="improve">
|
||||
<section id="improve-this-ebook">
|
||||
<h2>Improve this ebook</h2>
|
||||
<p>Anyone can contribute to make a Standard Ebook better for everyone!</p>
|
||||
<p>To report typos, typography errors, or other corrections, see <a href="/contribute/report-errors">how to report errors</a>.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue