diff --git a/templates/ArtworkCreateEditFields.php b/templates/ArtworkCreateEditFields.php
new file mode 100644
index 00000000..9c0de8c0
--- /dev/null
+++ b/templates/ArtworkCreateEditFields.php
@@ -0,0 +1,202 @@
+
+use Safe\DateTime;
+
+$artwork = $artwork ?? null;
+$imageRequired = $imageRequired ?? true;
+$isAdminView = $isAdminView ?? false;
+
+$now = new DateTime('now', new DateTimeZone('America/Juneau')); // Latest continental US time zone
+?>
+
+
+
+
+ See the US-PD clearance section of the SEMoS for details on this section.
+ PD proof must take the form of either:
+
+
+
+ or proof that the artwork was reproduced in a book published before = PD_STRING ?>, including the following:
+
+
+
+
+
+
+
+ or a reason for a special exception:
+
+
+
+
+
+
+
+
+ if($isAdminView){ ?>
+
+
+ if($GLOBALS['User']->Benefits->CanReviewOwnArtwork){ ?>
+
+ } ?>
+
+
+ } ?>
+
diff --git a/www/artworks/edit.php b/www/artworks/edit.php
new file mode 100644
index 00000000..7b1f3d70
--- /dev/null
+++ b/www/artworks/edit.php
@@ -0,0 +1,73 @@
+
+use function Safe\session_unset;
+
+session_start();
+
+$exception = $_SESSION['exception'] ?? null;
+
+try{
+ $artwork = Artwork::GetByUrl(HttpInput::Str(GET, 'artist-url-name') ?? '', HttpInput::Str(GET, 'artwork-url-name') ?? '');
+
+ if($GLOBALS['User'] === null){
+ throw new Exceptions\LoginRequiredException();
+ }
+
+ $isEditingAllowed = ($artwork->Status == ArtworkStatus::Unverified) && ($GLOBALS['User']->Benefits->CanReviewArtwork || ($artwork->SubmitterUserId == $GLOBALS['User']->UserId));
+ if(!$isEditingAllowed){
+ throw new Exceptions\InvalidPermissionsException();
+ }
+
+ $isAdminView = $GLOBALS['User']->Benefits->CanReviewArtwork ?? false;
+
+ // We got here because an artwork update had errors and the user has to try again
+ if($exception){
+ http_response_code(422);
+ session_unset();
+ }
+}
+catch(Exceptions\ArtworkNotFoundException){
+ Template::Emit404();
+}
+catch(Exceptions\LoginRequiredException){
+ Template::RedirectToLogin();
+}
+catch(Exceptions\InvalidPermissionsException){
+ Template::Emit403(); // No permissions to submit artwork
+}
+
+?>
+= Template::Header(
+ [
+ 'title' => 'Edit Artwork',
+ 'artwork' => true,
+ 'highlight' => '',
+ 'description' => 'Edit public domain artwork to the database for use as cover art.'
+ ]
+) ?>
+
+
+ Edit Artwork
+
+ = Template::Error(['exception' => $exception]) ?>
+
+
+
+
+
+
+
+
+
+
+
+= Template::Footer() ?>
diff --git a/www/artworks/get.php b/www/artworks/get.php
index bf5395e1..d8479d83 100644
--- a/www/artworks/get.php
+++ b/www/artworks/get.php
@@ -12,8 +12,8 @@ try{
$userId = $GLOBALS['User']->UserId ?? null;
$isEditingAllowed = ($artwork->Status == ArtworkStatus::Unverified) && ($isAdminView || ($userId !== null && $userId == $artwork->SubmitterUserId));
- // If the artwork is not approved, and we're not an admin, don't show it.
- if($artwork->Status != ArtworkStatus::Approved && $artwork->Status != ArtworkStatus::InUse && !$isAdminView){
+ // If the artwork is not approved, and we're not an admin or the submitter when they can edit, don't show it.
+ if($artwork->Status != ArtworkStatus::Approved && $artwork->Status != ArtworkStatus::InUse && !$isAdminView && !$isEditingAllowed){
throw new Exceptions\ArtworkNotFoundException();
}
diff --git a/www/artworks/new.php b/www/artworks/new.php
index 4b1990cd..21250f44 100644
--- a/www/artworks/new.php
+++ b/www/artworks/new.php
@@ -1,5 +1,4 @@
-use Safe\DateTime;
use function Safe\session_unset;
session_start();
@@ -8,7 +7,6 @@ $created = HttpInput::Bool(SESSION, 'artwork-created', false);
$exception = $_SESSION['exception'] ?? null;
/** @var Artwork $artwork */
$artwork = $_SESSION['artwork'] ?? null;
-$now = new DateTime('now', new DateTimeZone('America/Juneau')); // Latest continental US time zone
try{
if($GLOBALS['User'] === null){
@@ -70,199 +68,13 @@ catch(Exceptions\InvalidPermissionsException){
} ?>