公开用户主页文章双列实现

This commit is contained in:
2026-08-20 14:20:20 +08:00
parent c4e162839c
commit 5f01b3b316
3 changed files with 23 additions and 2 deletions
+11
View File
@@ -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); }
+6 -1
View File
@@ -23,8 +23,13 @@ extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_ext
]);
$author_render_config = aksrt_resolve_post_list_render_config([
'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,
@@ -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*<div class="security-action-item">[\s\S]*?data-modal="phone-modal"/);