diff --git a/www/css/core.css b/www/css/core.css index 4ce04fbf..dd7eb151 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -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], diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index bb357286..40640464 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -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){ + GitHubUrl !== null && $ebook->WikipediaUrl !== null){ ?>

More details

+ -
+ 0 || sizeof($scanSources) > 0 || sizeof($otherSources) > 0){ ?> +
+

Sources

+ 0){ ?> +
+

Transcriptions

+ +
+ + 0){ ?> +
+

Page scans

+ +
+ + 0){ ?> +
+

Other sources

+ +
+ +
+ + +

Improve this ebook

Anyone can contribute to make a Standard Ebook better for everyone!

To report typos, typography errors, or other corrections, see how to report errors.