feat(user-ban): frontend ban modal replaces the backend restrictions tab
1:1 replicate the reference theme user-ban flow on the frontend: - Ban/unban modal rendered by inc/helpers/user-ban.php, opened via AksrtModalRuntime.openRemote (600px desktop dialog, 360px initial height, mobile bottom drawer, c-yellow colorful unban header). - Three entry points wired: user homepage cover three-dot menu, comment section menu, article author card menu (ban item takes priority over report, matching the reference hook order). - REST endpoints /user-ban/modal and /user-ban/set under aksrt/v1, guarded by check_permission, persisted through User\Restriction. - Submit semantics match zib_ajax_set_user_ban: ban reloads the page, unban only closes the modal. Cleanup (no dual-track): the backend ban-restrictions tab, its form handlers and flash keys are removed; ticket processing links to the frontend user homepage as the reference theme does; admin/report and appeal notification URLs move to type/status query args. Verification: 337/337 widget-system contract tests, 41/41 admin and front-submit tests, php -l clean on all changed PHP files.
This commit is contained in:
@@ -279,6 +279,8 @@ trait ScriptsPart1b {
|
||||
|
||||
// 举报脚本:举报入口渲染于文章页 meta 菜单、评论区与用户主页/个人中心,
|
||||
// 因此 singular 页面与 profile 路由都需要加载(文章页举报按钮此前无脚本支撑)。
|
||||
// 禁封脚本:禁封入口渲染于用户主页封面三点菜单、评论区三点菜单与文章
|
||||
// 作者栏三点菜单,与举报脚本同一组页面,合并加载。
|
||||
if (is_singular() || $is_profile_page) {
|
||||
$report_js_path = get_template_directory() . '/assets/js/report.js';
|
||||
if (file_exists($report_js_path)) {
|
||||
@@ -290,6 +292,16 @@ trait ScriptsPart1b {
|
||||
true
|
||||
);
|
||||
}
|
||||
$user_ban_js_path = get_template_directory() . '/assets/js/user-ban.js';
|
||||
if (file_exists($user_ban_js_path)) {
|
||||
wp_enqueue_script(
|
||||
'aksrt-user-ban',
|
||||
$base_uri . '/assets/js/user-ban.js',
|
||||
['loader_js'],
|
||||
filemtime($user_ban_js_path) ?: $version,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 用户中心 / 公开主页:路由专属 CSS
|
||||
|
||||
Reference in New Issue
Block a user