From ccdf3c7861a8673151bcdeba9563556db578b71c Mon Sep 17 00:00:00 2001 From: celestora Date: Sat, 21 Jan 2023 14:59:09 +0200 Subject: [PATCH] Kinda fix poll display in non-microblog posts --- Web/Models/Entities/Traits/TAttachmentHost.php | 5 +++-- Web/Presenters/templates/components/post/oldpost.xml | 8 +++++++- Web/static/css/style.css | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Web/Models/Entities/Traits/TAttachmentHost.php b/Web/Models/Entities/Traits/TAttachmentHost.php index 0d5c42cf..db814cce 100644 --- a/Web/Models/Entities/Traits/TAttachmentHost.php +++ b/Web/Models/Entities/Traits/TAttachmentHost.php @@ -44,7 +44,7 @@ trait TAttachmentHost continue; } - $skipped[] = ["100%", "unset", $child, "unset"]; + $skipped[] = $child; } $height = "unset"; @@ -66,7 +66,8 @@ trait TAttachmentHost return (object) [ "width" => $width . "px", "height" => $height . "px", - "tiles" => array_merge($result, $skipped), + "tiles" => $result, + "extras" => $skipped, ]; } diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index 653f7dd4..d157a193 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -57,11 +57,17 @@ {var $width = $width - 70 * $GLOBALS["_nesAttGloCou"]} {/if} {var $attachmentsLayout = $post->getChildrenWithLayout($width)} -
+
{include "../attachment.xml", attachment => $attachment[2]}
+ +
+
+ {include "../attachment.xml", attachment => $attachment} +
+

diff --git a/Web/static/css/style.css b/Web/static/css/style.css index 0822a786..f2f0d2d0 100644 --- a/Web/static/css/style.css +++ b/Web/static/css/style.css @@ -638,10 +638,14 @@ h4 { line-height: 130%; } -.post-content .attachments_b { +.post-content .attachments:first-of-type { margin-top: 8px; } +.post-content .attachments_m .attachment { + width: 98%; +} + .attachment .post { width: 102%; }