diff --git a/ext/image/theme.php b/ext/image/theme.php index 3fceb2d7..8d5200fb 100644 --- a/ext/image/theme.php +++ b/ext/image/theme.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shimmie2; -use function MicroHTML\{INPUT, SPAN}; +use function MicroHTML\{INPUT, emptyHTML}; class ImageIOTheme extends Themelet { @@ -14,13 +14,11 @@ class ImageIOTheme extends Themelet */ public function get_deleter_html(int $image_id): \MicroHTML\HTMLElement { - return SPAN( - ["id"=>"image_delete_form"], - SHM_SIMPLE_FORM( - "image/delete", - INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]), - INPUT(["type" => 'submit', "value" => 'Delete', "onclick" => 'return confirm("Delete the image?");', "id" => "image_delete_button"]), - ) - ); + $form = SHM_FORM("image/delete", form_id: "image_delete_form"); + $form->appendChild(emptyHTML( + INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]), + INPUT(["type" => 'submit', "value" => 'Delete', "onclick" => 'return confirm("Delete the image?");', "id" => "image_delete_button"]), + )); + return $form; } } diff --git a/ext/report_image/style.css b/ext/report_image/style.css index 7fd0e56a..ad5f881c 100644 --- a/ext/report_image/style.css +++ b/ext/report_image/style.css @@ -3,3 +3,6 @@ overflow-wrap: break-word; word-wrap: break-word; } +#reportedimage .formstretch INPUT { + width: 100%; +} \ No newline at end of file diff --git a/ext/report_image/theme.php b/ext/report_image/theme.php index dfd07fbd..b8b17372 100644 --- a/ext/report_image/theme.php +++ b/ext/report_image/theme.php @@ -23,19 +23,19 @@ class ReportImageTheme extends Themelet $iabbe = send_event(new ImageAdminBlockBuildingEvent($image, $user, "report")); ksort($iabbe->parts); - $actions = join("
", $iabbe->parts); + $actions = join("", $iabbe->parts); $h_reportedimages .= " {$image_link} Report by $userlink: $h_reason - + ".make_form(make_link("image_report/remove"))." -
$actions + $actions "; diff --git a/ext/view/script.js b/ext/view/script.js index 9f0a1f45..0123b3eb 100644 --- a/ext/view/script.js +++ b/ext/view/script.js @@ -55,6 +55,6 @@ document.addEventListener('DOMContentLoaded', () => { updateAttr("LINK#nextlink", "href", query); updateAttr("A#prevlink", "href", query); updateAttr("A#nextlink", "href", query); - updateAttr("span#image_delete_form form", "action", query); + updateAttr("form#image_delete_form", "action", query); } }); diff --git a/ext/view/style.css b/ext/view/style.css index e12be22e..9ae4043b 100644 --- a/ext/view/style.css +++ b/ext/view/style.css @@ -21,3 +21,10 @@ TABLE.form.image_info { min-width: 100%; min-height: 3rem; } + +.post_controls FORM { + margin-bottom: 0.75em; +} +.post_controls FORM:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/ext/view/theme.php b/ext/view/theme.php index 30e24457..027902b5 100644 --- a/ext/view/theme.php +++ b/ext/view/theme.php @@ -47,7 +47,7 @@ class ViewPostTheme extends Themelet public function display_admin_block(Page $page, array $parts): void { if (count($parts) > 0) { - $page->add_block(new Block("Post Controls", DIV(["class"=>"post_controls"], joinHTML(BR(), $parts)), "left", 50)); + $page->add_block(new Block("Post Controls", DIV(["class"=>"post_controls"], joinHTML("", $parts)), "left", 50)); } }