Skip to content

Commit

Permalink
[pools] make sure image lists have the css class shm-image-list, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Feb 11, 2024
1 parent a9e2d02 commit 2661880
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions ext/pools/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ public function view_pool(Pool $pool, array $images, int $pageNumber, int $total

$this->display_top($pool, "Pool: " . html_escape($pool->title));

$pool_images = emptyHTML();
$image_list = DIV(["class" => "shm-image-list"]);
foreach ($images as $image) {
$pool_images->appendChild($this->build_thumb_html($image));
$image_list->appendChild($this->build_thumb_html($image));
}

$page->add_block(new Block("Viewing Posts", $pool_images, "main", 30));
$page->add_block(new Block("Viewing Posts", $image_list, "main", 30));
$this->display_paginator($page, "pool/view/" . $pool->id, null, $pageNumber, $totalPages);
}

Expand Down Expand Up @@ -276,11 +276,13 @@ function confirm_action() {
);

$form = SHM_FORM("pool/add_posts", name: "checks");
$image_list = DIV(["class" => "shm-image-list"]);
foreach ($images as $image) {
$form->appendChild(
$image_list->appendChild(
SPAN(["class" => "thumb"], $this->build_thumb_html($image), BR(), INPUT(["type" => "checkbox", "name" => "check[]", "value" => $image->id])),
);
}
$form->appendChild($image_list);

$form->appendChild(
BR(),
Expand All @@ -305,15 +307,17 @@ public function edit_order(Page $page, Pool $pool, array $images): void
$this->display_top($pool, "Sorting Pool");

$form = SHM_FORM("pool/order", name: "checks");
$image_list = DIV(["class" => "shm-image-list"]);
foreach ($images as $i => $image) {
$form->appendChild(SPAN(
$image_list->appendChild(SPAN(
["class" => "thumb"],
$this->build_thumb_html($image),
INPUT(["type" => "number", "name" => "imgs[$i][]", "value" => $image['image_order'], "style" => "max-width: 50px;"]),
INPUT(["type" => "hidden", "name" => "imgs[$i][]", "value" => $image->id])
));
}

$form->appendChild($image_list);

$form->appendChild(
INPUT(["type" => "hidden", "name" => "pool_id", "value" => $pool->id]),
SHM_SUBMIT("Order", ["name" => "edit", "id" => "edit_pool_order"])
Expand Down Expand Up @@ -343,13 +347,15 @@ public function edit_pool(Page $page, Pool $pool, array $images): void
);

$images_form = SHM_FORM("pool/remove_posts", name: "checks");
$image_list = DIV(["class" => "shm-image-list"]);
foreach ($images as $image) {
$images_form->appendChild(SPAN(
$image_list->appendChild(SPAN(
["class" => "thumb"],
$this->build_thumb_html($image),
INPUT(["type" => "checkbox", "name" => "check[]", "value" => $image->id])
));
}
$images_form->appendChild($image_list);

$images_form->appendChild(
BR(),
Expand Down

0 comments on commit 2661880

Please sign in to comment.