diff --git a/lib/Ebook.php b/lib/Ebook.php index 3d0d4f7c..c4f9ee54 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -2420,4 +2420,21 @@ final class Ebook{ return ['ebooks' => $ebooks, 'ebooksCount' => $ebooksCount]; } + + /** + * Queries for `Ebook`s on the wanted list for a given `EbookPlaceholderDifficulty`. + * + * @return array + */ + public static function GetWantedByDifficulty(Enums\EbookPlaceholderDifficulty $difficulty): array{ + return Db::Query(' + SELECT Ebooks.* + from Ebooks inner join EbookPlaceholders using (EbookId) + where EbookPlaceholders.IsWanted = true and + EbookPlaceholders.IsInProgress = false and + EbookPlaceholders.Difficulty = ? + order by Ebooks.Updated desc + ', [$difficulty], Ebook::class); + + } } diff --git a/templates/WantedEbooks.php b/templates/WantedEbooks.php new file mode 100644 index 00000000..973fed1b --- /dev/null +++ b/templates/WantedEbooks.php @@ -0,0 +1,26 @@ + + diff --git a/www/contribute/wanted-ebooks.php b/www/contribute/wanted-ebooks.php index a30ce6d4..1c8e260b 100644 --- a/www/contribute/wanted-ebooks.php +++ b/www/contribute/wanted-ebooks.php @@ -11,467 +11,11 @@

For your first production

If nothing on the list below interests you, you can pitch us something else you’d like to work on.

First productions should be on the shorter side (less than 100,000 words maximum) and without too many complex formatting issues like illustrations, significant endnotes, letters, poems, etc. Most short plain fiction novels fall in this category.

- + Enums\EbookPlaceholderDifficulty::Beginner, 'showPlaceholderMetadata' => Session::$User?->Benefits->CanEditEbookPlaceholders]) ?>

Moderate-difficulty productions

- + Enums\EbookPlaceholderDifficulty::Intermediate, 'showPlaceholderMetadata' => Session::$User?->Benefits->CanEditEbookPlaceholders]) ?>

Advanced productions

- + Enums\EbookPlaceholderDifficulty::Advanced, 'showPlaceholderMetadata' => Session::$User?->Benefits->CanEditEbookPlaceholders]) ?>

Jules Verne

Verne has a complex publication and translation history. Please review these notes before starting any Verne books.