From 6ffc5ba3d636e5d9c423e125048ba9ee46771732 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 6 Sep 2026 10:47:24 +0800 Subject: [PATCH] fix(submit): drop the redundant featured preview type badge The reference theme renders no type badge in the featured box; the swiper and dplayer previews are self-explanatory. Remove it from both preview branches and delete the now-unused CSS rule. --- assets/css/frontend/pages/submit.css | 10 ---------- assets/js/front-submit.js | 6 ++---- templates/parts/submit/featured.php | 2 -- tests/front-submit/featured-buttons-contract.test.cjs | 10 ++++++++++ 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/assets/css/frontend/pages/submit.css b/assets/css/frontend/pages/submit.css index 48b3e007..8cb301e4 100644 --- a/assets/css/frontend/pages/submit.css +++ b/assets/css/frontend/pages/submit.css @@ -504,16 +504,6 @@ body.aksrt-editor-media-open { object-fit: cover; } -.featured-edit .featured-type-badge { - position: absolute; - right: 12px; - bottom: 12px; - padding: 4px 8px; - border-radius: 30px; - background: rgba(0, 0, 0, 0.55); - color: #fff; -} - .featured-edit .btns-full { height: 150px; border: 2px dashed var(--main-border-color, rgba(50, 50, 50, 0.08)); diff --git a/assets/js/front-submit.js b/assets/js/front-submit.js index 0cb34d25..5ac808d2 100644 --- a/assets/js/front-submit.js +++ b/assets/js/front-submit.js @@ -449,8 +449,7 @@ '
' + '
' + '
' + - '' + - ''; + ''; } else if (t === 'video') { html = '
' + '
' + - '
' + - ''; + ''; } this.destroyFeaturedPlayer(preview); preview.innerHTML = html; diff --git a/templates/parts/submit/featured.php b/templates/parts/submit/featured.php index 2d8ca4d3..a05b1342 100644 --- a/templates/parts/submit/featured.php +++ b/templates/parts/submit/featured.php @@ -39,7 +39,6 @@ $can_video = !empty($ctx['can_cover_video']);
-
-
diff --git a/tests/front-submit/featured-buttons-contract.test.cjs b/tests/front-submit/featured-buttons-contract.test.cjs index 45f136ce..580e1fdc 100644 --- a/tests/front-submit/featured-buttons-contract.test.cjs +++ b/tests/front-submit/featured-buttons-contract.test.cjs @@ -65,6 +65,16 @@ test('slide cover preview renders a real swiper like the reference theme', () => assert.doesNotMatch(js, /escapeHtml\(d\[0\]\.url\)/); }); +test('featured previews carry no type badge like the reference theme', () => { + const featured = read('templates/parts/submit/featured.php'); + const js = read('assets/js/front-submit.js'); + const css = read('assets/css/frontend/pages/submit.css'); + + assert.doesNotMatch(featured, /featured-type-badge/); + assert.doesNotMatch(js, /featured-type-badge/); + assert.doesNotMatch(css, /featured-type-badge/); +}); + test('submit.css mirrors the reference visibility matrix for the buttons row', () => { const css = read('assets/css/frontend/pages/submit.css');