diff --git a/inc/helpers/homepage/header-components.php b/inc/helpers/homepage/header-components.php index 0554657e..0044390d 100644 --- a/inc/helpers/homepage/header-components.php +++ b/inc/helpers/homepage/header-components.php @@ -279,13 +279,13 @@ if (!function_exists('aksrt_get_header_slider_markup')) { . ($background !== '' ? ' poster="' . esc_url($background) . '"' : '') . '>
'; } elseif ($video !== '') { $slide_class .= ' slide-dplayer'; - $background_html = '
'; + $background_html = '
'; if ($background !== '') { $poster_class = 'absolute dplayer-poster' . (!empty($options['gradient_bg']) ? ' gradient-bg' : ''); $poster_attrs = !empty($options['gradient_bg']) ? ' data-opacity="0.2"' : ''; $background_html .= '
' . aksrt_header_slider_image($background, 'no-imgbox radius8', $alt) - . '
'; + . '
'; } } elseif ($background !== '') { $background_html = aksrt_header_slider_image($background, 'radius8', $alt); diff --git a/src/Messages/MessageTypes.php b/src/Messages/MessageTypes.php index bdff5e1c..1273fc17 100644 --- a/src/Messages/MessageTypes.php +++ b/src/Messages/MessageTypes.php @@ -34,7 +34,6 @@ final class MessageTypes { 'ban_appeal' => __('禁封申诉', 'aksrt'), 'report' => __('举报', 'aksrt'), 'withdraw' => __('提现', 'aksrt'), - 'credits_added' => __('积分增加', 'aksrt'), 'ticket_new' => __('新工单', 'aksrt'), 'ticket_reply' => __('工单回复', 'aksrt'), 'ticket_urge' => __('工单催单', 'aksrt'), @@ -58,7 +57,7 @@ final class MessageTypes { if (in_array($type, ['report', 'ban_appeal', 'asset_balance_decrease', 'asset_points_decrease'], true)) { return 'danger'; } - if (in_array($type, ['withdraw', 'level_up', 'medal', 'auth_apply_reply', 'download_ready', 'credits_added', 'asset_balance_increase', 'asset_points_increase'], true)) { + if (in_array($type, ['withdraw', 'level_up', 'medal', 'auth_apply_reply', 'download_ready', 'asset_balance_increase', 'asset_points_increase'], true)) { return 'success'; } if (in_array($type, ['system', 'notice'], true)) { diff --git a/src/WidgetSystem/WidgetDefinition.php b/src/WidgetSystem/WidgetDefinition.php index 4d946f98..8557da9f 100644 --- a/src/WidgetSystem/WidgetDefinition.php +++ b/src/WidgetSystem/WidgetDefinition.php @@ -103,7 +103,7 @@ final class WidgetDefinition { 'sidebar' => __('此模块只适合添加到侧边栏', 'aksrt'), ]; if (isset($reminders[$this->size])) { - $header[] = ['type' => 'submessage', 'style' => 'warning', 'content' => '' . esc_html($reminders[$this->size])]; + $header[] = ['type' => 'submessage', 'style' => 'warning', 'content' => '' . esc_html($reminders[$this->size])]; } $common = CommonFields::for_definition($this->common); if ($common && $this->fields) { diff --git a/tests/widget-system/message-admin-contract.test.cjs b/tests/widget-system/message-admin-contract.test.cjs index 18ea7c73..ed092a1a 100644 --- a/tests/widget-system/message-admin-contract.test.cjs +++ b/tests/widget-system/message-admin-contract.test.cjs @@ -165,22 +165,19 @@ test('role broadcasts require confirmation of the current role and count on the assert.equal(nonce_checked.length, 8); }); -test('asset and credit types use Chinese labels in filters, row badges and details', () => { - const { asset_types, filter_form, asset_table, credits_table } = harness(); +test('asset types use Chinese labels in filters, row badges and details', () => { + const { asset_types, filter_form, asset_table } = harness(); assert.deepEqual(asset_types, { asset_balance_increase: ['余额增加', 'success'], asset_balance_decrease: ['余额减少', 'danger'], asset_points_increase: ['积分增加', 'success'], asset_points_decrease: ['积分减少', 'danger'], - credits_added: ['积分增加', 'success'], }); for (const [type, [label]] of Object.entries(asset_types)) { assert.ok(filter_form.includes(``)); } assert.match(asset_table, /class="aksrt-msg-badge is-success"[^>]*>余额增加<\/a>/); assert.match(asset_table, /
消息类型<\/dt>
余额增加<\/dd>/); - assert.match(credits_table, /class="aksrt-msg-badge is-success"[^>]*>积分增加<\/a>/); - assert.match(credits_table, /
消息类型<\/dt>
积分增加<\/dd>/); }); test('single row actions cannot accidentally operate on the checked bulk selection', () => { diff --git a/tests/widget-system/message-admin-harness.php b/tests/widget-system/message-admin-harness.php index 3c4f3fd5..1b96c9b4 100644 --- a/tests/widget-system/message-admin-harness.php +++ b/tests/widget-system/message-admin-harness.php @@ -84,7 +84,7 @@ namespace { public function get_var($sql) { return 2; } public function get_results($sql, $format) { return []; } public function get_row($sql, $format) { return ['total' => 2, 'unread' => 1, 'today' => 1, 'recipients' => 2]; } - public function get_col($sql) { return ['system', 'asset_balance_increase', 'asset_balance_decrease', 'asset_points_increase', 'asset_points_decrease', 'credits_added']; } + public function get_col($sql) { return ['system', 'asset_balance_increase', 'asset_balance_decrease', 'asset_points_increase', 'asset_points_decrease']; } public function query($sql) { $this->queries[] = $sql; return 1; } public function esc_like($text) { return addcslashes($text, '_%\\'); } } @@ -121,8 +121,7 @@ namespace { $out['empty'] = $probe->html('render_message_table', [], $filters, 1, false); $out['cache_calls'] = $GLOBALS['cache_calls']; $out['asset_table'] = $probe->html('render_message_table', [array_merge($row, ['type' => 'asset_balance_increase'])], $filters, 1, false); - $out['credits_table'] = $probe->html('render_message_table', [array_merge($row, ['type' => 'credits_added'])], $filters, 1, false); - foreach (['asset_balance_increase', 'asset_balance_decrease', 'asset_points_increase', 'asset_points_decrease', 'credits_added'] as $type) { + foreach (['asset_balance_increase', 'asset_balance_decrease', 'asset_points_increase', 'asset_points_decrease'] as $type) { $out['asset_types'][$type] = [\AKSRT\Messages\MessageTypes::label($type), \AKSRT\Messages\MessageTypes::tone($type)]; } diff --git a/tests/widget-system/mini-pay-badge-reference.test.cjs b/tests/widget-system/mini-pay-badge-reference.test.cjs index 85e607f1..8a8c77b1 100644 --- a/tests/widget-system/mini-pay-badge-reference.test.cjs +++ b/tests/widget-system/mini-pay-badge-reference.test.cjs @@ -85,7 +85,7 @@ test('mini badges stay on the correct meta side, disappear with meta and ignore test('mini badge styles preserve reference padding and VIP aspect ratio across page bundles', () => { const widgetCss = read('assets/widgets/frontend.css'); - const rule = widgetCss.match(/\.widget-tab-post \.item-meta \.meta-pay\s*\{([^}]+)\}/)[1]; + const rule = widgetCss.match(/\.widget-tab-post \.item-meta \.meta-pay, \.widget-main-post \.item-meta \.meta-pay\s*\{([^}]+)\}/)[1]; assert.match(rule, /padding:\s*0 4px/); assert.match(rule, /cursor:\s*auto/); for (const file of ['assets/css/frontend/post-card.css', 'assets/css/build/homepage.css']) { diff --git a/tests/widget-system/pay-card-contract.test.cjs b/tests/widget-system/pay-card-contract.test.cjs index 30665e08..3dcc8ffd 100644 --- a/tests/widget-system/pay-card-contract.test.cjs +++ b/tests/widget-system/pay-card-contract.test.cjs @@ -46,7 +46,7 @@ test('paid article and sidebar widget use the Zibll purchase-card DOM', () => { assert.match(pay, /支付金额/); assert.match(pay, /hidden-box show/); assert.match(widget, /'layout' => 'widget'/); - assert.match(shell, /'post_pay', 'posts', 'oneline_posts'/); + assert.match(shell, /'post_pay', 'oneline_posts', 'hot_posts'/); assert.doesNotMatch(single, /aksrt-panel pay-box pay-type-download/); assert.doesNotMatch(single, /get_template_part\('templates\/parts\/resource-download-box'\)/); assert.match(single, /aksrt_get_paid_box_html\(\$post\)/);