diff --git a/themes/rule34v2/style.css b/themes/rule34v2/style.css index ce1481b5..84a8ebe3 100644 --- a/themes/rule34v2/style.css +++ b/themes/rule34v2/style.css @@ -243,6 +243,22 @@ SECTION>H3 { margin: auto; } +/* + * Image info - show both edit and view modes at the same time, + * except for Tags, Locked, and the Edit button. + */ +.image_info.infomode-view .edit, +.image_info.infomode-view .view { + display: block; +} +.image_info.infomode-view TR[data-row="Tags"] .view, +.image_info.infomode-view TR[data-row="Locked"] .view, +.image_info INPUT[type="button"][value="Edit"] { + display: none; +} + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * responsive overrides * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/themes/rule34v2/tag_edit.theme.php b/themes/rule34v2/tag_edit.theme.php deleted file mode 100644 index 858973ae..00000000 --- a/themes/rule34v2/tag_edit.theme.php +++ /dev/null @@ -1,79 +0,0 @@ - "text", - "name" => "tag_edit__tags", - "value" => $image->get_tag_list(), - "class" => "autocomplete_tags" - ]) - ); - } - - public function get_source_editor_html(Image $image): HTMLElement - { - global $user; - return SHM_POST_INFO( - A(["href" => make_link("source_history/{$image->id}")], rawHTML("Source Link")), - emptyHTML( - DIV( - ["style" => "overflow: hidden; white-space: nowrap; max-width: 350px; text-overflow: ellipsis;"], - $this->format_source($image->get_source()) - ), - $user->can(Permissions::EDIT_IMAGE_SOURCE) ? INPUT(["type" => "text", "name" => "tag_edit__source", "value" => $image->get_source()]) : null - ) - ); - } - - public function get_user_editor_html(Image $image): HTMLElement - { - global $user; - $owner = $image->get_owner()->name; - $date = rawHTML(autodate($image->posted)); - $ip = $user->can(Permissions::VIEW_IP) ? rawHTML(" (" . show_ip($image->owner_ip, "Post posted {$image->posted}") . ")") : ""; - $info = SHM_POST_INFO( - "Uploader", - emptyHTML( - A(["class" => "username", "href" => make_link("user/$owner")], $owner), - $ip, - ", ", - $date, - $user->can(Permissions::EDIT_IMAGE_OWNER) ? INPUT(["type" => "text", "name" => "tag_edit__owner", "value" => $owner]) : null - ), - ); - // SHM_POST_INFO returns a TR, let's sneakily append - // a TD with the avatar in it - $info->appendChild( - TD( - ["width" => "80px", "rowspan" => "4"], - rawHTML($image->get_owner()->get_avatar_html()) - ) - ); - return $info; - } - - public function get_lock_editor_html(Image $image): HTMLElement - { - global $user; - return SHM_POST_INFO( - "Locked", - $user->can(Permissions::EDIT_IMAGE_LOCK) ? - INPUT(["type" => "checkbox", "name" => "tag_edit__locked", "checked" => $image->is_locked()]) : - emptyHTML($image->is_locked() ? "Yes (Only admins may edit these details)" : "No") - ); - } -} diff --git a/themes/rule34v2/view.theme.php b/themes/rule34v2/view.theme.php deleted file mode 100644 index 01482187..00000000 --- a/themes/rule34v2/view.theme.php +++ /dev/null @@ -1,41 +0,0 @@ -is_locked() ? "[Post Locked]" : ""); - } - - if( - (!$image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK)) && - $user->can(Permissions::EDIT_IMAGE_TAG) - ) { - $editor_parts[] = TR(TD(["colspan" => 4], INPUT(["type" => "submit", "value" => "Set"]))); - } - - return SHM_SIMPLE_FORM( - "post/set", - INPUT(["type" => "hidden", "name" => "image_id", "value" => $image->id]), - TABLE( - [ - "class" => "image_info form", - "style" => "width: 500px; max-width: 100%;" - ], - ...$editor_parts, - ), - ); - } -}