diff --git a/assets/css/routes/user-home.css b/assets/css/routes/user-home.css index 65d69dfd..4ee453bf 100644 --- a/assets/css/routes/user-home.css +++ b/assets/css/routes/user-home.css @@ -399,6 +399,17 @@ animation: panel-fade-in 0.25s ease; } +/* Public author posts follow Zibll's full-width, two-column list. */ +@media (min-width: 992px) { + .aksrt-user-home #panel-posts .aksrt-user-home__post-list .posts-item { + display: inline-flex; + width: calc(50% - 16px); + margin: 8px; + border-radius: var(--main-radius, 8px); + vertical-align: top; + } +} + @keyframes panel-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } diff --git a/templates/parts/user-home/panels-core.php b/templates/parts/user-home/panels-core.php index 97594feb..df1c1ab3 100644 --- a/templates/parts/user-home/panels-core.php +++ b/templates/parts/user-home/panels-core.php @@ -22,9 +22,14 @@ extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_ext 'no_found_rows' => false, ]); $author_render_config = aksrt_resolve_post_list_render_config([ - 'context' => 'author', + 'context' => 'author', + 'overrides' => [ + 'type' => 'list', + 'no_author' => true, + 'no_margin' => true, + ], ]); - aksrt_render_post_list(array_merge($author_render_config, ['wrapper_class' => 'profile-list']), $author_posts); + aksrt_render_post_list(array_merge($author_render_config, ['wrapper_class' => 'aksrt-user-home__post-list']), $author_posts); aksrt_render_pagination($author_posts, [ 'query_context' => 'author', 'render_config' => $author_render_config, diff --git a/tests/widget-system/post-visual-contract.test.cjs b/tests/widget-system/post-visual-contract.test.cjs index bf82c467..1c31e0ef 100644 --- a/tests/widget-system/post-visual-contract.test.cjs +++ b/tests/widget-system/post-visual-contract.test.cjs @@ -216,6 +216,10 @@ test('related posts, author page and widgets use their dedicated renderers', () assert.match(resourceRelated, /aksrt_render_related_graphic_card/); assert.doesNotMatch(resourceRelated, /aksrt_render_post_list/); assert.match(authorPosts, /aksrt_render_post_list/); + assert.match(authorPosts, /'type'\s*=>\s*'list'/); + assert.match(authorPosts, /'no_author'\s*=>\s*true/); + assert.match(authorPosts, /'no_margin'\s*=>\s*true/); + assert.match(authorPosts, /'wrapper_class'\s*=>\s*'aksrt-user-home__post-list'/); assert.match(authorPosts, /aksrt_render_pagination/); assert.match(authorPosts, /'page_var'\s*=>\s*'posts_page'/); assert.doesNotMatch(authorPosts, /aksrt_render_profile_pagination/); @@ -307,6 +311,7 @@ test('profile routes load versioned leaf styles and keep dialogs hidden initiall assert.match(accountModals, /id="email-modal" class="aksrt-modal" hidden/); assert.match(userCenterJs, /function closeModal\(m\)[\s\S]*?m\.hidden = true;/); assert.match(userHomeCss, /\.aksrt-profile-details-modal\[hidden\]\s*\{\s*display:\s*none\s*!important;\s*\}/); + assert.match(userHomeCss, /@media \(min-width: 992px\)[\s\S]*?\.aksrt-user-home #panel-posts \.aksrt-user-home__post-list \.posts-item\s*\{[^}]*display:\s*inline-flex;[^}]*width:\s*calc\(50% - 16px\);/); assert.match(profileLayoutCss, /\.aksrt-cover-menu__panel\[hidden\]\s*\{\s*display:\s*none\s*!important;\s*\}/); assert.match(profileLayoutCss, /#aksrt-bg-file-input\[hidden\],[\s\S]*?#aksrt-avatar-file-input\[hidden\][\s\S]*?display:\s*none\s*!important;/); assert.match(settingsSecurity, /data-modal="email-modal"[\s\S]*?<\/button>\s*<\/div>\s*
[\s\S]*?data-modal="phone-modal"/);