From 52033320e1e1431b697845b103fc29f74c944158 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sun, 7 Jan 2024 14:23:34 -0600 Subject: [PATCH] Add submitter info to admin view of artworks --- lib/Artwork.php | 10 ++++++++++ templates/ArtworkDetail.php | 16 ++++++++++------ www/admin/artworks/get.php | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/Artwork.php b/lib/Artwork.php index 63bbc9c3..cb6efc63 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -20,6 +20,7 @@ use function Safe\sprintf; * @property string $Dimensions * @property Ebook $Ebook * @property Museum $Museum + * @property User $Submitter * @property ?ImageMimeType $MimeType */ class Artwork extends PropertiesBase{ @@ -52,6 +53,7 @@ class Artwork extends PropertiesBase{ protected $_Dimensions = null; protected $_Ebook = null; protected $_Museum = null; + protected $_Submitter = null; protected ?ImageMimeType $_MimeType = null; // ******* @@ -70,6 +72,14 @@ class Artwork extends PropertiesBase{ return $this->_UrlName; } + protected function GetSubmitter(): User{ + if($this->_Submitter === null){ + $this->_Submitter = User::Get($this->SubmitterUserId); + } + + return $this->_Submitter; + } + protected function GetUrl(): string{ if($this->_Url === null){ $this->_Url = '/artworks/' . $this->Artist->UrlName . '/' . $this->UrlName; diff --git a/templates/ArtworkDetail.php b/templates/ArtworkDetail.php index 4afe4efa..d19c9436 100644 --- a/templates/ArtworkDetail.php +++ b/templates/ArtworkDetail.php @@ -1,6 +1,6 @@ - - - +

Metadata

@@ -36,6 +34,10 @@ if($artwork === null){ + + + + @@ -44,10 +46,12 @@ if($artwork === null){ + - - + + +
Year completed CompletedYear === null){ ?>UnknownCompletedYearIsCirca){ ?>Circa CompletedYear ?>
Tags
Dimensions Dimensions ?>Status $artwork]) ?>
TagsSubmitted bySubmitterUserId === null){ ?>AnonymousSubmitter->Name !== null){ ?> Submitter->Name) ?>Submitter->Email) ?>

U.S. public domain proof

diff --git a/www/admin/artworks/get.php b/www/admin/artworks/get.php index e83bf9e1..798f88cc 100644 --- a/www/admin/artworks/get.php +++ b/www/admin/artworks/get.php @@ -29,7 +29,7 @@ catch(Exceptions\AppException){
$exception]) ?>
- $artwork, 'showCopyrightNotice' => false]) ?> + $artwork, 'isAdminView' => true]) ?> Status == COVER_ARTWORK_STATUS_DECLINED){ ?>

Status

This artwork has been declined by a reviewer.