Refactor VkPostPublisher to simplify message formatting and enhance PostListItem layout for better author display

This commit is contained in:
F4ilji
2025-11-25 16:10:50 +05:00
parent a983ab0424
commit 537fa2b0b5
2 changed files with 15 additions and 12 deletions
@@ -88,7 +88,7 @@ class VkPostPublisher
private function generateContentForVk($post): string private function generateContentForVk($post): string
{ {
$message = ''; $message = '';
$message .= "Название: $post->title\n\n"; $message .= "$post->title\n\n";
if (is_array($post->content)) { if (is_array($post->content)) {
$message .= $this->parseContentBlocks($post->content); $message .= $this->parseContentBlocks($post->content);
@@ -58,18 +58,20 @@
</a> </a>
</p> </p>
</div> </div>
<div class="flex items-center gap-3 text-gray-500"> <div
class="mt-3 flex items-center space-x-3 text-gray-500 dark:text-gray-400"
<span v-if="post?.authors?.length" class="truncate text-sm"> >
{{ textLimit(post.authors[0], 40) }} <span>
<div class="flex items-center gap-3">
<span v-if="post && post.authors && post.authors.length > 0" class="truncate text-sm">
{{ textLimit(post.authors[0], 20) }}
</span>
</div>
</span> </span>
<span class="text-xs text-gray-300 dark:text-gray-600"
<span v-if="post?.authors?.length" class="text-xs text-gray-300 dark:text-gray-600"></span> ></span
>
<span class="truncate text-sm"> <span class="truncate text-sm">{{ post.created_post }}</span>
{{ post.created_post }}
</span>
</div> </div>
</div> </div>
</div> </div>
@@ -78,6 +80,7 @@
</template> </template>
<script> <script>
export default { export default {