fix(theme): align reference layouts and restore passing contracts
Align homepage and category discovery, modern widgets, admin controls, quotes, and comments with the reference theme. Remove superseded paths and add rendering and behavior coverage. Update stale asset and finance contracts; all 760 Node tests and 139 widget assertions pass.
This commit is contained in:
1 parent
b520d29368
commit
8aa116ec43
63 files changed
+1985
-2304
No files matched your search
@@ -214,7 +214,6 @@ if (!function_exists('aksrt_widget_term_aggregation')) :
|
||||
}
|
||||
$href = esc_url((string) $href);
|
||||
|
||||
$icon = '<i class="fa fas fa-folder-open mr6" aria-hidden="true"></i>';
|
||||
$img = aksrt_widget_term_cover_url((int) $term->term_id, true);
|
||||
$img_html = aksrt_graphic_card([
|
||||
'class' => '',
|
||||
@@ -228,7 +227,12 @@ if (!function_exists('aksrt_widget_term_aggregation')) :
|
||||
$img_html = '<div class="term-img flex0 em09-sm">' . $img_html . '</div>';
|
||||
|
||||
$name = '<a class="em14 key-color text-ellipsis"' . $target . ' href="' . $href . '">' . esc_html($term->name) . '</a>';
|
||||
$description = '<div class="text-ellipsis-2 muted-color">' . esc_html($term->description) . '</div>';
|
||||
$description = wp_kses_post((string) $term->description);
|
||||
if ($description === '' && current_user_can('manage_categories')) {
|
||||
$description = esc_html__('请在WordPress后台-文章-文章分类中添加描述!', 'aksrt')
|
||||
. '<a href="' . esc_url(get_edit_term_link($term_id, 'category')) . '">' . esc_html__('立即编辑', 'aksrt') . '</a>';
|
||||
}
|
||||
$description = '<div class="text-ellipsis-2 muted-color">' . $description . '</div>';
|
||||
|
||||
$query_args = [
|
||||
'cat' => (string) $term->term_id,
|
||||
@@ -241,14 +245,18 @@ if (!function_exists('aksrt_widget_term_aggregation')) :
|
||||
];
|
||||
$query = \AKSRT\WidgetSystem\PostQuery::build($query_args, 1, []);
|
||||
|
||||
$meta = '<span class="px12 muted-3-color text-ellipsis"><i class="fa fas fa-file-alt fa-fw" aria-hidden="true"></i>' . sprintf(esc_html__('%s篇文章', 'aksrt'), esc_html(aksrt_format_number(max(0, (int) $query->found_posts)))) . '</span>';
|
||||
if (!$query->have_posts()) {
|
||||
wp_reset_postdata();
|
||||
return '';
|
||||
}
|
||||
$meta = '<span class="px12 muted-3-color text-ellipsis"><i class="fa far fa-file-alt fa-fw" aria-hidden="true"></i>' . sprintf(esc_html__('%s篇文章', 'aksrt'), esc_html((string) max(0, (int) $query->found_posts))) . '</span>';
|
||||
$meta .= '<a class="but p2-10 px12 c-blue hide-sm shrink0"' . $target . ' href="' . $href . '"><i class="fa fas fa-angle-right" aria-hidden="true"></i>' . esc_html__('更多文章', 'aksrt') . '</a>';
|
||||
$meta = '<div class="term-meta flex jsb ac">' . $meta . '</div>';
|
||||
|
||||
$posts_html = '';
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$data = aksrt_renderer_collect_post_data(['time_source' => 'date']);
|
||||
$data = aksrt_renderer_collect_post_data(['time_source' => $args['orderby'] === 'date' ? 'date' : 'modified']);
|
||||
if (!$data) {
|
||||
continue;
|
||||
}
|
||||
@@ -258,20 +266,20 @@ if (!function_exists('aksrt_widget_term_aggregation')) :
|
||||
$post_meta = '';
|
||||
switch ((string) $args['orderby']) {
|
||||
case 'views':
|
||||
$post_meta = aksrt_format_number((int) $data['views']);
|
||||
$post_meta = esc_html__('阅读[', 'aksrt') . aksrt_format_number((int) $data['views']) . ']';
|
||||
break;
|
||||
case 'favorite':
|
||||
$post_meta = aksrt_format_number((int) aksrt_get_post_favorites((int) $data['post_id']));
|
||||
$post_meta = esc_html__('收藏[', 'aksrt') . aksrt_format_number((int) aksrt_get_post_favorites((int) $data['post_id'])) . ']';
|
||||
break;
|
||||
case 'like':
|
||||
$post_meta = aksrt_format_number((int) aksrt_get_post_likes((int) $data['post_id']));
|
||||
$post_meta = esc_html__('点赞[', 'aksrt') . aksrt_format_number((int) aksrt_get_post_likes((int) $data['post_id'])) . ']';
|
||||
break;
|
||||
case 'comment_count':
|
||||
$post_meta = aksrt_format_number((int) $data['comments']);
|
||||
$post_meta = esc_html__('评论[', 'aksrt') . aksrt_format_number((int) $data['comments']) . ']';
|
||||
break;
|
||||
}
|
||||
if ($post_meta === '') {
|
||||
$post_meta = '<i class="fa fas fa-clock mr3" aria-hidden="true"></i>' . esc_html((string) $data['time_ago']);
|
||||
$post_meta = '<i class="fa far fa-clock mr3" aria-hidden="true"></i>' . esc_html((string) $data['time_ago']);
|
||||
}
|
||||
$posts_html .= '<div class="mt10 flex jsb ac">' . $title . '<div class="em09 muted-3-color flex0 ml10">' . $post_meta . '</div></div>';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user