feat(pay): mirror reference resource row with copy, icon and reorder
The post editor's download row only exposed address / button text / remark, leaving copy_key, copy_val and class as hidden inputs with no UI, so the reference copy area, custom button icon, text and color were unreachable. The submission popup already emitted those keys, which made the two write paths diverge from anything the editor could produce. Expose the full reference field set (地址/备注/复制名称/复制内容/图标/文案/ 颜色) as an accordion card with drag reordering, add the one genuinely new `icon` key through aksrt_sanitize_icon_value(), and teach both frontend download renderers to consume the fields they previously ignored. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,8 +42,15 @@ test('the download box renders direct anchors with inline extract codes', () =>
|
||||
assert.match(box, /\$btn_rel = ' rel="nofollow noopener"'/);
|
||||
|
||||
// Extract codes surface inline next to the anchor, no popup involved.
|
||||
assert.match(box, /if \(\$has_extract\) : \?>/);
|
||||
assert.match(box, /data-clipboard-text="<\?php echo esc_attr\(\$extract_code\); \?>/);
|
||||
assert.match(box, /if \(\$has_extract \|\| \$has_copy\) : \?>/);
|
||||
assert.match(box, /\$has_copy = \$copy_val !== '';/);
|
||||
assert.match(box, /data-clipboard-text="<\?php echo esc_attr\(\$has_copy \? \$copy_val : \$extract_code\); \?>/);
|
||||
assert.match(box, /data-clipboard-tag="<\?php echo esc_attr\(\$has_copy \?/);
|
||||
|
||||
// Custom icon / label / color from the pay meta feed the anchor.
|
||||
assert.match(box, /aksrt_icon_markup\(\$icon\)/);
|
||||
assert.match(box, /\$btn_text = \$label;/);
|
||||
assert.match(box, /resource-download-box__btn--custom/);
|
||||
|
||||
// The login gate keeps its own anchor.
|
||||
assert.match(box, /\$btn_href = \$login_url;/);
|
||||
|
||||
Reference in New Issue
Block a user