forked from standardebooks/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List artwork by artist via /artworks/<artist-name>
- Loading branch information
1 parent
780be15
commit cad2f5f
Showing
8 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<? | ||
$artistUrlName = ''; | ||
|
||
try{ | ||
$artistUrlName = trim(HttpInput::Str(GET, 'artist-url-name') ?? ''); | ||
|
||
if($artistUrlName == ''){ | ||
throw new Exceptions\ArtistNotFoundException(); | ||
} | ||
|
||
$artworks = Library::GetArtworkByArtist($artistUrlName); | ||
|
||
if(sizeof($artworks) == 0){ | ||
throw new Exceptions\ArtistNotFoundException(); | ||
} | ||
|
||
$artistName = $artworks[0]->Artist->Name; | ||
} | ||
catch(Exceptions\ArtistNotFoundException){ | ||
Template::Emit404(); | ||
} | ||
?><?= Template::Header(['title' => 'Artwork by ' . $artistName, 'artwork' => true]) ?> | ||
<main class="artworks"> | ||
<section class="narrow"> | ||
<h1>Artwork by <?= Formatter::EscapeHtml($artistName) ?></h1> | ||
|
||
<?= Template::ImageCopyrightNotice() ?> | ||
|
||
<?= Template::ArtworkList(['artworks' => $artworks]) ?> | ||
</section> | ||
</main> | ||
<?= Template::Footer() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters