Kinda fix poll display in non-microblog posts

This commit is contained in:
celestora 2023-01-21 14:59:09 +02:00
parent d8e0995962
commit ccdf3c7861
3 changed files with 15 additions and 4 deletions

View file

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

View file

@ -57,11 +57,17 @@
{var $width = $width - 70 * $GLOBALS["_nesAttGloCou"]}
{/if}
{var $attachmentsLayout = $post->getChildrenWithLayout($width)}
<div n:ifcontent class="attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div n:ifcontent class="attachments attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
<div class="attachment" n:foreach="$attachmentsLayout->tiles as $attachment" style="float: {$attachment[3]|noescape}; width: {$attachment[0]|noescape}; height: {$attachment[1]|noescape};" data-localized-nsfw-text="{_nsfw_warning}">
{include "../attachment.xml", attachment => $attachment[2]}
</div>
</div>
<div n:ifcontent class="attachments attachments_m">
<div class="attachment" n:foreach="$attachmentsLayout->extras as $attachment">
{include "../attachment.xml", attachment => $attachment}
</div>
</div>
</div>
<div n:if="$post->isAd()" style="color:grey;">
<br/>

View file

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