From e564646dd8e7d2babdb7089ae83d9dac13f30bfd Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 8 Jan 2024 20:41:03 +0000 Subject: [PATCH] [upload] upload form is a form --- ext/static_files/style.css | 6 ++++-- ext/upload/style.css | 5 ++--- ext/upload/theme.php | 21 ++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ext/static_files/style.css b/ext/static_files/style.css index 03f45fc3..5baed929 100644 --- a/ext/static_files/style.css +++ b/ext/static_files/style.css @@ -13,8 +13,10 @@ TD>BUTTON, TD>SPAN>BUTTON {width: 100%;} TABLE.form {width: 300px;} TABLE.form TD, TABLE.form TH {vertical-align: middle;} -TABLE.form TBODY TD {text-align: left;} -TABLE.form TBODY TH {text-align: right; padding-right: 4px; width: 1%; white-space: nowrap;} +TABLE.form TBODY TR TD {text-align: left;} +TABLE.form TBODY TR TH {text-align: right; padding-right: 4px; width: 1%; white-space: nowrap;} +TABLE.form TBODY TR.header TD, +TABLE.form TBODY TR.header TH {text-align: center; width: auto;} TABLE.form TD + TH {padding-left: 8px;} *[onclick], diff --git a/ext/upload/style.css b/ext/upload/style.css index 6dd19550..6c882118 100644 --- a/ext/upload/style.css +++ b/ext/upload/style.css @@ -1,6 +1,5 @@ -#large_upload_form TD, -#large_upload_form TH { - vertical-align: middle; +TABLE#large_upload_form.form { + width: 100%; } .mini_upload INPUT { diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 5e85ee70..0b40670e 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -6,9 +6,7 @@ namespace Shimmie2; use MicroHTML\HTMLElement; -use function MicroHTML\TABLE; -use function MicroHTML\TR; -use function MicroHTML\TD; +use function MicroHTML\{TABLE,TR,TH,TD}; use function MicroHTML\SMALL; use function MicroHTML\rawHTML; use function MicroHTML\INPUT; @@ -49,13 +47,13 @@ class UploadTheme extends Themelet $form = SHM_FORM("upload", "POST", true, "file_upload"); $form->appendChild( TABLE( - ["id" => "large_upload_form"], + ["id" => "large_upload_form", "class"=>"form"], TR( - TD(["width" => "20"], rawHTML("Common Tags")), + TH(["width" => "20"], "Common Tags"), TD(["colspan" => "6"], INPUT(["name" => "tags", "type" => "text", "placeholder" => "tagme", "class" => "autocomplete_tags"])) ), TR( - TD(["width" => "20"], rawHTML("Common Source")), + TH(["width" => "20"], "Common Source"), TD(["colspan" => "6"], INPUT(["name" => "source", "type" => "text", "placeholder" => "https://..."])) ), $upload_list, @@ -100,10 +98,11 @@ class UploadTheme extends Themelet $upload_list->appendChild( TR( - TD(["colspan" => 2], "Select File"), - TD($tl_enabled ? "or URL" : null), - TD("Post-Specific Tags"), - TD("Post-Specific Source"), + ["class" => "header"], + TH(["colspan" => 2], "Select File"), + TH($tl_enabled ? "or URL" : null), + TH("Post-Specific Tags"), + TH("Post-Specific Source"), ) ); @@ -243,7 +242,7 @@ class UploadTheme extends Themelet $form = SHM_FORM("replace/".$image_id, "POST", true); $form->appendChild(emptyHTML( TABLE( - ["id" => "large_upload_form"], + ["id" => "large_upload_form", "class"=>"form"], $upload_list, TR(TD("Source"), TD(["colspan" => 3], INPUT(["name" => "source", "type" => "text"]))), TR(TD(["colspan" => 4], INPUT(["id" => "uploadbutton", "type" => "submit", "value" => "Post"]))),