smaller gap between image controls

This commit is contained in:
Shish 2024-01-19 19:04:11 +00:00
parent dbb8bb8280
commit 46d11a0be5
6 changed files with 22 additions and 14 deletions

View file

@ -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",
$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;
}
}

View file

@ -3,3 +3,6 @@
overflow-wrap: break-word;
word-wrap: break-word;
}
#reportedimage .formstretch INPUT {
width: 100%;
}

View file

@ -23,19 +23,19 @@ class ReportImageTheme extends Themelet
$iabbe = send_event(new ImageAdminBlockBuildingEvent($image, $user, "report"));
ksort($iabbe->parts);
$actions = join("<br>", $iabbe->parts);
$actions = join("", $iabbe->parts);
$h_reportedimages .= "
<tr>
<td>{$image_link}</td>
<td class='reason'>Report by $userlink: $h_reason</td>
<td class='formstretch'>
<td class='formstretch post_controls'>
".make_form(make_link("image_report/remove"))."
<input type='hidden' name='id' value='{$report['id']}'>
<input type='submit' value='Remove Report'>
</form>
<br>$actions
$actions
</td>
</tr>
";

View file

@ -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);
}
});

View file

@ -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;
}

View file

@ -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));
}
}