feat: 优化管理员操作按钮样式和交互逻辑

This commit is contained in:
2026-04-10 17:14:55 +08:00
parent d30311e9bb
commit f5e00f1f35

View File

@@ -93,8 +93,8 @@ function build_status_admin_actions($solution_id, $postkey, $return_url, $can_de
$delete_text = htmlspecialchars($delete_text, ENT_QUOTES, 'UTF-8');
$rejudge_confirm = htmlspecialchars("确认重判提交 #".$solution_id." 吗?", ENT_QUOTES, 'UTF-8');
$delete_confirm = htmlspecialchars("确认删除提交 #".$solution_id." 吗?此操作不可恢复。", ENT_QUOTES, 'UTF-8');
$html = "<div style='display:flex;gap:6px;justify-content:center;flex-wrap:wrap'>";
$html .= "<form method='post' action='admin/status_action.php' style='margin:0' onsubmit=\"return confirm('".$rejudge_confirm."');\">";
$html = "<div style='display:flex;gap:6px;justify-content:center;align-items:center;flex-wrap:nowrap;white-space:nowrap'>";
$html .= "<form method='post' action='admin/status_action.php' style='margin:0;flex:0 0 auto' onsubmit=\"return confirm('".$rejudge_confirm."');\">";
$html .= "<input type='hidden' name='action' value='rejudge'>";
$html .= "<input type='hidden' name='sid' value='".$solution_id."'>";
$html .= "<input type='hidden' name='return_url' value='".$return_url."'>";
@@ -102,7 +102,7 @@ function build_status_admin_actions($solution_id, $postkey, $return_url, $can_de
$html .= "<button class='ui mini orange basic button' type='submit'>".$rejudge_text."</button>";
$html .= "</form>";
if ($can_delete) {
$html .= "<form method='post' action='admin/status_action.php' style='margin:0' onsubmit=\"return confirm('".$delete_confirm."');\">";
$html .= "<form method='post' action='admin/status_action.php' style='margin:0;flex:0 0 auto' onsubmit=\"return confirm('".$delete_confirm."');\">";
$html .= "<input type='hidden' name='action' value='delete'>";
$html .= "<input type='hidden' name='sid' value='".$solution_id."'>";
$html .= "<input type='hidden' name='return_url' value='".$return_url."'>";
@@ -111,7 +111,7 @@ function build_status_admin_actions($solution_id, $postkey, $return_url, $can_de
$html .= "</form>";
}
else {
$html .= "<span class='ui mini disabled button' title='仅可删除已结束评测的提交'>".$delete_text."</span>";
$html .= "<span class='ui mini disabled button' style='flex:0 0 auto;white-space:nowrap' title='仅可删除已结束评测的提交'>".$delete_text."</span>";
}
$html .= "</div>";
return $html;